Imported Upstream version 1.6.1 57/193957/1 upstream/1.6.1
authorDongHun Kwak <dh0128.kwak@samsung.com>
Wed, 28 Nov 2018 00:41:26 +0000 (09:41 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Wed, 28 Nov 2018 00:41:27 +0000 (09:41 +0900)
Change-Id: I1d4351214427384767ef0a73ff7600f2b8353d26
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
155 files changed:
NEWS
README
configure
configure.ac
src/bin/fstarcsort.cc
src/bin/fstcompile.cc
src/bin/fstcompose.cc
src/bin/fstconcat.cc
src/bin/fstdifference.cc
src/bin/fstdraw.cc
src/bin/fstequal.cc
src/bin/fstequivalent.cc
src/bin/fstintersect.cc
src/bin/fstisomorphic.cc
src/bin/fstmap.cc
src/bin/fstminimize.cc
src/bin/fstprint.cc
src/bin/fstrandgen.cc
src/bin/fstrelabel.cc
src/bin/fstrmepsilon.cc
src/bin/fstshortestdistance.cc
src/bin/fstshortestpath.cc
src/bin/fsttopsort.cc
src/bin/fstunion.cc
src/extensions/compact/Makefile.am
src/extensions/compact/Makefile.in
src/extensions/compress/Makefile.am
src/extensions/compress/Makefile.in
src/extensions/compress/fstcompress.cc
src/extensions/compress/fstrandmod.cc
src/extensions/const/Makefile.am
src/extensions/const/Makefile.in
src/extensions/far/Makefile.am
src/extensions/far/Makefile.in
src/extensions/linear/Makefile.am
src/extensions/linear/Makefile.in
src/extensions/linear/fstloglinearapply.cc
src/extensions/lookahead/Makefile.am
src/extensions/lookahead/Makefile.in
src/extensions/mpdt/Makefile.am
src/extensions/mpdt/Makefile.in
src/extensions/mpdt/mpdtcompose.cc
src/extensions/mpdt/mpdtexpand.cc
src/extensions/mpdt/mpdtinfo.cc
src/extensions/mpdt/mpdtreverse.cc
src/extensions/ngram/Makefile.am
src/extensions/ngram/Makefile.in
src/extensions/ngram/bitmap-index.cc
src/extensions/pdt/Makefile.am
src/extensions/pdt/Makefile.in
src/extensions/pdt/pdtcompose.cc
src/extensions/pdt/pdtexpand.cc
src/extensions/pdt/pdtinfo.cc
src/extensions/pdt/pdtreverse.cc
src/extensions/pdt/pdtshortestpath.cc
src/extensions/python/fst.pxd
src/extensions/python/pywrapfst.cc
src/extensions/python/pywrapfst.pxd
src/extensions/python/pywrapfst.pyx
src/extensions/special/Makefile.am
src/extensions/special/Makefile.in
src/include/fst/accumulator.h
src/include/fst/add-on.h
src/include/fst/arc-map.h
src/include/fst/bi-table.h
src/include/fst/cache.h
src/include/fst/compact-fst.h
src/include/fst/complement.h
src/include/fst/compose.h
src/include/fst/const-fst.h
src/include/fst/determinize.h
src/include/fst/edit-fst.h
src/include/fst/encode.h
src/include/fst/equal.h
src/include/fst/equivalent.h
src/include/fst/expanded-fst.h
src/include/fst/expectation-weight.h
src/include/fst/extensions/compress/compress-script.h
src/include/fst/extensions/far/far-class.h
src/include/fst/extensions/far/far.h
src/include/fst/extensions/far/stlist.h
src/include/fst/extensions/far/sttable.h
src/include/fst/extensions/linear/linear-fst-data-builder.h
src/include/fst/extensions/linear/linear-fst.h
src/include/fst/extensions/mpdt/mpdt.h
src/include/fst/extensions/mpdt/mpdtscript.h
src/include/fst/extensions/ngram/ngram-fst.h
src/include/fst/extensions/pdt/collection.h
src/include/fst/extensions/pdt/expand.h
src/include/fst/extensions/pdt/paren.h
src/include/fst/extensions/pdt/pdt.h
src/include/fst/extensions/pdt/pdtscript.h
src/include/fst/extensions/pdt/shortest-path.h
src/include/fst/extensions/special/phi-fst.h
src/include/fst/extensions/special/rho-fst.h
src/include/fst/extensions/special/sigma-fst.h
src/include/fst/factor-weight.h
src/include/fst/fst-decl.h
src/include/fst/fst.h
src/include/fst/generic-register.h
src/include/fst/icu.h
src/include/fst/intersect.h
src/include/fst/isomorphic.h
src/include/fst/label-reachable.h
src/include/fst/lexicographic-weight.h
src/include/fst/lookahead-filter.h
src/include/fst/lookahead-matcher.h
src/include/fst/matcher.h
src/include/fst/memory.h
src/include/fst/minimize.h
src/include/fst/mutable-fst.h
src/include/fst/pair-weight.h
src/include/fst/prune.h
src/include/fst/push.h
src/include/fst/queue.h
src/include/fst/randequivalent.h
src/include/fst/randgen.h
src/include/fst/register.h
src/include/fst/relabel.h
src/include/fst/replace-util.h
src/include/fst/replace.h
src/include/fst/reweight.h
src/include/fst/rmepsilon.h
src/include/fst/script/draw-impl.h
src/include/fst/script/draw.h
src/include/fst/script/getters.h
src/include/fst/script/relabel.h
src/include/fst/script/script-impl.h
src/include/fst/shortest-distance.h
src/include/fst/shortest-path.h
src/include/fst/state-map.h
src/include/fst/state-reachable.h
src/include/fst/state-table.h
src/include/fst/statesort.h
src/include/fst/string.h
src/include/fst/symbol-table.h
src/include/fst/test-properties.h
src/include/fst/tuple-weight.h
src/include/fst/util.h
src/include/fst/vector-fst.h
src/include/fst/verify.h
src/include/fst/weight.h
src/lib/fst.cc
src/lib/mapped-file.cc
src/lib/symbol-table.cc
src/lib/util.cc
src/script/draw.cc
src/script/fst-class.cc
src/script/relabel.cc
src/script/text-io.cc
src/test/algo_test.h
src/test/fst_test.cc
src/test/rand-fst.h
src/test/weight-tester.h
src/test/weight_test.cc

diff --git a/NEWS b/NEWS
index 792a194..2a1c247 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,6 @@
 OpenFst: Release 1.6
+    * Fixes missing includes of <fst/log.h> (1.6.1)
+    * Adds float format support to FST drawing (1.6.1)
     * Extensive modernization for C++11 style (1.6.0)
     * Many classes and constants moved into an internal namespace (1.6.0)
     * Adds HashMatcher (1.6.0)
diff --git a/README b/README
index 18f42d2..1016ca0 100644 (file)
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-OpenFst: Release 1.6.0
+OpenFst: Release 1.6.1
 
 OpenFst is a library for constructing, combining, optimizing, and searching
 weighted finite-state transducers (FSTs).
index 726ba88..92abf64 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for OpenFst 1.6.0.
+# Generated by GNU Autoconf 2.69 for OpenFst 1.6.1.
 #
 # Report bugs to <help@www.openfst.org>.
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='OpenFst'
 PACKAGE_TARNAME='openfst'
-PACKAGE_VERSION='1.6.0'
-PACKAGE_STRING='OpenFst 1.6.0'
+PACKAGE_VERSION='1.6.1'
+PACKAGE_STRING='OpenFst 1.6.1'
 PACKAGE_BUGREPORT='help@www.openfst.org'
 PACKAGE_URL=''
 
@@ -1381,7 +1381,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures OpenFst 1.6.0 to adapt to many kinds of systems.
+\`configure' configures OpenFst 1.6.1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1451,7 +1451,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of OpenFst 1.6.0:";;
+     short | recursive ) echo "Configuration of OpenFst 1.6.1:";;
    esac
   cat <<\_ACEOF
 
@@ -1578,7 +1578,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-OpenFst configure 1.6.0
+OpenFst configure 1.6.1
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1977,7 +1977,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by OpenFst $as_me 1.6.0, which was
+It was created by OpenFst $as_me 1.6.1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2840,7 +2840,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='openfst'
- VERSION='1.6.0'
+ VERSION='1.6.1'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -4144,7 +4144,10 @@ unknown)
 esac
 
 
-CPPFLAGS="$CPPFLAGS -funsigned-char"
+# OpenFst does not throw exceptions, so we do not generate exception handling
+# code. However, users are free to re-enable exception handling.
+# OpenFst assumes char is unsigned; -fsigned-char is likely unsafe.
+CPPFLAGS="$CPPFLAGS -fno-exceptions -funsigned-char"
 CXXFLAGS="$CXXFLAGS -std=c++11"
 
 ac_ext=cpp
@@ -16749,7 +16752,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by OpenFst $as_me 1.6.0, which was
+This file was extended by OpenFst $as_me 1.6.1, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -16815,7 +16818,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-OpenFst config.status 1.6.0
+OpenFst config.status 1.6.1
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
index 41bdb60..b5bf5d6 100644 (file)
@@ -1,8 +1,11 @@
-AC_INIT([OpenFst], [1.6.0], [help@www.openfst.org])
+AC_INIT([OpenFst], [1.6.1], [help@www.openfst.org])
 AM_INIT_AUTOMAKE([foreign nostdinc -Wall -Werror subdir-objects])
 AM_PROG_AR
 
-CPPFLAGS="$CPPFLAGS -funsigned-char"
+# OpenFst does not throw exceptions, so we do not generate exception handling
+# code. However, users are free to re-enable exception handling.
+# OpenFst assumes char is unsigned; -fsigned-char is likely unsafe.
+CPPFLAGS="$CPPFLAGS -fno-exceptions -funsigned-char"
 CXXFLAGS="$CXXFLAGS -std=c++11"
 
 AC_PROG_CXX
index c67980f..3a124dc 100644 (file)
@@ -9,6 +9,7 @@
 #include <string>
 
 #include <fst/compat.h>
+#include <fst/log.h>
 #include <fst/script/arcsort.h>
 #include <fst/script/getters.h>
 
index 184c7b8..8e71c0f 100644 (file)
@@ -10,6 +10,7 @@
 #include <memory>
 #include <string>
 
+#include <fst/log.h>
 #include <fst/script/compile.h>
 
 DEFINE_bool(acceptor, false, "Input in acceptor format");
index 0a0796b..b614024 100644 (file)
@@ -8,6 +8,7 @@
 #include <memory>
 #include <string>
 
+#include <fst/log.h>
 #include <fst/script/compose.h>
 #include <fst/script/getters.h>
 
index b4fd323..7437221 100644 (file)
@@ -8,6 +8,7 @@
 #include <memory>
 #include <string>
 
+#include <fst/log.h>
 #include <fst/script/concat.h>
 
 int main(int argc, char **argv) {
index 0a12492..406c965 100644 (file)
@@ -8,6 +8,7 @@
 #include <memory>
 #include <string>
 
+#include <fst/log.h>
 #include <fst/script/getters.h>
 #include <fst/script/difference.h>
 
index b356359..374aaf7 100644 (file)
@@ -10,6 +10,7 @@
 #include <ostream>
 #include <string>
 
+#include <fst/log.h>
 #include <fst/script/draw.h>
 
 DEFINE_bool(acceptor, false, "Input in acceptor format");
@@ -18,6 +19,8 @@ DEFINE_string(osymbols, "", "Output label symbol table");
 DEFINE_string(ssymbols, "", "State label symbol table");
 DEFINE_bool(numeric, false, "Print numeric labels");
 DEFINE_int32(precision, 5, "Set precision (number of char/float)");
+DEFINE_string(float_format, "g",
+              "Floating-point format, one of: \"e\", \"f\", or \"g\"");
 DEFINE_bool(show_weight_one, false,
             "Print/draw arc weights and final weights equal to Weight::One()");
 DEFINE_string(title, "", "Set figure title");
@@ -98,7 +101,8 @@ int main(int argc, char **argv) {
   s::DrawFst(*fst, isyms.get(), osyms.get(), ssyms.get(), FLAGS_acceptor,
              FLAGS_title, FLAGS_width, FLAGS_height, FLAGS_portrait,
              FLAGS_vertical, FLAGS_ranksep, FLAGS_nodesep, FLAGS_fontsize,
-             FLAGS_precision, FLAGS_show_weight_one, &ostrm, dest);
+             FLAGS_precision, FLAGS_float_format, FLAGS_show_weight_one,
+             &ostrm, dest);
 
   return 0;
 }
index 64a8082..ef0f021 100644 (file)
@@ -8,6 +8,7 @@
 #include <memory>
 #include <string>
 
+#include <fst/log.h>
 #include <fst/script/equal.h>
 
 DEFINE_double(delta, fst::kDelta, "Comparison/quantization delta");
index 9916041..036cee3 100644 (file)
@@ -12,6 +12,7 @@
 #include <memory>
 #include <string>
 
+#include <fst/log.h>
 #include <fst/script/equivalent.h>
 #include <fst/script/getters.h>
 #include <fst/script/randequivalent.h>
index 44332f4..5fc9bb9 100644 (file)
@@ -8,6 +8,7 @@
 #include <memory>
 #include <string>
 
+#include <fst/log.h>
 #include <fst/script/getters.h>
 #include <fst/script/intersect.h>
 
index f4ddfeb..fff597a 100644 (file)
@@ -10,6 +10,7 @@
 #include <memory>
 #include <string>
 
+#include <fst/log.h>
 #include <fst/script/isomorphic.h>
 
 DEFINE_double(delta, fst::kDelta, "Comparison/quantization delta");
index eaf03c3..db3e26a 100644 (file)
@@ -8,6 +8,7 @@
 #include <memory>
 #include <string>
 
+#include <fst/log.h>
 #include <fst/script/getters.h>
 #include <fst/script/map.h>
 
index d7cc833..31d1900 100644 (file)
@@ -8,6 +8,7 @@
 #include <memory>
 #include <string>
 
+#include <fst/log.h>
 #include <fst/script/minimize.h>
 
 DEFINE_double(delta, fst::kDelta, "Comparison/quantization delta");
index f28ef3f..723056b 100644 (file)
@@ -10,6 +10,7 @@
 #include <ostream>
 #include <string>
 
+#include <fst/log.h>
 #include <fst/script/print.h>
 
 DEFINE_bool(acceptor, false, "Input in acceptor format?");
index 309ab94..fc7f2d2 100644 (file)
@@ -12,6 +12,7 @@
 #include <memory>
 #include <string>
 
+#include <fst/log.h>
 #include <fst/script/getters.h>
 #include <fst/script/randgen.h>
 
index df41e58..1836bfb 100644 (file)
@@ -19,6 +19,10 @@ DEFINE_string(relabel_isymbols, "", "Input symbol set to relabel to");
 DEFINE_string(relabel_osymbols, "", "Output symbol set to relabel to");
 DEFINE_string(relabel_ipairs, "", "Input relabel pairs (numeric)");
 DEFINE_string(relabel_opairs, "", "Output relabel pairs (numeric)");
+DEFINE_string(unknown_isymbol, "",
+              "Input symbol to use to relabel OOVs (def: OOVs are errors");
+DEFINE_string(unknown_osymbol, "",
+              "Output symbol to use to relabel OOVs (def: OOVs are errors");
 
 DEFINE_bool(allow_negative_labels, false,
             "Allow negative labels (not recommended; may cause conflicts)");
@@ -77,9 +81,11 @@ int main(int argc, char** argv) {
             : SymbolTable::ReadText(FLAGS_relabel_osymbols, opts));
     s::Relabel(fst.get(),
                old_isymbols ? old_isymbols.get() : fst->InputSymbols(),
-               relabel_isymbols.get(), attach_new_isymbols,
+               relabel_isymbols.get(), FLAGS_unknown_isymbol,
+               attach_new_isymbols,
                old_osymbols ? old_osymbols.get() : fst->OutputSymbols(),
-               relabel_osymbols.get(), attach_new_osymbols);
+               relabel_osymbols.get(), FLAGS_unknown_osymbol,
+               attach_new_osymbols);
   } else {
     // Reads in relabeling pairs.
     std::vector<s::LabelPair> ipairs;
index 1d5e280..a249a58 100644 (file)
@@ -8,6 +8,7 @@
 #include <memory>
 #include <string>
 
+#include <fst/log.h>
 #include <fst/script/getters.h>
 #include <fst/script/rmepsilon.h>
 
index 6e25ff3..eb65087 100644 (file)
@@ -9,6 +9,7 @@
 #include <string>
 #include <vector>
 
+#include <fst/log.h>
 #include <fst/script/getters.h>
 #include <fst/script/shortest-distance.h>
 #include <fst/script/text-io.h>
index fc80ffb..d643132 100644 (file)
@@ -9,6 +9,7 @@
 #include <string>
 #include <vector>
 
+#include <fst/log.h>
 #include <fst/script/getters.h>
 #include <fst/script/shortest-path.h>
 
index 5815c89..8578c93 100644 (file)
@@ -8,6 +8,7 @@
 #include <memory>
 #include <string>
 
+#include <fst/log.h>
 #include <fst/script/topsort.h>
 
 int main(int argc, char **argv) {
index f49b87a..0a23b2c 100644 (file)
@@ -8,6 +8,7 @@
 #include <memory>
 #include <string>
 
+#include <fst/log.h>
 #include <fst/script/union.h>
 
 int main(int argc, char **argv) {
index 306936e..456fca3 100644 (file)
@@ -6,7 +6,7 @@ libfst_LTLIBRARIES = compact8_acceptor-fst.la compact8_string-fst.la compact8_un
 lib_LTLIBRARIES = libfstcompact.la
 
 libfstcompact_la_SOURCES = compact8_acceptor-fst.cc compact8_string-fst.cc compact8_unweighted-fst.cc compact8_unweighted_acceptor-fst.cc compact8_weighted_string-fst.cc compact16_acceptor-fst.cc compact16_string-fst.cc compact16_unweighted-fst.cc compact16_unweighted_acceptor-fst.cc compact16_weighted_string-fst.cc compact64_acceptor-fst.cc compact64_string-fst.cc compact64_unweighted-fst.cc compact64_unweighted_acceptor-fst.cc compact64_weighted_string-fst.cc
-libfstcompact_la_LDFLAGS = -version-info 6:0:0
+libfstcompact_la_LDFLAGS = -version-info 7:0:0
 libfstcompact_la_LIBADD = ../../lib/libfst.la -lm $(DL_LIBS)
 
 compact8_acceptor_fst_la_SOURCES = compact8_acceptor-fst.cc
index a21a587..5118933 100644 (file)
@@ -502,7 +502,7 @@ AM_CPPFLAGS = -I$(srcdir)/../../include $(ICU_CPPFLAGS)
 libfst_LTLIBRARIES = compact8_acceptor-fst.la compact8_string-fst.la compact8_unweighted-fst.la compact8_unweighted_acceptor-fst.la compact8_weighted_string-fst.la compact16_acceptor-fst.la compact16_string-fst.la compact16_unweighted-fst.la compact16_unweighted_acceptor-fst.la compact16_weighted_string-fst.la compact64_acceptor-fst.la compact64_string-fst.la compact64_unweighted-fst.la compact64_unweighted_acceptor-fst.la compact64_weighted_string-fst.la
 lib_LTLIBRARIES = libfstcompact.la
 libfstcompact_la_SOURCES = compact8_acceptor-fst.cc compact8_string-fst.cc compact8_unweighted-fst.cc compact8_unweighted_acceptor-fst.cc compact8_weighted_string-fst.cc compact16_acceptor-fst.cc compact16_string-fst.cc compact16_unweighted-fst.cc compact16_unweighted_acceptor-fst.cc compact16_weighted_string-fst.cc compact64_acceptor-fst.cc compact64_string-fst.cc compact64_unweighted-fst.cc compact64_unweighted_acceptor-fst.cc compact64_weighted_string-fst.cc
-libfstcompact_la_LDFLAGS = -version-info 6:0:0
+libfstcompact_la_LDFLAGS = -version-info 7:0:0
 libfstcompact_la_LIBADD = ../../lib/libfst.la -lm $(DL_LIBS)
 compact8_acceptor_fst_la_SOURCES = compact8_acceptor-fst.cc
 compact8_acceptor_fst_la_LDFLAGS = -module
index e39dfb3..f4b4402 100644 (file)
@@ -14,7 +14,7 @@ endif
 
 if HAVE_SCRIPT
 libfstcompressscript_la_SOURCES = compress-script.cc
-libfstcompressscript_la_LDFLAGS = -version-info 6:0:0
+libfstcompressscript_la_LDFLAGS = -version-info 7:0:0
 libfstcompressscript_la_LIBADD = \
         ../../script/libfstscript.la \
         ../../lib/libfst.la -lz -lm $(DL_LIBS)
index 22c6411..badfc84 100644 (file)
@@ -364,7 +364,7 @@ AM_CPPFLAGS = -I$(srcdir)/../../include $(ICU_CPPFLAGS)
 @HAVE_BIN_TRUE@fstcompress_SOURCES = fstcompress.cc
 @HAVE_BIN_TRUE@fstrandmod_SOURCES = fstrandmod.cc
 @HAVE_SCRIPT_TRUE@libfstcompressscript_la_SOURCES = compress-script.cc
-@HAVE_SCRIPT_TRUE@libfstcompressscript_la_LDFLAGS = -version-info 6:0:0
+@HAVE_SCRIPT_TRUE@libfstcompressscript_la_LDFLAGS = -version-info 7:0:0
 @HAVE_SCRIPT_TRUE@libfstcompressscript_la_LIBADD = \
 @HAVE_SCRIPT_TRUE@        ../../script/libfstscript.la \
 @HAVE_SCRIPT_TRUE@        ../../lib/libfst.la -lz -lm $(DL_LIBS)
index c2cac7d..d0767f2 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <fst/extensions/compress/compress-script.h>
 
+#include <fst/log.h>
 #include <fst/util.h>
 #include <fst/script/fst-class.h>
 
index a6b83e9..3c84644 100644 (file)
@@ -10,6 +10,7 @@
 
 #include <fst/extensions/compress/randmod.h>
 
+#include <fst/log.h>
 #include <fst/fstlib.h>
 #include <fst/util.h>
 
index 3ee3628..0280e88 100644 (file)
@@ -6,7 +6,7 @@ libfst_LTLIBRARIES = const8-fst.la const16-fst.la const64-fst.la
 lib_LTLIBRARIES = libfstconst.la
 
 libfstconst_la_SOURCES = const8-fst.cc const16-fst.cc const64-fst.cc
-libfstconst_la_LDFLAGS = -version-info 6:0:0 -lm $(DL_LIBS)
+libfstconst_la_LDFLAGS = -version-info 7:0:0 -lm $(DL_LIBS)
 libfstconst_la_LIBADD = ../../lib/libfst.la -lm $(DL_LIBS)
 
 const8_fst_la_SOURCES = const8-fst.cc
index 24975d9..37d929b 100644 (file)
@@ -359,7 +359,7 @@ AM_CPPFLAGS = -I$(srcdir)/../../include $(ICU_CPPFLAGS)
 libfst_LTLIBRARIES = const8-fst.la const16-fst.la const64-fst.la
 lib_LTLIBRARIES = libfstconst.la
 libfstconst_la_SOURCES = const8-fst.cc const16-fst.cc const64-fst.cc
-libfstconst_la_LDFLAGS = -version-info 6:0:0 -lm $(DL_LIBS)
+libfstconst_la_LDFLAGS = -version-info 7:0:0 -lm $(DL_LIBS)
 libfstconst_la_LIBADD = ../../lib/libfst.la -lm $(DL_LIBS)
 const8_fst_la_SOURCES = const8-fst.cc
 const8_fst_la_LDFLAGS = -module
index 35c4da1..e00d364 100644 (file)
@@ -7,13 +7,13 @@ lib_LTLIBRARIES = libfstfar.la
 endif
 
 libfstfar_la_SOURCES = sttable.cc stlist.cc
-libfstfar_la_LDFLAGS = -version-info 6:0:0
+libfstfar_la_LDFLAGS = -version-info 7:0:0
 libfstfar_la_LIBADD = ../../lib/libfst.la -lm $(DL_LIBS)
 
 if HAVE_SCRIPT
 libfstfarscript_la_SOURCES = far-class.cc farscript.cc getters.cc script-impl.cc \
                              strings.cc
-libfstfarscript_la_LDFLAGS = -version-info 6:0:0
+libfstfarscript_la_LDFLAGS = -version-info 7:0:0
 libfstfarscript_la_LIBADD = \
     libfstfar.la ../../script/libfstscript.la \
         ../../lib/libfst.la -lm $(DL_LIBS)
index d3232a3..428e0c4 100644 (file)
@@ -414,12 +414,12 @@ AM_CPPFLAGS = -I$(srcdir)/../../include $(ICU_CPPFLAGS)
 @HAVE_SCRIPT_FALSE@lib_LTLIBRARIES = libfstfar.la
 @HAVE_SCRIPT_TRUE@lib_LTLIBRARIES = libfstfar.la libfstfarscript.la
 libfstfar_la_SOURCES = sttable.cc stlist.cc
-libfstfar_la_LDFLAGS = -version-info 6:0:0
+libfstfar_la_LDFLAGS = -version-info 7:0:0
 libfstfar_la_LIBADD = ../../lib/libfst.la -lm $(DL_LIBS)
 @HAVE_SCRIPT_TRUE@libfstfarscript_la_SOURCES = far-class.cc farscript.cc getters.cc script-impl.cc \
 @HAVE_SCRIPT_TRUE@                             strings.cc
 
-@HAVE_SCRIPT_TRUE@libfstfarscript_la_LDFLAGS = -version-info 6:0:0
+@HAVE_SCRIPT_TRUE@libfstfarscript_la_LDFLAGS = -version-info 7:0:0
 @HAVE_SCRIPT_TRUE@libfstfarscript_la_LIBADD = \
 @HAVE_SCRIPT_TRUE@    libfstfar.la ../../script/libfstscript.la \
 @HAVE_SCRIPT_TRUE@        ../../lib/libfst.la -lm $(DL_LIBS)
index b20c236..2563d69 100644 (file)
@@ -13,7 +13,7 @@ endif
 
 if HAVE_SCRIPT
 libfstlinearscript_la_SOURCES = linearscript.cc
-libfstlinearscript_la_LDFLAGS = -version-info 6:0:0 -lm $(DL_LIBS)
+libfstlinearscript_la_LDFLAGS = -version-info 7:0:0 -lm $(DL_LIBS)
 libfstlinearscript_la_LIBADD = ../../script/libfstscript.la \
                                                        ../../lib/libfst.la -lm $(DL_LIBS)
 endif
index f5aae0f..8c3c668 100644 (file)
@@ -388,7 +388,7 @@ AM_CPPFLAGS = -I$(srcdir)/../../include $(ICU_CPPFLAGS)
 @HAVE_BIN_TRUE@fstlinear_SOURCES = fstlinear.cc
 @HAVE_BIN_TRUE@fstloglinearapply_SOURCES = fstloglinearapply.cc
 @HAVE_SCRIPT_TRUE@libfstlinearscript_la_SOURCES = linearscript.cc
-@HAVE_SCRIPT_TRUE@libfstlinearscript_la_LDFLAGS = -version-info 6:0:0 -lm $(DL_LIBS)
+@HAVE_SCRIPT_TRUE@libfstlinearscript_la_LDFLAGS = -version-info 7:0:0 -lm $(DL_LIBS)
 @HAVE_SCRIPT_TRUE@libfstlinearscript_la_LIBADD = ../../script/libfstscript.la \
 @HAVE_SCRIPT_TRUE@                                                     ../../lib/libfst.la -lm $(DL_LIBS)
 
index dcf49db..a19efb9 100644 (file)
@@ -6,6 +6,8 @@
 #include <fst/extensions/linear/loglinear-apply.h>
 #include <fst/vector-fst.h>
 
+#include <fst/log.h>
+
 DEFINE_bool(normalize, true, "Normalize to get posterior");
 
 int main(int argc, char **argv) {
index d18891b..3ae65f0 100644 (file)
@@ -8,7 +8,7 @@ lib_LTLIBRARIES = libfstlookahead.la
 
 libfstlookahead_la_SOURCES = arc_lookahead-fst.cc ilabel_lookahead-fst.cc \
                              olabel_lookahead-fst.cc
-libfstlookahead_la_LDFLAGS = -version-info 6:0:0
+libfstlookahead_la_LDFLAGS = -version-info 7:0:0
 libfstlookahead_la_LIBADD = ../../lib/libfst.la -lm $(DL_LIBS)
 
 arc_lookahead_fst_la_SOURCES = arc_lookahead-fst.cc
index ef31754..afcf381 100644 (file)
@@ -369,7 +369,7 @@ lib_LTLIBRARIES = libfstlookahead.la
 libfstlookahead_la_SOURCES = arc_lookahead-fst.cc ilabel_lookahead-fst.cc \
                              olabel_lookahead-fst.cc
 
-libfstlookahead_la_LDFLAGS = -version-info 6:0:0
+libfstlookahead_la_LDFLAGS = -version-info 7:0:0
 libfstlookahead_la_LIBADD = ../../lib/libfst.la -lm $(DL_LIBS)
 arc_lookahead_fst_la_SOURCES = arc_lookahead-fst.cc
 arc_lookahead_fst_la_LDFLAGS = -module
index 7b3c760..c1c022f 100644 (file)
@@ -20,7 +20,7 @@ endif
 if HAVE_SCRIPT
 lib_LTLIBRARIES = libfstmpdtscript.la
 libfstmpdtscript_la_SOURCES = mpdtscript.cc
-libfstmpdtscript_la_LDFLAGS = -version-info 6:0:0
+libfstmpdtscript_la_LDFLAGS = -version-info 7:0:0
 libfstmpdtscript_la_LIBADD = ../../script/libfstscript.la \
                              ../../lib/libfst.la -lm $(DL_LIBS)
 endif
index 2b672e7..8c47d29 100644 (file)
@@ -386,7 +386,7 @@ AM_CPPFLAGS = -I$(srcdir)/../../include $(ICU_CPPFLAGS)
 @HAVE_BIN_TRUE@mpdtreverse_SOURCES = mpdtreverse.cc
 @HAVE_SCRIPT_TRUE@lib_LTLIBRARIES = libfstmpdtscript.la
 @HAVE_SCRIPT_TRUE@libfstmpdtscript_la_SOURCES = mpdtscript.cc
-@HAVE_SCRIPT_TRUE@libfstmpdtscript_la_LDFLAGS = -version-info 6:0:0
+@HAVE_SCRIPT_TRUE@libfstmpdtscript_la_LDFLAGS = -version-info 7:0:0
 @HAVE_SCRIPT_TRUE@libfstmpdtscript_la_LIBADD = ../../script/libfstscript.la \
 @HAVE_SCRIPT_TRUE@                             ../../lib/libfst.la -lm $(DL_LIBS)
 
index 8f2267f..895650d 100644 (file)
@@ -9,6 +9,8 @@
 #include <string>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/extensions/mpdt/mpdtscript.h>
 #include <fst/extensions/mpdt/read_write_utils.h>
 #include <fst/extensions/pdt/getters.h>
index 6cf8554..54b4db6 100644 (file)
@@ -9,6 +9,8 @@
 #include <string>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/extensions/mpdt/mpdtscript.h>
 #include <fst/extensions/mpdt/read_write_utils.h>
 #include <fst/util.h>
index 2f7d9e6..2d8b96e 100644 (file)
@@ -10,6 +10,8 @@
 #include <string>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/extensions/mpdt/mpdtscript.h>
 #include <fst/extensions/mpdt/read_write_utils.h>
 #include <fst/util.h>
index 254c550..02750b1 100644 (file)
@@ -9,6 +9,8 @@
 #include <string>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/extensions/mpdt/mpdtscript.h>
 #include <fst/extensions/mpdt/read_write_utils.h>
 #include <fst/util.h>
index 307596f..fec803b 100644 (file)
@@ -9,5 +9,5 @@ ngram_fst_la_SOURCES = bitmap-index.cc ngram-fst.cc nthbit.cc
 ngram_fst_la_LDFLAGS = -module
 
 libfstngram_la_SOURCES = bitmap-index.cc ngram-fst.cc nthbit.cc
-libfstngram_la_LDFLAGS = -version-info 6:0:0
+libfstngram_la_LDFLAGS = -version-info 7:0:0
 libfstngram_la_LIBADD = ../../lib/libfst.la -lm $(DL_LIBS)
index 72981cf..e6cf794 100644 (file)
@@ -343,7 +343,7 @@ lib_LTLIBRARIES = libfstngram.la
 ngram_fst_la_SOURCES = bitmap-index.cc ngram-fst.cc nthbit.cc
 ngram_fst_la_LDFLAGS = -module
 libfstngram_la_SOURCES = bitmap-index.cc ngram-fst.cc nthbit.cc
-libfstngram_la_LDFLAGS = -version-info 6:0:0
+libfstngram_la_LDFLAGS = -version-info 7:0:0
 libfstngram_la_LIBADD = ../../lib/libfst.la -lm $(DL_LIBS)
 all: all-am
 
index 274fbcb..40573af 100644 (file)
@@ -6,6 +6,7 @@
 #include <algorithm>
 #include <iterator>
 
+#include <fst/log.h>
 #include <fst/extensions/ngram/nthbit.h>
 
 namespace fst {
index bd9138a..204ae61 100644 (file)
@@ -24,7 +24,7 @@ endif
 if HAVE_SCRIPT
 lib_LTLIBRARIES = libfstpdtscript.la
 libfstpdtscript_la_SOURCES = getters.cc pdtscript.cc
-libfstpdtscript_la_LDFLAGS = -version-info 6:0:0
+libfstpdtscript_la_LDFLAGS = -version-info 7:0:0
 libfstpdtscript_la_LIBADD = ../../script/libfstscript.la \
                             ../../lib/libfst.la -lm $(DL_LIBS)
 endif
index 053aa6f..6b9234d 100644 (file)
@@ -401,7 +401,7 @@ AM_CPPFLAGS = -I$(srcdir)/../../include $(ICU_CPPFLAGS)
 @HAVE_BIN_TRUE@pdtshortestpath_SOURCES = pdtshortestpath.cc
 @HAVE_SCRIPT_TRUE@lib_LTLIBRARIES = libfstpdtscript.la
 @HAVE_SCRIPT_TRUE@libfstpdtscript_la_SOURCES = getters.cc pdtscript.cc
-@HAVE_SCRIPT_TRUE@libfstpdtscript_la_LDFLAGS = -version-info 6:0:0
+@HAVE_SCRIPT_TRUE@libfstpdtscript_la_LDFLAGS = -version-info 7:0:0
 @HAVE_SCRIPT_TRUE@libfstpdtscript_la_LIBADD = ../../script/libfstscript.la \
 @HAVE_SCRIPT_TRUE@                            ../../lib/libfst.la -lm $(DL_LIBS)
 
index 66b9d71..a48b0e3 100644 (file)
@@ -9,6 +9,8 @@
 #include <string>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/extensions/pdt/getters.h>
 #include <fst/extensions/pdt/pdtscript.h>
 #include <fst/util.h>
index 3f59463..a3b714c 100644 (file)
@@ -9,6 +9,8 @@
 #include <string>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/extensions/pdt/pdtscript.h>
 #include <fst/util.h>
 
index d17b943..fd1426f 100644 (file)
@@ -10,6 +10,8 @@
 #include <string>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/extensions/pdt/pdtscript.h>
 #include <fst/util.h>
 
index 19ff811..4fd4384 100644 (file)
@@ -9,6 +9,8 @@
 #include <string>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/extensions/pdt/pdtscript.h>
 #include <fst/util.h>
 
index bcebec4..4c25430 100644 (file)
@@ -9,6 +9,8 @@
 #include <string>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/extensions/pdt/pdtscript.h>
 #include <fst/util.h>
 
index f68ca14..711cf78 100644 (file)
@@ -527,7 +527,7 @@ cdef extern from "<fst/script/fstscript.h>" namespace "fst::script" nogil:
   cdef void DrawFst(const FstClass &fst, const SymbolTable *,
                     const SymbolTable *, const SymbolTable *, bool,
                     const string &, float, float, bool, bool, float, float, int,
-                    int, bool, ostream *, const string &)
+                    int, const string &, bool, ostream *, const string &)
 
   cdef void Encode(MutableFstClass *, EncodeMapperClass *)
 
@@ -596,14 +596,12 @@ cdef extern from "<fst/script/fstscript.h>" namespace "fst::script" nogil:
                     const RandGenOptions[RandArcSelection] &)
 
   cdef void Relabel(MutableFstClass *,
-      const SymbolTable *, const SymbolTable *, bool,
-      const SymbolTable *, const SymbolTable *, bool)
+      const SymbolTable *, const SymbolTable *, const string &, bool,
+      const SymbolTable *, const SymbolTable *, const string &, bool)
 
   cdef void Relabel(MutableFstClass *, const vector[LabelPair] &,
                     const vector[LabelPair] &)
 
-  cdef void Relabel(MutableFstClass *, const SymbolTable *, const SymbolTable *)
-
   cdef cppclass ReplaceOptions:
 
      ReplaceOptions(int64, ReplaceLabelType, ReplaceLabelType, int64)
index 657d319..6d73fd4 100644 (file)
@@ -909,10 +909,11 @@ struct __pyx_opt_args_9pywrapfst_4_Fst_draw {
   double nodesep;
   __pyx_t_10basictypes_int32 fontsize;
   __pyx_t_10basictypes_int32 precision;
+  PyObject *float_format;
   bool show_weight_one;
 };
 
-/* "pywrapfst.pxd":254
+/* "pywrapfst.pxd":255
  *   cpdef StateIterator states(self)
  * 
  *   cpdef string text(self, _SymbolTable isymbols=?, _SymbolTable osymbols=?,             # <<<<<<<<<<<<<<
@@ -929,7 +930,7 @@ struct __pyx_opt_args_9pywrapfst_4_Fst_text {
   PyObject *missing_sym;
 };
 
-/* "pywrapfst.pxd":277
+/* "pywrapfst.pxd":278
  *   cpdef int64 add_state(self) except *
  * 
  *   cdef void _arcsort(self, st=?) except *             # <<<<<<<<<<<<<<
@@ -941,7 +942,7 @@ struct __pyx_opt_args_9pywrapfst_11_MutableFst__arcsort {
   PyObject *st;
 };
 
-/* "pywrapfst.pxd":279
+/* "pywrapfst.pxd":280
  *   cdef void _arcsort(self, st=?) except *
  * 
  *   cdef void _closure(self, bool closure_plus=?) except *             # <<<<<<<<<<<<<<
@@ -953,7 +954,7 @@ struct __pyx_opt_args_9pywrapfst_11_MutableFst__closure {
   bool closure_plus;
 };
 
-/* "pywrapfst.pxd":287
+/* "pywrapfst.pxd":288
  *   cdef void _decode(self, EncodeMapper) except *
  * 
  *   cdef void _delete_arcs(self, int64 state, size_t n=?) except *             # <<<<<<<<<<<<<<
@@ -965,7 +966,7 @@ struct __pyx_opt_args_9pywrapfst_11_MutableFst__delete_arcs {
   size_t n;
 };
 
-/* "pywrapfst.pxd":289
+/* "pywrapfst.pxd":290
  *   cdef void _delete_arcs(self, int64 state, size_t n=?) except *
  * 
  *   cdef void _delete_states(self, states=?) except *             # <<<<<<<<<<<<<<
@@ -977,7 +978,7 @@ struct __pyx_opt_args_9pywrapfst_11_MutableFst__delete_states {
   PyObject *states;
 };
 
-/* "pywrapfst.pxd":295
+/* "pywrapfst.pxd":296
  *   cdef void _invert(self) except *
  * 
  *   cdef void _minimize(self, float delta=?, bool allow_nondet=?) except *             # <<<<<<<<<<<<<<
@@ -990,7 +991,7 @@ struct __pyx_opt_args_9pywrapfst_11_MutableFst__minimize {
   bool allow_nondet;
 };
 
-/* "pywrapfst.pxd":301
+/* "pywrapfst.pxd":302
  *   cpdef int64 num_states(self)
  * 
  *   cdef void _project(self, bool project_output=?) except *             # <<<<<<<<<<<<<<
@@ -1002,7 +1003,7 @@ struct __pyx_opt_args_9pywrapfst_11_MutableFst__project {
   bool project_output;
 };
 
-/* "pywrapfst.pxd":303
+/* "pywrapfst.pxd":304
  *   cdef void _project(self, bool project_output=?) except *
  * 
  *   cdef void _prune(self, float delta=?, int64 nstate=?, weight=?) except *             # <<<<<<<<<<<<<<
@@ -1016,7 +1017,7 @@ struct __pyx_opt_args_9pywrapfst_11_MutableFst__prune {
   PyObject *weight;
 };
 
-/* "pywrapfst.pxd":305
+/* "pywrapfst.pxd":306
  *   cdef void _prune(self, float delta=?, int64 nstate=?, weight=?) except *
  * 
  *   cdef void _push(self, float delta=?, bool remove_total_weight=?,             # <<<<<<<<<<<<<<
@@ -1030,7 +1031,7 @@ struct __pyx_opt_args_9pywrapfst_11_MutableFst__push {
   bool to_final;
 };
 
-/* "pywrapfst.pxd":308
+/* "pywrapfst.pxd":309
  *                   bool to_final=?) except *
  * 
  *   cdef void _relabel_pairs(self, ipairs=?, opairs=?) except *             # <<<<<<<<<<<<<<
@@ -1043,24 +1044,26 @@ struct __pyx_opt_args_9pywrapfst_11_MutableFst__relabel_pairs {
   PyObject *opairs;
 };
 
-/* "pywrapfst.pxd":310
+/* "pywrapfst.pxd":311
  *   cdef void _relabel_pairs(self, ipairs=?, opairs=?) except *
  * 
  *   cdef void _relabel_tables(self, _SymbolTable old_isymbols=?,             # <<<<<<<<<<<<<<
- *       _SymbolTable new_isymbols=?, bool attach_new_isymbols=?,
- *       _SymbolTable old_osymbols=?, _SymbolTable new_osymbols=?,
+ *       _SymbolTable new_isymbols=?, unknown_isymbol=?,
+ *       bool attach_new_isymbols=?,
  */
 struct __pyx_opt_args_9pywrapfst_11_MutableFst__relabel_tables {
   int __pyx_n;
   struct __pyx_obj_9pywrapfst__SymbolTable *old_isymbols;
   struct __pyx_obj_9pywrapfst__SymbolTable *new_isymbols;
+  PyObject *unknown_isymbol;
   bool attach_new_isymbols;
   struct __pyx_obj_9pywrapfst__SymbolTable *old_osymbols;
   struct __pyx_obj_9pywrapfst__SymbolTable *new_osymbols;
+  PyObject *unknown_osymbol;
   bool attach_new_osymbols;
 };
 
-/* "pywrapfst.pxd":319
+/* "pywrapfst.pxd":321
  *   cdef void _reserve_states(self, int64 n) except *
  * 
  *   cdef void _reweight(self, potentials, bool to_final=?) except *             # <<<<<<<<<<<<<<
@@ -1072,7 +1075,7 @@ struct __pyx_opt_args_9pywrapfst_11_MutableFst__reweight {
   bool to_final;
 };
 
-/* "pywrapfst.pxd":321
+/* "pywrapfst.pxd":323
  *   cdef void _reweight(self, potentials, bool to_final=?) except *
  * 
  *   cdef void _rmepsilon(self, bool connect=?, float delta=?, int64 nstate=?,             # <<<<<<<<<<<<<<
@@ -1087,7 +1090,7 @@ struct __pyx_opt_args_9pywrapfst_11_MutableFst__rmepsilon {
   PyObject *weight;
 };
 
-/* "pywrapfst.pxd":324
+/* "pywrapfst.pxd":326
  *                        weight=?) except *
  * 
  *   cdef void _set_final(self, int64 state, weight=?) except *             # <<<<<<<<<<<<<<
@@ -1099,7 +1102,7 @@ struct __pyx_opt_args_9pywrapfst_11_MutableFst__set_final {
   PyObject *weight;
 };
 
-/* "pywrapfst.pxd":348
+/* "pywrapfst.pxd":350
  * cdef _Fst _init_XFst(FstClass_ptr tfst)
  * 
  * cdef _MutableFst _create_Fst(arc_type=?)             # <<<<<<<<<<<<<<
@@ -1111,7 +1114,7 @@ struct __pyx_opt_args_9pywrapfst__create_Fst {
   PyObject *arc_type;
 };
 
-/* "pywrapfst.pxd":350
+/* "pywrapfst.pxd":352
  * cdef _MutableFst _create_Fst(arc_type=?)
  * 
  * cdef _Fst _read_Fst(filename, fst_type=?)             # <<<<<<<<<<<<<<
@@ -1123,7 +1126,7 @@ struct __pyx_opt_args_9pywrapfst__read_Fst {
   PyObject *fst_type;
 };
 
-/* "pywrapfst.pxd":352
+/* "pywrapfst.pxd":354
  * cdef _Fst _read_Fst(filename, fst_type=?)
  * 
  * cdef _Fst _deserialize_Fst(fst_string, fst_type=?)             # <<<<<<<<<<<<<<
@@ -1135,7 +1138,7 @@ struct __pyx_opt_args_9pywrapfst__deserialize_Fst {
   PyObject *fst_type;
 };
 
-/* "pywrapfst.pxd":431
+/* "pywrapfst.pxd":433
  * 
  * 
  * cdef _Fst _map(_Fst ifst, float delta=?, mt=?, weight=?)             # <<<<<<<<<<<<<<
@@ -1149,7 +1152,7 @@ struct __pyx_opt_args_9pywrapfst__map {
   PyObject *weight;
 };
 
-/* "pywrapfst.pxd":433
+/* "pywrapfst.pxd":435
  * cdef _Fst _map(_Fst ifst, float delta=?, mt=?, weight=?)
  * 
  * cpdef _Fst arcmap(_Fst ifst, float delta=?, mt=?, weight=?)             # <<<<<<<<<<<<<<
@@ -1163,7 +1166,7 @@ struct __pyx_opt_args_9pywrapfst_arcmap {
   PyObject *weight;
 };
 
-/* "pywrapfst.pxd":435
+/* "pywrapfst.pxd":437
  * cpdef _Fst arcmap(_Fst ifst, float delta=?, mt=?, weight=?)
  * 
  * cpdef _MutableFst compose(_Fst ifst1, _Fst ifst2, cf=?, bool connect=?)             # <<<<<<<<<<<<<<
@@ -1176,7 +1179,7 @@ struct __pyx_opt_args_9pywrapfst_compose {
   bool connect;
 };
 
-/* "pywrapfst.pxd":437
+/* "pywrapfst.pxd":439
  * cpdef _MutableFst compose(_Fst ifst1, _Fst ifst2, cf=?, bool connect=?)
  * 
  * cpdef _Fst convert(_Fst ifst, fst_type=?)             # <<<<<<<<<<<<<<
@@ -1188,7 +1191,7 @@ struct __pyx_opt_args_9pywrapfst_convert {
   PyObject *fst_type;
 };
 
-/* "pywrapfst.pxd":439
+/* "pywrapfst.pxd":441
  * cpdef _Fst convert(_Fst ifst, fst_type=?)
  * 
  * cpdef _MutableFst determinize(_Fst ifst, float delta=?, dt=?,             # <<<<<<<<<<<<<<
@@ -1205,7 +1208,7 @@ struct __pyx_opt_args_9pywrapfst_determinize {
   bool increment_subsequential_label;
 };
 
-/* "pywrapfst.pxd":443
+/* "pywrapfst.pxd":445
  *     weight=?, bool increment_subsequential_label=?)
  * 
  * cpdef _MutableFst difference(_Fst ifst1, _Fst ifst2, cf=?, bool connect=?)             # <<<<<<<<<<<<<<
@@ -1218,7 +1221,7 @@ struct __pyx_opt_args_9pywrapfst_difference {
   bool connect;
 };
 
-/* "pywrapfst.pxd":445
+/* "pywrapfst.pxd":447
  * cpdef _MutableFst difference(_Fst ifst1, _Fst ifst2, cf=?, bool connect=?)
  * 
  * cpdef _MutableFst disambiguate(_Fst ifst, float delta=?, int64 nstate=?,             # <<<<<<<<<<<<<<
@@ -1233,7 +1236,7 @@ struct __pyx_opt_args_9pywrapfst_disambiguate {
   PyObject *weight;
 };
 
-/* "pywrapfst.pxd":448
+/* "pywrapfst.pxd":450
  *                             int64 subsequential_label=?, weight=?)
  * 
  * cpdef _MutableFst epsnormalize(_Fst ifst, bool eps_norm_output=?)             # <<<<<<<<<<<<<<
@@ -1245,7 +1248,7 @@ struct __pyx_opt_args_9pywrapfst_epsnormalize {
   bool eps_norm_output;
 };
 
-/* "pywrapfst.pxd":450
+/* "pywrapfst.pxd":452
  * cpdef _MutableFst epsnormalize(_Fst ifst, bool eps_norm_output=?)
  * 
  * cpdef bool equal(_Fst ifst1, _Fst ifst2, float delta=?)             # <<<<<<<<<<<<<<
@@ -1257,7 +1260,7 @@ struct __pyx_opt_args_9pywrapfst_equal {
   float delta;
 };
 
-/* "pywrapfst.pxd":452
+/* "pywrapfst.pxd":454
  * cpdef bool equal(_Fst ifst1, _Fst ifst2, float delta=?)
  * 
  * cpdef bool equivalent(_Fst ifst1, _Fst ifst2, float delta=?) except *             # <<<<<<<<<<<<<<
@@ -1269,7 +1272,7 @@ struct __pyx_opt_args_9pywrapfst_equivalent {
   float delta;
 };
 
-/* "pywrapfst.pxd":454
+/* "pywrapfst.pxd":456
  * cpdef bool equivalent(_Fst ifst1, _Fst ifst2, float delta=?) except *
  * 
  * cpdef _MutableFst intersect(_Fst ifst1, _Fst ifst2, cf=?, bool connect=?)             # <<<<<<<<<<<<<<
@@ -1282,7 +1285,7 @@ struct __pyx_opt_args_9pywrapfst_intersect {
   bool connect;
 };
 
-/* "pywrapfst.pxd":456
+/* "pywrapfst.pxd":458
  * cpdef _MutableFst intersect(_Fst ifst1, _Fst ifst2, cf=?, bool connect=?)
  * 
  * cpdef bool isomorphic(_Fst ifst1, _Fst ifst2, float delta=?)             # <<<<<<<<<<<<<<
@@ -1294,7 +1297,7 @@ struct __pyx_opt_args_9pywrapfst_isomorphic {
   float delta;
 };
 
-/* "pywrapfst.pxd":458
+/* "pywrapfst.pxd":460
  * cpdef bool isomorphic(_Fst ifst1, _Fst ifst2, float delta=?)
  * 
  * cpdef _MutableFst prune(_Fst ifst, float delta=?, int64 nstate=?,             # <<<<<<<<<<<<<<
@@ -1308,7 +1311,7 @@ struct __pyx_opt_args_9pywrapfst_prune {
   PyObject *weight;
 };
 
-/* "pywrapfst.pxd":461
+/* "pywrapfst.pxd":463
  *                         weight=?)
  * 
  * cpdef _MutableFst push(_Fst ifst, float delta=?, bool push_weights=?,             # <<<<<<<<<<<<<<
@@ -1325,7 +1328,7 @@ struct __pyx_opt_args_9pywrapfst_push {
   bool to_final;
 };
 
-/* "pywrapfst.pxd":465
+/* "pywrapfst.pxd":467
  *                        bool remove_total_weight=?, bool to_final=?)
  * 
  * cpdef bool randequivalent(_Fst ifst1, _Fst ifst2, int32 npath=?,             # <<<<<<<<<<<<<<
@@ -1341,7 +1344,7 @@ struct __pyx_opt_args_9pywrapfst_randequivalent {
   __pyx_t_10basictypes_int32 max_length;
 };
 
-/* "pywrapfst.pxd":469
+/* "pywrapfst.pxd":471
  *                           int32 max_length=?) except *
  * 
  * cpdef _MutableFst randgen(_Fst ifst, int32 npath=?, time_t seed=?,             # <<<<<<<<<<<<<<
@@ -1358,7 +1361,7 @@ struct __pyx_opt_args_9pywrapfst_randgen {
   bool weighted;
 };
 
-/* "pywrapfst.pxd":476
+/* "pywrapfst.pxd":478
  *     bool epsilon_on_replace) except *
  * 
  * cpdef _MutableFst replace(pairs, call_arc_labeling=?,             # <<<<<<<<<<<<<<
@@ -1373,7 +1376,7 @@ struct __pyx_opt_args_9pywrapfst_replace {
   __pyx_t_10basictypes_int64 return_label;
 };
 
-/* "pywrapfst.pxd":480
+/* "pywrapfst.pxd":482
  *                           int64 return_label=?)
  * 
  * cpdef _MutableFst reverse(_Fst ifst, bool require_superinitial=?)             # <<<<<<<<<<<<<<
@@ -1385,7 +1388,7 @@ struct __pyx_opt_args_9pywrapfst_reverse {
   bool require_superinitial;
 };
 
-/* "pywrapfst.pxd":482
+/* "pywrapfst.pxd":484
  * cpdef _MutableFst reverse(_Fst ifst, bool require_superinitial=?)
  * 
  * cpdef _MutableFst rmepsilon(_Fst ifst, bool connect=?, float delta=?,             # <<<<<<<<<<<<<<
@@ -1402,7 +1405,7 @@ struct __pyx_opt_args_9pywrapfst_rmepsilon {
   PyObject *weight;
 };
 
-/* "pywrapfst.pxd":486
+/* "pywrapfst.pxd":488
  *                             weight=?)
  * 
  * cdef vector[fst.WeightClass] *_shortestdistance(_Fst ifst, float delta=?,             # <<<<<<<<<<<<<<
@@ -1417,7 +1420,7 @@ struct __pyx_opt_args_9pywrapfst__shortestdistance {
   bool reverse;
 };
 
-/* "pywrapfst.pxd":490
+/* "pywrapfst.pxd":492
  *                                                 bool reverse=?) except *
  * 
  * cpdef _MutableFst shortestpath(_Fst ifst, float delta=?, int32 nshortest=?,             # <<<<<<<<<<<<<<
@@ -1569,7 +1572,7 @@ struct __pyx_obj_9pywrapfst__Fst {
 };
 
 
-/* "pywrapfst.pxd":267
+/* "pywrapfst.pxd":268
  * 
  * 
  * cdef class _MutableFst(_Fst):             # <<<<<<<<<<<<<<
@@ -1582,7 +1585,7 @@ struct __pyx_obj_9pywrapfst__MutableFst {
 };
 
 
-/* "pywrapfst.pxd":358
+/* "pywrapfst.pxd":360
  * 
  * 
  * cdef class Arc(object):             # <<<<<<<<<<<<<<
@@ -1596,7 +1599,7 @@ struct __pyx_obj_9pywrapfst_Arc {
 };
 
 
-/* "pywrapfst.pxd":368
+/* "pywrapfst.pxd":370
  * 
  * 
  * cdef class ArcIterator(object):             # <<<<<<<<<<<<<<
@@ -1611,7 +1614,7 @@ struct __pyx_obj_9pywrapfst_ArcIterator {
 };
 
 
-/* "pywrapfst.pxd":390
+/* "pywrapfst.pxd":392
  * 
  * 
  * cdef class MutableArcIterator(object):             # <<<<<<<<<<<<<<
@@ -1626,7 +1629,7 @@ struct __pyx_obj_9pywrapfst_MutableArcIterator {
 };
 
 
-/* "pywrapfst.pxd":414
+/* "pywrapfst.pxd":416
  * 
  * 
  * cdef class StateIterator(object):             # <<<<<<<<<<<<<<
@@ -1641,7 +1644,7 @@ struct __pyx_obj_9pywrapfst_StateIterator {
 };
 
 
-/* "pywrapfst.pxd":502
+/* "pywrapfst.pxd":504
  * 
  * 
  * cdef class Compiler(object):             # <<<<<<<<<<<<<<
@@ -1665,7 +1668,7 @@ struct __pyx_obj_9pywrapfst_Compiler {
 };
 
 
-/* "pywrapfst.pxd":523
+/* "pywrapfst.pxd":525
  * # FarReader.
  * 
  * cdef class FarReader(object):             # <<<<<<<<<<<<<<
@@ -1679,7 +1682,7 @@ struct __pyx_obj_9pywrapfst_FarReader {
 };
 
 
-/* "pywrapfst.pxd":548
+/* "pywrapfst.pxd":550
  * # FarWriter.
  * 
  * cdef class FarWriter(object):             # <<<<<<<<<<<<<<
@@ -1878,7 +1881,7 @@ struct __pyx_vtabstruct_9pywrapfst__Fst {
 static struct __pyx_vtabstruct_9pywrapfst__Fst *__pyx_vtabptr_9pywrapfst__Fst;
 
 
-/* "pywrapfst.pyx":1711
+/* "pywrapfst.pyx":1714
  * 
  * 
  * cdef class _MutableFst(_Fst):             # <<<<<<<<<<<<<<
@@ -1923,7 +1926,7 @@ struct __pyx_vtabstruct_9pywrapfst__MutableFst {
 static struct __pyx_vtabstruct_9pywrapfst__MutableFst *__pyx_vtabptr_9pywrapfst__MutableFst;
 
 
-/* "pywrapfst.pyx":2779
+/* "pywrapfst.pyx":2795
  * 
  * 
  * cdef class Arc(object):             # <<<<<<<<<<<<<<
@@ -1937,7 +1940,7 @@ struct __pyx_vtabstruct_9pywrapfst_Arc {
 static struct __pyx_vtabstruct_9pywrapfst_Arc *__pyx_vtabptr_9pywrapfst_Arc;
 
 
-/* "pywrapfst.pyx":2847
+/* "pywrapfst.pyx":2863
  * 
  * 
  * cdef class ArcIterator(object):             # <<<<<<<<<<<<<<
@@ -1958,7 +1961,7 @@ struct __pyx_vtabstruct_9pywrapfst_ArcIterator {
 static struct __pyx_vtabstruct_9pywrapfst_ArcIterator *__pyx_vtabptr_9pywrapfst_ArcIterator;
 
 
-/* "pywrapfst.pyx":2984
+/* "pywrapfst.pyx":3000
  * 
  * 
  * cdef class MutableArcIterator(object):             # <<<<<<<<<<<<<<
@@ -1980,7 +1983,7 @@ struct __pyx_vtabstruct_9pywrapfst_MutableArcIterator {
 static struct __pyx_vtabstruct_9pywrapfst_MutableArcIterator *__pyx_vtabptr_9pywrapfst_MutableArcIterator;
 
 
-/* "pywrapfst.pyx":3136
+/* "pywrapfst.pyx":3152
  * 
  * 
  * cdef class StateIterator(object):             # <<<<<<<<<<<<<<
@@ -1997,7 +2000,7 @@ struct __pyx_vtabstruct_9pywrapfst_StateIterator {
 static struct __pyx_vtabstruct_9pywrapfst_StateIterator *__pyx_vtabptr_9pywrapfst_StateIterator;
 
 
-/* "pywrapfst.pyx":4083
+/* "pywrapfst.pyx":4099
  * 
  * 
  * cdef class Compiler(object):             # <<<<<<<<<<<<<<
@@ -2012,7 +2015,7 @@ struct __pyx_vtabstruct_9pywrapfst_Compiler {
 static struct __pyx_vtabstruct_9pywrapfst_Compiler *__pyx_vtabptr_9pywrapfst_Compiler;
 
 
-/* "pywrapfst.pyx":4209
+/* "pywrapfst.pyx":4225
  * 
  * 
  * cdef class FarReader(object):             # <<<<<<<<<<<<<<
@@ -2034,7 +2037,7 @@ struct __pyx_vtabstruct_9pywrapfst_FarReader {
 static struct __pyx_vtabstruct_9pywrapfst_FarReader *__pyx_vtabptr_9pywrapfst_FarReader;
 
 
-/* "pywrapfst.pyx":4383
+/* "pywrapfst.pyx":4399
  * 
  * 
  * cdef class FarWriter(object):             # <<<<<<<<<<<<<<
@@ -2766,6 +2769,7 @@ static PyObject *__pyx_builtin_NotImplementedError;
 static PyObject *__pyx_builtin_KeyError;
 static PyObject *__pyx_builtin_StopIteration;
 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_cf[] = "cf";
@@ -2966,6 +2970,7 @@ static const char __pyx_k_NOT_ACCEPTOR[] = "NOT_ACCEPTOR";
 static const char __pyx_k_RuntimeError[] = "RuntimeError";
 static const char __pyx_k_allow_nondet[] = "allow_nondet";
 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_new_isymbols[] = "new_isymbols";
 static const char __pyx_k_new_osymbols[] = "new_osymbols";
@@ -3005,6 +3010,8 @@ static const char __pyx_k_O_DETERMINISTIC[] = "O_DETERMINISTIC";
 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_show_weight_one[] = "show_weight_one";
+static const char __pyx_k_unknown_isymbol[] = "unknown_isymbol";
+static const char __pyx_k_unknown_osymbol[] = "unknown_osymbol";
 static const char __pyx_k_Cannot_construct[] = "Cannot construct {}";
 static const char __pyx_k_Key_out_of_order[] = "Key out of order";
 static const char __pyx_k_NOT_COACCESSIBLE[] = "NOT_COACCESSIBLE";
@@ -3085,9 +3092,9 @@ static const char __pyx_k_No_new_SymbolTables_specified[] = "No new SymbolTables
 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_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_EncodeMapper_SymbolTable[] = "<const EncodeMapper SymbolTable {!r} at 0x{:x}>";
-static const char __pyx_k_incompatible_or_invalid_weight[] = "incompatible or invalid weight";
 static const char __pyx_k_Fst_arc_type_standard_Construct[] = "\n   Fst(arc_type=\"standard\")\n\n   Constructs an empty FST.\n\n   Args:\n     arc_type: A string indicating the arc type.\n\n   Raises:\n     FstError: Unknown arc type.\n\n   Raises:\n     FstOpError: operation failed.\n   ";
 static const char __pyx_k_const_Fst_SymbolTable_r_at_0x_x[] = "<const Fst SymbolTable {!r} at 0x{:x}>";
 static const char __pyx_k_usr_local_google_home_kbg_scrat[] = "/usr/local/google/home/kbg/scratch/pynini/src/pywrapfst.pyx";
@@ -3154,6 +3161,7 @@ static PyObject *__pyx_n_s_I_EPSILONS;
 static PyObject *__pyx_n_s_I_LABEL_INVARIANT_PROPERTIES;
 static PyObject *__pyx_n_s_I_LABEL_SORTED;
 static PyObject *__pyx_kp_s_Incompatible_or_invalid_arc_type;
+static PyObject *__pyx_kp_s_Incompatible_or_invalid_weight;
 static PyObject *__pyx_kp_s_Incompatible_or_invalid_weight_t;
 static PyObject *__pyx_n_s_IndexError;
 static PyObject *__pyx_kp_s_Invalid_operator_r;
@@ -3274,12 +3282,14 @@ static PyObject *__pyx_n_s_filename;
 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_fst_error_fatal_old;
 static PyObject *__pyx_n_s_fst_string;
 static PyObject *__pyx_n_s_fst_type;
 static PyObject *__pyx_n_b_functional;
+static PyObject *__pyx_n_b_g;
 static PyObject *__pyx_n_s_get_fst;
 static PyObject *__pyx_n_s_get_key;
 static PyObject *__pyx_n_s_get_nth_key;
@@ -3292,7 +3302,6 @@ static PyObject *__pyx_n_s_ifst2;
 static PyObject *__pyx_n_b_ilabel;
 static PyObject *__pyx_n_s_ilabel;
 static PyObject *__pyx_n_s_import;
-static PyObject *__pyx_kp_s_incompatible_or_invalid_weight;
 static PyObject *__pyx_n_s_increment_subsequential_label;
 static PyObject *__pyx_n_b_input;
 static PyObject *__pyx_n_s_input_symbols;
@@ -3414,6 +3423,8 @@ static PyObject *__pyx_n_b_tropical;
 static PyObject *__pyx_n_s_type;
 static PyObject *__pyx_n_b_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_b_unspecified;
 static PyObject *__pyx_kp_s_usr_local_google_home_kbg_scrat;
 static PyObject *__pyx_n_s_utf8;
@@ -3498,7 +3509,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_6__str__(struct __pyx_obj_9pywrapfst_
 static PyObject *__pyx_pf_9pywrapfst_4_Fst_8arc_type(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self); /* proto */
 static PyObject *__pyx_pf_9pywrapfst_4_Fst_10arcs(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state); /* proto */
 static PyObject *__pyx_pf_9pywrapfst_4_Fst_12copy(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_4_Fst_14draw(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, PyObject *__pyx_v_filename, 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, __pyx_t_10basictypes_int32 __pyx_v_fontsize, __pyx_t_10basictypes_int32 __pyx_v_precision, bool __pyx_v_show_weight_one); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_4_Fst_14draw(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, PyObject *__pyx_v_filename, 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, __pyx_t_10basictypes_int32 __pyx_v_fontsize, __pyx_t_10basictypes_int32 __pyx_v_precision, PyObject *__pyx_v_float_format, bool __pyx_v_show_weight_one); /* proto */
 static PyObject *__pyx_pf_9pywrapfst_4_Fst_16final(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state); /* proto */
 static PyObject *__pyx_pf_9pywrapfst_4_Fst_18fst_type(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self); /* proto */
 static PyObject *__pyx_pf_9pywrapfst_4_Fst_20input_symbols(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self); /* proto */
@@ -3534,7 +3545,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_32project(struct __pyx_obj_9p
 static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_34prune(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, float __pyx_v_delta, __pyx_t_10basictypes_int64 __pyx_v_nstate, PyObject *__pyx_v_weight); /* proto */
 static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_36push(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, float __pyx_v_delta, bool __pyx_v_remove_total_weight, bool __pyx_v_to_final); /* proto */
 static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_38relabel_pairs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_ipairs, PyObject *__pyx_v_opairs); /* proto */
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_40relabel_tables(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_isymbols, bool __pyx_v_attach_new_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_osymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_osymbols, bool __pyx_v_attach_new_osymbols); /* proto */
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_40relabel_tables(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_isymbols, PyObject *__pyx_v_unknown_isymbol, bool __pyx_v_attach_new_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_osymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_osymbols, PyObject *__pyx_v_unknown_osymbol, bool __pyx_v_attach_new_osymbols); /* proto */
 static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_42reserve_arcs(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_state, size_t __pyx_v_n); /* proto */
 static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_44reserve_states(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, __pyx_t_10basictypes_int64 __pyx_v_n); /* proto */
 static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_46reweight(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, PyObject *__pyx_v_potentials, bool __pyx_v_to_final); /* proto */
@@ -16294,10 +16305,11 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst__repr_svg_(struct __pyx_obj_9pywrapfs
   PyObject *__pyx_t_5 = NULL;
   std::string __pyx_t_6;
   std::string __pyx_t_7;
-  PyObject *(*__pyx_t_8)(PyObject *);
-  int __pyx_t_9;
+  std::string __pyx_t_8;
+  PyObject *(*__pyx_t_9)(PyObject *);
   int __pyx_t_10;
-  PyObject *__pyx_t_11 = NULL;
+  int __pyx_t_11;
+  PyObject *__pyx_t_12 = NULL;
   __Pyx_RefNannySetupContext("_repr_svg_", 0);
 
   /* "pywrapfst.pyx":1374
@@ -16405,7 +16417,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst__repr_svg_(struct __pyx_obj_9pywrapfs
  *                 self._fst.get().OutputSymbols(), NULL,
  *                 self._fst.get().Properties(fst.kAcceptor, True) ==             # <<<<<<<<<<<<<<
  *                 fst.kAcceptor,
- *                 b"", 8.5, 11, True, False, 0.4, 0.25, 14, 5, False,
+ *                 b"", 8.5, 11, True, False, 0.4, 0.25, 14, 5, b"g", False,
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
@@ -16415,20 +16427,21 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst__repr_svg_(struct __pyx_obj_9pywrapfs
   /* "pywrapfst.pyx":1381
  *                 self._fst.get().Properties(fst.kAcceptor, True) ==
  *                 fst.kAcceptor,
- *                 b"", 8.5, 11, True, False, 0.4, 0.25, 14, 5, False,             # <<<<<<<<<<<<<<
+ *                 b"", 8.5, 11, True, False, 0.4, 0.25, 14, 5, b"g", False,             # <<<<<<<<<<<<<<
  *                 addr(sstrm), b"_repr_svg")
  *     (sout, serr) = proc.communicate(sstrm.str())
  */
   __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_kp_b_); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1381, __pyx_L1_error)
+  __pyx_t_7 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_g); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1381, __pyx_L1_error)
 
   /* "pywrapfst.pyx":1382
  *                 fst.kAcceptor,
- *                 b"", 8.5, 11, True, False, 0.4, 0.25, 14, 5, False,
+ *                 b"", 8.5, 11, True, False, 0.4, 0.25, 14, 5, b"g", False,
  *                 addr(sstrm), b"_repr_svg")             # <<<<<<<<<<<<<<
  *     (sout, serr) = proc.communicate(sstrm.str())
  *     if proc.returncode != 0:  # Just to be explicit.
  */
-  __pyx_t_7 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_repr_svg); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1382, __pyx_L1_error)
+  __pyx_t_8 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_repr_svg); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1382, __pyx_L1_error)
 
   /* "pywrapfst.pyx":1377
  *                             stdout=subprocess.PIPE, stderr=subprocess.PIPE)
@@ -16437,10 +16450,10 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst__repr_svg_(struct __pyx_obj_9pywrapfs
  *                 self._fst.get().OutputSymbols(), NULL,
  *                 self._fst.get().Properties(fst.kAcceptor, True) ==
  */
-  fst::script::DrawFst((*__pyx_v_self->_fst), __pyx_v_self->_fst.get()->InputSymbols(), __pyx_v_self->_fst.get()->OutputSymbols(), NULL, (__pyx_v_self->_fst.get()->Properties(fst::kAcceptor, 1) == fst::kAcceptor), __pyx_t_6, 8.5, 11.0, 1, 0, 0.4, 0.25, 14, 5, 0, (&__pyx_v_sstrm), __pyx_t_7);
+  fst::script::DrawFst((*__pyx_v_self->_fst), __pyx_v_self->_fst.get()->InputSymbols(), __pyx_v_self->_fst.get()->OutputSymbols(), NULL, (__pyx_v_self->_fst.get()->Properties(fst::kAcceptor, 1) == fst::kAcceptor), __pyx_t_6, 8.5, 11.0, 1, 0, 0.4, 0.25, 14, 5, __pyx_t_7, 0, (&__pyx_v_sstrm), __pyx_t_8);
 
   /* "pywrapfst.pyx":1383
- *                 b"", 8.5, 11, True, False, 0.4, 0.25, 14, 5, False,
+ *                 b"", 8.5, 11, True, False, 0.4, 0.25, 14, 5, b"g", False,
  *                 addr(sstrm), b"_repr_svg")
  *     (sout, serr) = proc.communicate(sstrm.str())             # <<<<<<<<<<<<<<
  *     if proc.returncode != 0:  # Just to be explicit.
@@ -16530,18 +16543,18 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst__repr_svg_(struct __pyx_obj_9pywrapfs
     __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1383, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
-    index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
+    __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext;
+    index = 0; __pyx_t_1 = __pyx_t_9(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
     __Pyx_GOTREF(__pyx_t_1);
-    index = 1; __pyx_t_4 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
+    index = 1; __pyx_t_4 = __pyx_t_9(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
     __Pyx_GOTREF(__pyx_t_4);
-    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 2) < 0) __PYX_ERR(0, 1383, __pyx_L1_error)
-    __pyx_t_8 = NULL;
+    if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_3), 2) < 0) __PYX_ERR(0, 1383, __pyx_L1_error)
+    __pyx_t_9 = NULL;
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     goto __pyx_L4_unpacking_done;
     __pyx_L3_unpacking_failed:;
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_8 = NULL;
+    __pyx_t_9 = NULL;
     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
     __PYX_ERR(0, 1383, __pyx_L1_error)
     __pyx_L4_unpacking_done:;
@@ -16562,9 +16575,9 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst__repr_svg_(struct __pyx_obj_9pywrapfs
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1384, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1384, __pyx_L1_error)
+  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 1384, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (__pyx_t_9) {
+  if (__pyx_t_10) {
 
     /* "pywrapfst.pyx":1385
  *     (sout, serr) = proc.communicate(sstrm.str())
@@ -16583,7 +16596,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst__repr_svg_(struct __pyx_obj_9pywrapfs
     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_DOT_TSVG); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1385, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_2 = NULL;
-    __pyx_t_10 = 0;
+    __pyx_t_11 = 0;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
       __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
       if (likely(__pyx_t_2)) {
@@ -16591,13 +16604,13 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst__repr_svg_(struct __pyx_obj_9pywrapfs
         __Pyx_INCREF(__pyx_t_2);
         __Pyx_INCREF(function);
         __Pyx_DECREF_SET(__pyx_t_1, function);
-        __pyx_t_10 = 1;
+        __pyx_t_11 = 1;
       }
     }
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_1)) {
       PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_5, __pyx_t_3};
-      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1385, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1385, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -16607,7 +16620,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst__repr_svg_(struct __pyx_obj_9pywrapfs
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
       PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_5, __pyx_t_3};
-      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1385, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1385, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -16615,20 +16628,20 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst__repr_svg_(struct __pyx_obj_9pywrapfs
     } else
     #endif
     {
-      __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1385, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_11);
+      __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1385, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_12);
       if (__pyx_t_2) {
-        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); __pyx_t_2 = NULL;
+        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2); __pyx_t_2 = NULL;
       }
       __Pyx_GIVEREF(__pyx_t_5);
-      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_t_5);
+      PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_5);
       __Pyx_GIVEREF(__pyx_t_3);
-      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_3);
+      PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_3);
       __pyx_t_5 = 0;
       __pyx_t_3 = 0;
-      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1385, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1385, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
     }
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_Raise(__pyx_t_4, 0, 0, 0);
@@ -16676,7 +16689,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst__repr_svg_(struct __pyx_obj_9pywrapfs
   __Pyx_XDECREF(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4);
   __Pyx_XDECREF(__pyx_t_5);
-  __Pyx_XDECREF(__pyx_t_11);
+  __Pyx_XDECREF(__pyx_t_12);
   __Pyx_AddTraceback("pywrapfst._Fst._repr_svg_", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -17628,10 +17641,11 @@ static void __pyx_f_9pywrapfst_4_Fst_draw(struct __pyx_obj_9pywrapfst__Fst *__py
   double __pyx_v_nodesep = ((double)0.25);
   __pyx_t_10basictypes_int32 __pyx_v_fontsize = ((__pyx_t_10basictypes_int32)14);
   __pyx_t_10basictypes_int32 __pyx_v_precision = ((__pyx_t_10basictypes_int32)5);
+  PyObject *__pyx_v_float_format = ((PyObject *)__pyx_n_b_g);
 
-  /* "pywrapfst.pyx":1445
- *                   int32 fontsize=14,
+  /* "pywrapfst.pyx":1446
  *                   int32 precision=5,
+ *                   float_format=b"g",
  *                   bool show_weight_one=False):             # <<<<<<<<<<<<<<
  *     """
  *     draw(self, filename, isymbols=None, osymbols=None, ssymbols=None,
@@ -17663,6 +17677,7 @@ static void __pyx_f_9pywrapfst_4_Fst_draw(struct __pyx_obj_9pywrapfst__Fst *__py
   fst::SymbolTable *__pyx_t_20;
   fst::SymbolTable const *__pyx_t_21;
   fst::SymbolTable const *__pyx_t_22;
+  std::string __pyx_t_23;
   __Pyx_RefNannySetupContext("draw", 0);
   if (__pyx_optional_args) {
     if (__pyx_optional_args->__pyx_n > 0) {
@@ -17692,7 +17707,10 @@ static void __pyx_f_9pywrapfst_4_Fst_draw(struct __pyx_obj_9pywrapfst__Fst *__py
                             if (__pyx_optional_args->__pyx_n > 12) {
                               __pyx_v_precision = __pyx_optional_args->precision;
                               if (__pyx_optional_args->__pyx_n > 13) {
-                                __pyx_v_show_weight_one = __pyx_optional_args->show_weight_one;
+                                __pyx_v_float_format = __pyx_optional_args->float_format;
+                                if (__pyx_optional_args->__pyx_n > 14) {
+                                  __pyx_v_show_weight_one = __pyx_optional_args->show_weight_one;
+                                }
                               }
                             }
                           }
@@ -17758,8 +17776,8 @@ static void __pyx_f_9pywrapfst_4_Fst_draw(struct __pyx_obj_9pywrapfst__Fst *__py
       }
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_13)) {
-        PyObject *__pyx_temp[16] = {__pyx_t_14, __pyx_v_filename, ((PyObject *)__pyx_v_isymbols), ((PyObject *)__pyx_v_osymbols), ((PyObject *)__pyx_v_ssymbols), __pyx_t_3, __pyx_v_title, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_12};
-        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_15, 15+__pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1430, __pyx_L1_error)
+        PyObject *__pyx_temp[17] = {__pyx_t_14, __pyx_v_filename, ((PyObject *)__pyx_v_isymbols), ((PyObject *)__pyx_v_osymbols), ((PyObject *)__pyx_v_ssymbols), __pyx_t_3, __pyx_v_title, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_v_float_format, __pyx_t_12};
+        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_15, 16+__pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1430, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
         __Pyx_GOTREF(__pyx_t_2);
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -17776,8 +17794,8 @@ static void __pyx_f_9pywrapfst_4_Fst_draw(struct __pyx_obj_9pywrapfst__Fst *__py
       #endif
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) {
-        PyObject *__pyx_temp[16] = {__pyx_t_14, __pyx_v_filename, ((PyObject *)__pyx_v_isymbols), ((PyObject *)__pyx_v_osymbols), ((PyObject *)__pyx_v_ssymbols), __pyx_t_3, __pyx_v_title, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_12};
-        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_15, 15+__pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1430, __pyx_L1_error)
+        PyObject *__pyx_temp[17] = {__pyx_t_14, __pyx_v_filename, ((PyObject *)__pyx_v_isymbols), ((PyObject *)__pyx_v_osymbols), ((PyObject *)__pyx_v_ssymbols), __pyx_t_3, __pyx_v_title, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_v_float_format, __pyx_t_12};
+        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_15, 16+__pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1430, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
         __Pyx_GOTREF(__pyx_t_2);
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -17793,7 +17811,7 @@ static void __pyx_f_9pywrapfst_4_Fst_draw(struct __pyx_obj_9pywrapfst__Fst *__py
       } else
       #endif
       {
-        __pyx_t_16 = PyTuple_New(15+__pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1430, __pyx_L1_error)
+        __pyx_t_16 = PyTuple_New(16+__pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1430, __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;
@@ -17831,8 +17849,11 @@ static void __pyx_f_9pywrapfst_4_Fst_draw(struct __pyx_obj_9pywrapfst__Fst *__py
         PyTuple_SET_ITEM(__pyx_t_16, 12+__pyx_t_15, __pyx_t_10);
         __Pyx_GIVEREF(__pyx_t_11);
         PyTuple_SET_ITEM(__pyx_t_16, 13+__pyx_t_15, __pyx_t_11);
+        __Pyx_INCREF(__pyx_v_float_format);
+        __Pyx_GIVEREF(__pyx_v_float_format);
+        PyTuple_SET_ITEM(__pyx_t_16, 14+__pyx_t_15, __pyx_v_float_format);
         __Pyx_GIVEREF(__pyx_t_12);
-        PyTuple_SET_ITEM(__pyx_t_16, 14+__pyx_t_15, __pyx_t_12);
+        PyTuple_SET_ITEM(__pyx_t_16, 15+__pyx_t_15, __pyx_t_12);
         __pyx_t_3 = 0;
         __pyx_t_4 = 0;
         __pyx_t_5 = 0;
@@ -17855,17 +17876,17 @@ static void __pyx_f_9pywrapfst_4_Fst_draw(struct __pyx_obj_9pywrapfst__Fst *__py
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":1480
+  /* "pywrapfst.pyx":1482
  *     See also: `text`.
  *     """
  *     cdef string filename_string = tostring(filename)             # <<<<<<<<<<<<<<
  *     cdef unique_ptr[ofstream] ostrm
  *     ostrm.reset(new ofstream(filename_string.c_str()))
  */
-  __pyx_t_17 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1480, __pyx_L1_error)
+  __pyx_t_17 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1482, __pyx_L1_error)
   __pyx_v_filename_string = __pyx_t_17;
 
-  /* "pywrapfst.pyx":1482
+  /* "pywrapfst.pyx":1484
  *     cdef string filename_string = tostring(filename)
  *     cdef unique_ptr[ofstream] ostrm
  *     ostrm.reset(new ofstream(filename_string.c_str()))             # <<<<<<<<<<<<<<
@@ -17874,7 +17895,7 @@ static void __pyx_f_9pywrapfst_4_Fst_draw(struct __pyx_obj_9pywrapfst__Fst *__py
  */
   __pyx_v_ostrm.reset(new std::ofstream(__pyx_v_filename_string.c_str()));
 
-  /* "pywrapfst.pyx":1483
+  /* "pywrapfst.pyx":1485
  *     cdef unique_ptr[ofstream] ostrm
  *     ostrm.reset(new ofstream(filename_string.c_str()))
  *     cdef fst.SymbolTable *ssymbols_ptr = NULL             # <<<<<<<<<<<<<<
@@ -17883,7 +17904,7 @@ static void __pyx_f_9pywrapfst_4_Fst_draw(struct __pyx_obj_9pywrapfst__Fst *__py
  */
   __pyx_v_ssymbols_ptr = NULL;
 
-  /* "pywrapfst.pyx":1484
+  /* "pywrapfst.pyx":1486
  *     ostrm.reset(new ofstream(filename_string.c_str()))
  *     cdef fst.SymbolTable *ssymbols_ptr = NULL
  *     if ssymbols is not None:             # <<<<<<<<<<<<<<
@@ -17894,7 +17915,7 @@ static void __pyx_f_9pywrapfst_4_Fst_draw(struct __pyx_obj_9pywrapfst__Fst *__py
   __pyx_t_19 = (__pyx_t_18 != 0);
   if (__pyx_t_19) {
 
-    /* "pywrapfst.pyx":1485
+    /* "pywrapfst.pyx":1487
  *     cdef fst.SymbolTable *ssymbols_ptr = NULL
  *     if ssymbols is not None:
  *       ssymbols_ptr = ssymbols._table             # <<<<<<<<<<<<<<
@@ -17903,12 +17924,12 @@ static void __pyx_f_9pywrapfst_4_Fst_draw(struct __pyx_obj_9pywrapfst__Fst *__py
  */
     if (unlikely(((PyObject *)__pyx_v_ssymbols) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
-      __PYX_ERR(0, 1485, __pyx_L1_error)
+      __PYX_ERR(0, 1487, __pyx_L1_error)
     }
     __pyx_t_20 = __pyx_v_ssymbols->__pyx_base.__pyx_base._table;
     __pyx_v_ssymbols_ptr = __pyx_t_20;
 
-    /* "pywrapfst.pyx":1484
+    /* "pywrapfst.pyx":1486
  *     ostrm.reset(new ofstream(filename_string.c_str()))
  *     cdef fst.SymbolTable *ssymbols_ptr = NULL
  *     if ssymbols is not None:             # <<<<<<<<<<<<<<
@@ -17917,7 +17938,7 @@ static void __pyx_f_9pywrapfst_4_Fst_draw(struct __pyx_obj_9pywrapfst__Fst *__py
  */
   }
 
-  /* "pywrapfst.pyx":1486
+  /* "pywrapfst.pyx":1488
  *     if ssymbols is not None:
  *       ssymbols_ptr = ssymbols._table
  *     fst.DrawFst(deref(self._fst),             # <<<<<<<<<<<<<<
@@ -17926,10 +17947,10 @@ static void __pyx_f_9pywrapfst_4_Fst_draw(struct __pyx_obj_9pywrapfst__Fst *__py
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 1486, __pyx_L1_error)
+    __PYX_ERR(0, 1488, __pyx_L1_error)
   }
 
-  /* "pywrapfst.pyx":1487
+  /* "pywrapfst.pyx":1489
  *       ssymbols_ptr = ssymbols._table
  *     fst.DrawFst(deref(self._fst),
  *         self._fst.get().InputSymbols() if isymbols is None             # <<<<<<<<<<<<<<
@@ -17940,12 +17961,12 @@ static void __pyx_f_9pywrapfst_4_Fst_draw(struct __pyx_obj_9pywrapfst__Fst *__py
   if ((__pyx_t_19 != 0)) {
     if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-      __PYX_ERR(0, 1487, __pyx_L1_error)
+      __PYX_ERR(0, 1489, __pyx_L1_error)
     }
     __pyx_t_21 = __pyx_v_self->_fst.get()->InputSymbols();
   } else {
 
-    /* "pywrapfst.pyx":1488
+    /* "pywrapfst.pyx":1490
  *     fst.DrawFst(deref(self._fst),
  *         self._fst.get().InputSymbols() if isymbols is None
  *         else isymbols._table,             # <<<<<<<<<<<<<<
@@ -17954,12 +17975,12 @@ static void __pyx_f_9pywrapfst_4_Fst_draw(struct __pyx_obj_9pywrapfst__Fst *__py
  */
     if (unlikely(((PyObject *)__pyx_v_isymbols) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
-      __PYX_ERR(0, 1488, __pyx_L1_error)
+      __PYX_ERR(0, 1490, __pyx_L1_error)
     }
     __pyx_t_21 = __pyx_v_isymbols->_table;
   }
 
-  /* "pywrapfst.pyx":1489
+  /* "pywrapfst.pyx":1491
  *         self._fst.get().InputSymbols() if isymbols is None
  *         else isymbols._table,
  *         self._fst.get().OutputSymbols() if osymbols is None             # <<<<<<<<<<<<<<
@@ -17970,42 +17991,51 @@ static void __pyx_f_9pywrapfst_4_Fst_draw(struct __pyx_obj_9pywrapfst__Fst *__py
   if ((__pyx_t_19 != 0)) {
     if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-      __PYX_ERR(0, 1489, __pyx_L1_error)
+      __PYX_ERR(0, 1491, __pyx_L1_error)
     }
     __pyx_t_22 = __pyx_v_self->_fst.get()->OutputSymbols();
   } else {
 
-    /* "pywrapfst.pyx":1490
+    /* "pywrapfst.pyx":1492
  *         else isymbols._table,
  *         self._fst.get().OutputSymbols() if osymbols is None
  *         else osymbols._table,             # <<<<<<<<<<<<<<
  *         ssymbols_ptr, acceptor, tostring(title), width, height, portrait,
- *         vertical, ranksep, nodesep, fontsize, precision, show_weight_one,
+ *         vertical, ranksep, nodesep, fontsize, precision,
  */
     if (unlikely(((PyObject *)__pyx_v_osymbols) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
-      __PYX_ERR(0, 1490, __pyx_L1_error)
+      __PYX_ERR(0, 1492, __pyx_L1_error)
     }
     __pyx_t_22 = __pyx_v_osymbols->_table;
   }
 
-  /* "pywrapfst.pyx":1491
+  /* "pywrapfst.pyx":1493
  *         self._fst.get().OutputSymbols() if osymbols is None
  *         else osymbols._table,
  *         ssymbols_ptr, acceptor, tostring(title), width, height, portrait,             # <<<<<<<<<<<<<<
- *         vertical, ranksep, nodesep, fontsize, precision, show_weight_one,
- *         ostrm.get(), filename_string)
+ *         vertical, ranksep, nodesep, fontsize, precision,
+ *         tostring(float_format), show_weight_one, ostrm.get(),
  */
-  __pyx_t_17 = __pyx_f_9pywrapfst_tostring(__pyx_v_title, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1491, __pyx_L1_error)
+  __pyx_t_17 = __pyx_f_9pywrapfst_tostring(__pyx_v_title, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1493, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":1486
+  /* "pywrapfst.pyx":1495
+ *         ssymbols_ptr, acceptor, tostring(title), width, height, portrait,
+ *         vertical, ranksep, nodesep, fontsize, precision,
+ *         tostring(float_format), show_weight_one, ostrm.get(),             # <<<<<<<<<<<<<<
+ *         filename_string)
+ * 
+ */
+  __pyx_t_23 = __pyx_f_9pywrapfst_tostring(__pyx_v_float_format, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1495, __pyx_L1_error)
+
+  /* "pywrapfst.pyx":1488
  *     if ssymbols is not None:
  *       ssymbols_ptr = ssymbols._table
  *     fst.DrawFst(deref(self._fst),             # <<<<<<<<<<<<<<
  *         self._fst.get().InputSymbols() if isymbols is None
  *         else isymbols._table,
  */
-  fst::script::DrawFst((*__pyx_v_self->_fst), __pyx_t_21, __pyx_t_22, __pyx_v_ssymbols_ptr, __pyx_v_acceptor, __pyx_t_17, __pyx_v_width, __pyx_v_height, __pyx_v_portrait, __pyx_v_vertical, __pyx_v_ranksep, __pyx_v_nodesep, __pyx_v_fontsize, __pyx_v_precision, __pyx_v_show_weight_one, __pyx_v_ostrm.get(), __pyx_v_filename_string);
+  fst::script::DrawFst((*__pyx_v_self->_fst), __pyx_t_21, __pyx_t_22, __pyx_v_ssymbols_ptr, __pyx_v_acceptor, __pyx_t_17, __pyx_v_width, __pyx_v_height, __pyx_v_portrait, __pyx_v_vertical, __pyx_v_ranksep, __pyx_v_nodesep, __pyx_v_fontsize, __pyx_v_precision, __pyx_t_23, __pyx_v_show_weight_one, __pyx_v_ostrm.get(), __pyx_v_filename_string);
 
   /* "pywrapfst.pyx":1430
  *     return _init_XFst(new fst.FstClass(deref(self._fst)))
@@ -18040,7 +18070,7 @@ static void __pyx_f_9pywrapfst_4_Fst_draw(struct __pyx_obj_9pywrapfst__Fst *__py
 
 /* Python wrapper */
 static PyObject *__pyx_pw_9pywrapfst_4_Fst_15draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_4_Fst_14draw[] = "\n    draw(self, filename, 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, 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      filename: 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      show_weight_one: Should weights equivalent to semiring One be printed?\n\n    For more information about the rendering options, see `man dot`.\n\n    See also: `text`.\n    ";
+static char __pyx_doc_9pywrapfst_4_Fst_14draw[] = "\n    draw(self, filename, 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      filename: 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\n    For more information about the rendering options, see `man dot`.\n\n    See also: `text`.\n    ";
 static PyObject *__pyx_pw_9pywrapfst_4_Fst_15draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_filename = 0;
   struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_isymbols = 0;
@@ -18056,13 +18086,14 @@ static PyObject *__pyx_pw_9pywrapfst_4_Fst_15draw(PyObject *__pyx_v_self, PyObje
   double __pyx_v_nodesep;
   __pyx_t_10basictypes_int32 __pyx_v_fontsize;
   __pyx_t_10basictypes_int32 __pyx_v_precision;
+  PyObject *__pyx_v_float_format = 0;
   bool __pyx_v_show_weight_one;
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("draw (wrapper)", 0);
   {
-    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_isymbols,&__pyx_n_s_osymbols,&__pyx_n_s_ssymbols,&__pyx_n_s_acceptor,&__pyx_n_s_title,&__pyx_n_s_width,&__pyx_n_s_height,&__pyx_n_s_portrait,&__pyx_n_s_vertical,&__pyx_n_s_ranksep,&__pyx_n_s_nodesep,&__pyx_n_s_fontsize,&__pyx_n_s_precision,&__pyx_n_s_show_weight_one,0};
-    PyObject* values[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_filename,&__pyx_n_s_isymbols,&__pyx_n_s_osymbols,&__pyx_n_s_ssymbols,&__pyx_n_s_acceptor,&__pyx_n_s_title,&__pyx_n_s_width,&__pyx_n_s_height,&__pyx_n_s_portrait,&__pyx_n_s_vertical,&__pyx_n_s_ranksep,&__pyx_n_s_nodesep,&__pyx_n_s_fontsize,&__pyx_n_s_precision,&__pyx_n_s_float_format,&__pyx_n_s_show_weight_one,0};
+    PyObject* values[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
 
     /* "pywrapfst.pyx":1432
  *   cpdef void draw(self,
@@ -18091,10 +18122,12 @@ static PyObject *__pyx_pw_9pywrapfst_4_Fst_15draw(PyObject *__pyx_v_self, PyObje
  */
     values[3] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTable *)Py_None);
     values[5] = ((PyObject *)__pyx_kp_b_);
+    values[14] = ((PyObject *)__pyx_n_b_g);
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
       switch (pos_args) {
+        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
         case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
         case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
         case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
@@ -18185,15 +18218,21 @@ static PyObject *__pyx_pw_9pywrapfst_4_Fst_15draw(PyObject *__pyx_v_self, PyObje
         }
         case 14:
         if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_show_weight_one);
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_float_format);
           if (value) { values[14] = value; kw_args--; }
         }
+        case 15:
+        if (kw_args > 0) {
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_show_weight_one);
+          if (value) { values[15] = value; kw_args--; }
+        }
       }
       if (unlikely(kw_args > 0)) {
         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw") < 0)) __PYX_ERR(0, 1430, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
         case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
         case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
         case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
@@ -18287,13 +18326,14 @@ static PyObject *__pyx_pw_9pywrapfst_4_Fst_15draw(PyObject *__pyx_v_self, PyObje
     } else {
       __pyx_v_precision = ((__pyx_t_10basictypes_int32)5);
     }
-    if (values[14]) {
-      __pyx_v_show_weight_one = __Pyx_PyObject_IsTrue(values[14]); if (unlikely((__pyx_v_show_weight_one == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1445, __pyx_L3_error)
+    __pyx_v_float_format = values[14];
+    if (values[15]) {
+      __pyx_v_show_weight_one = __Pyx_PyObject_IsTrue(values[15]); if (unlikely((__pyx_v_show_weight_one == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1446, __pyx_L3_error)
     } else {
 
-      /* "pywrapfst.pyx":1445
- *                   int32 fontsize=14,
+      /* "pywrapfst.pyx":1446
  *                   int32 precision=5,
+ *                   float_format=b"g",
  *                   bool show_weight_one=False):             # <<<<<<<<<<<<<<
  *     """
  *     draw(self, filename, isymbols=None, osymbols=None, ssymbols=None,
@@ -18303,7 +18343,7 @@ static PyObject *__pyx_pw_9pywrapfst_4_Fst_15draw(PyObject *__pyx_v_self, PyObje
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("draw", 0, 1, 15, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1430, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("draw", 0, 1, 16, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1430, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("pywrapfst._Fst.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -18312,7 +18352,7 @@ static PyObject *__pyx_pw_9pywrapfst_4_Fst_15draw(PyObject *__pyx_v_self, PyObje
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "isymbols", 0))) __PYX_ERR(0, 1432, __pyx_L1_error)
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 1433, __pyx_L1_error)
   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 1434, __pyx_L1_error)
-  __pyx_r = __pyx_pf_9pywrapfst_4_Fst_14draw(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), __pyx_v_filename, __pyx_v_isymbols, __pyx_v_osymbols, __pyx_v_ssymbols, __pyx_v_acceptor, __pyx_v_title, __pyx_v_width, __pyx_v_height, __pyx_v_portrait, __pyx_v_vertical, __pyx_v_ranksep, __pyx_v_nodesep, __pyx_v_fontsize, __pyx_v_precision, __pyx_v_show_weight_one);
+  __pyx_r = __pyx_pf_9pywrapfst_4_Fst_14draw(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), __pyx_v_filename, __pyx_v_isymbols, __pyx_v_osymbols, __pyx_v_ssymbols, __pyx_v_acceptor, __pyx_v_title, __pyx_v_width, __pyx_v_height, __pyx_v_portrait, __pyx_v_vertical, __pyx_v_ranksep, __pyx_v_nodesep, __pyx_v_fontsize, __pyx_v_precision, __pyx_v_float_format, __pyx_v_show_weight_one);
 
   /* "pywrapfst.pyx":1430
  *     return _init_XFst(new fst.FstClass(deref(self._fst)))
@@ -18331,14 +18371,14 @@ static PyObject *__pyx_pw_9pywrapfst_4_Fst_15draw(PyObject *__pyx_v_self, PyObje
   return __pyx_r;
 }
 
-static PyObject *__pyx_pf_9pywrapfst_4_Fst_14draw(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, PyObject *__pyx_v_filename, 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, __pyx_t_10basictypes_int32 __pyx_v_fontsize, __pyx_t_10basictypes_int32 __pyx_v_precision, bool __pyx_v_show_weight_one) {
+static PyObject *__pyx_pf_9pywrapfst_4_Fst_14draw(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, PyObject *__pyx_v_filename, 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, __pyx_t_10basictypes_int32 __pyx_v_fontsize, __pyx_t_10basictypes_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_4_Fst_draw __pyx_t_1;
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("draw", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1.__pyx_n = 14;
+  __pyx_t_1.__pyx_n = 15;
   __pyx_t_1.isymbols = __pyx_v_isymbols;
   __pyx_t_1.osymbols = __pyx_v_osymbols;
   __pyx_t_1.ssymbols = __pyx_v_ssymbols;
@@ -18352,6 +18392,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_14draw(struct __pyx_obj_9pywrapfst__F
   __pyx_t_1.nodesep = __pyx_v_nodesep;
   __pyx_t_1.fontsize = __pyx_v_fontsize;
   __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_filename, 1, &__pyx_t_1); 
   __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1430, __pyx_L1_error)
@@ -18371,8 +18412,8 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_14draw(struct __pyx_obj_9pywrapfst__F
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":1495
- *         ostrm.get(), filename_string)
+/* "pywrapfst.pyx":1498
+ *         filename_string)
  * 
  *   cpdef Weight final(self, int64 state):             # <<<<<<<<<<<<<<
  *     """
@@ -18395,11 +18436,11 @@ static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst_4_Fst_final(struct
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_final); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1495, __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, 1498, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_17final)) {
       __Pyx_XDECREF(((PyObject *)__pyx_r));
-      __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1495, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1498, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_INCREF(__pyx_t_1);
       __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
@@ -18413,14 +18454,14 @@ static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst_4_Fst_final(struct
         }
       }
       if (!__pyx_t_5) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1495, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1498, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         __Pyx_GOTREF(__pyx_t_2);
       } else {
         #if CYTHON_FAST_PYCALL
         if (PyFunction_Check(__pyx_t_4)) {
           PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
-          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1495, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1498, __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;
@@ -18429,26 +18470,26 @@ static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst_4_Fst_final(struct
         #if CYTHON_FAST_PYCCALL
         if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
           PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
-          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1495, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1498, __pyx_L1_error)
           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
           __Pyx_GOTREF(__pyx_t_2);
           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         } else
         #endif
         {
-          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1495, __pyx_L1_error)
+          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1498, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_6);
           __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
           __Pyx_GIVEREF(__pyx_t_3);
           PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
           __pyx_t_3 = 0;
-          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1495, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1498, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_2);
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         }
       }
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_Weight))))) __PYX_ERR(0, 1495, __pyx_L1_error)
+      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_Weight))))) __PYX_ERR(0, 1498, __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;
@@ -18457,20 +18498,20 @@ static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst_4_Fst_final(struct
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":1510
+  /* "pywrapfst.pyx":1513
  *       FstIndexError: State index out of range.
  *     """
  *     cdef Weight weight = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
  *     weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state)))
  *     return weight
  */
-  __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1510, __pyx_L1_error)
+  __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1513, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 1510, __pyx_L1_error)
+  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 1513, __pyx_L1_error)
   __pyx_v_weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "pywrapfst.pyx":1511
+  /* "pywrapfst.pyx":1514
  *     """
  *     cdef Weight weight = Weight.__new__(Weight)
  *     weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state)))             # <<<<<<<<<<<<<<
@@ -18479,15 +18520,15 @@ static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst_4_Fst_final(struct
  */
   if (unlikely(((PyObject *)__pyx_v_weight) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
-    __PYX_ERR(0, 1511, __pyx_L1_error)
+    __PYX_ERR(0, 1514, __pyx_L1_error)
   }
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 1511, __pyx_L1_error)
+    __PYX_ERR(0, 1514, __pyx_L1_error)
   }
   __pyx_v_weight->_weight.reset(new fst::script::WeightClass(__pyx_v_self->_fst.get()->Final(__pyx_v_state)));
 
-  /* "pywrapfst.pyx":1512
+  /* "pywrapfst.pyx":1515
  *     cdef Weight weight = Weight.__new__(Weight)
  *     weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state)))
  *     return weight             # <<<<<<<<<<<<<<
@@ -18499,8 +18540,8 @@ static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst_4_Fst_final(struct
   __pyx_r = __pyx_v_weight;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":1495
- *         ostrm.get(), filename_string)
+  /* "pywrapfst.pyx":1498
+ *         filename_string)
  * 
  *   cpdef Weight final(self, int64 state):             # <<<<<<<<<<<<<<
  *     """
@@ -18533,7 +18574,7 @@ static PyObject *__pyx_pw_9pywrapfst_4_Fst_17final(PyObject *__pyx_v_self, PyObj
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("final (wrapper)", 0);
   assert(__pyx_arg_state); {
-    __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1495, __pyx_L3_error)
+    __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1498, __pyx_L3_error)
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L3_error:;
@@ -18554,7 +18595,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_16final(struct __pyx_obj_9pywrapfst__
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("final", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_4_Fst_final(__pyx_v_self, __pyx_v_state, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1495, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_4_Fst_final(__pyx_v_self, __pyx_v_state, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1498, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -18571,7 +18612,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_16final(struct __pyx_obj_9pywrapfst__
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":1514
+/* "pywrapfst.pyx":1517
  *     return weight
  * 
  *   cpdef string fst_type(self):             # <<<<<<<<<<<<<<
@@ -18593,7 +18634,7 @@ static std::string __pyx_f_9pywrapfst_4_Fst_fst_type(struct __pyx_obj_9pywrapfst
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fst_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1514, __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, 1517, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_19fst_type)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -18608,14 +18649,14 @@ static std::string __pyx_f_9pywrapfst_4_Fst_fst_type(struct __pyx_obj_9pywrapfst
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1514, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1517, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1514, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1517, __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, 1514, __pyx_L1_error)
+      __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1517, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __pyx_r = __pyx_t_5;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -18624,7 +18665,7 @@ static std::string __pyx_f_9pywrapfst_4_Fst_fst_type(struct __pyx_obj_9pywrapfst
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":1515
+  /* "pywrapfst.pyx":1518
  * 
  *   cpdef string fst_type(self):
  *     return self._fst.get().FstType()             # <<<<<<<<<<<<<<
@@ -18633,12 +18674,12 @@ static std::string __pyx_f_9pywrapfst_4_Fst_fst_type(struct __pyx_obj_9pywrapfst
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 1515, __pyx_L1_error)
+    __PYX_ERR(0, 1518, __pyx_L1_error)
   }
   __pyx_r = __pyx_v_self->_fst.get()->FstType();
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":1514
+  /* "pywrapfst.pyx":1517
  *     return weight
  * 
  *   cpdef string fst_type(self):             # <<<<<<<<<<<<<<
@@ -18677,7 +18718,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_18fst_type(struct __pyx_obj_9pywrapfs
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("fst_type", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_4_Fst_fst_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1514, __pyx_L1_error)
+  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_4_Fst_fst_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1517, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -18694,7 +18735,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_18fst_type(struct __pyx_obj_9pywrapfs
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":1517
+/* "pywrapfst.pyx":1520
  *     return self._fst.get().FstType()
  * 
  *   cpdef _FstSymbolTable input_symbols(self):             # <<<<<<<<<<<<<<
@@ -18716,7 +18757,7 @@ static struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_f_9pywrapfst_4_Fst_inp
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_input_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1517, __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, 1520, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_21input_symbols)) {
       __Pyx_XDECREF(((PyObject *)__pyx_r));
@@ -18732,14 +18773,14 @@ static struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_f_9pywrapfst_4_Fst_inp
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1517, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1520, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1517, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1520, __pyx_L1_error)
       }
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__FstSymbolTable))))) __PYX_ERR(0, 1517, __pyx_L1_error)
+      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__FstSymbolTable))))) __PYX_ERR(0, 1520, __pyx_L1_error)
       __pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTable *)__pyx_t_2);
       __pyx_t_2 = 0;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -18748,7 +18789,7 @@ static struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_f_9pywrapfst_4_Fst_inp
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":1518
+  /* "pywrapfst.pyx":1521
  * 
  *   cpdef _FstSymbolTable input_symbols(self):
  *     if self._fst.get().InputSymbols() == NULL:             # <<<<<<<<<<<<<<
@@ -18757,12 +18798,12 @@ static struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_f_9pywrapfst_4_Fst_inp
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 1518, __pyx_L1_error)
+    __PYX_ERR(0, 1521, __pyx_L1_error)
   }
   __pyx_t_5 = ((__pyx_v_self->_fst.get()->InputSymbols() == NULL) != 0);
   if (__pyx_t_5) {
 
-    /* "pywrapfst.pyx":1519
+    /* "pywrapfst.pyx":1522
  *   cpdef _FstSymbolTable input_symbols(self):
  *     if self._fst.get().InputSymbols() == NULL:
  *       return             # <<<<<<<<<<<<<<
@@ -18773,7 +18814,7 @@ static struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_f_9pywrapfst_4_Fst_inp
     __pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTable *)Py_None); __Pyx_INCREF(Py_None);
     goto __pyx_L0;
 
-    /* "pywrapfst.pyx":1518
+    /* "pywrapfst.pyx":1521
  * 
  *   cpdef _FstSymbolTable input_symbols(self):
  *     if self._fst.get().InputSymbols() == NULL:             # <<<<<<<<<<<<<<
@@ -18782,7 +18823,7 @@ static struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_f_9pywrapfst_4_Fst_inp
  */
   }
 
-  /* "pywrapfst.pyx":1520
+  /* "pywrapfst.pyx":1523
  *     if self._fst.get().InputSymbols() == NULL:
  *       return
  *     return _init_FstSymbolTable(const_cast[SymbolTable_ptr](             # <<<<<<<<<<<<<<
@@ -18791,7 +18832,7 @@ static struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_f_9pywrapfst_4_Fst_inp
  */
   __Pyx_XDECREF(((PyObject *)__pyx_r));
 
-  /* "pywrapfst.pyx":1521
+  /* "pywrapfst.pyx":1524
  *       return
  *     return _init_FstSymbolTable(const_cast[SymbolTable_ptr](
  *         self._fst.get().InputSymbols()), self._fst)             # <<<<<<<<<<<<<<
@@ -18800,10 +18841,10 @@ static struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_f_9pywrapfst_4_Fst_inp
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 1521, __pyx_L1_error)
+    __PYX_ERR(0, 1524, __pyx_L1_error)
   }
 
-  /* "pywrapfst.pyx":1520
+  /* "pywrapfst.pyx":1523
  *     if self._fst.get().InputSymbols() == NULL:
  *       return
  *     return _init_FstSymbolTable(const_cast[SymbolTable_ptr](             # <<<<<<<<<<<<<<
@@ -18812,23 +18853,23 @@ static struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_f_9pywrapfst_4_Fst_inp
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 1521, __pyx_L1_error)
+    __PYX_ERR(0, 1524, __pyx_L1_error)
   }
 
-  /* "pywrapfst.pyx":1521
+  /* "pywrapfst.pyx":1524
  *       return
  *     return _init_FstSymbolTable(const_cast[SymbolTable_ptr](
  *         self._fst.get().InputSymbols()), self._fst)             # <<<<<<<<<<<<<<
  * 
  *   cpdef size_t num_arcs(self, int64 state) except *:
  */
-  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_FstSymbolTable(const_cast<__pyx_t_9pywrapfst_SymbolTable_ptr>(__pyx_v_self->_fst.get()->InputSymbols()), __pyx_v_self->_fst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1520, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_FstSymbolTable(const_cast<__pyx_t_9pywrapfst_SymbolTable_ptr>(__pyx_v_self->_fst.get()->InputSymbols()), __pyx_v_self->_fst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1523, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTable *)__pyx_t_1);
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":1517
+  /* "pywrapfst.pyx":1520
  *     return self._fst.get().FstType()
  * 
  *   cpdef _FstSymbolTable input_symbols(self):             # <<<<<<<<<<<<<<
@@ -18869,7 +18910,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_20input_symbols(struct __pyx_obj_9pyw
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("input_symbols", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_4_Fst_input_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1517, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_4_Fst_input_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1520, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -18886,7 +18927,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_20input_symbols(struct __pyx_obj_9pyw
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":1523
+/* "pywrapfst.pyx":1526
  *         self._fst.get().InputSymbols()), self._fst)
  * 
  *   cpdef size_t num_arcs(self, int64 state) except *:             # <<<<<<<<<<<<<<
@@ -18912,10 +18953,10 @@ static size_t __pyx_f_9pywrapfst_4_Fst_num_arcs(struct __pyx_obj_9pywrapfst__Fst
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_arcs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1523, __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, 1526, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_23num_arcs)) {
-      __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1523, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1526, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_INCREF(__pyx_t_1);
       __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
@@ -18929,14 +18970,14 @@ static size_t __pyx_f_9pywrapfst_4_Fst_num_arcs(struct __pyx_obj_9pywrapfst__Fst
         }
       }
       if (!__pyx_t_5) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1523, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1526, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         __Pyx_GOTREF(__pyx_t_2);
       } else {
         #if CYTHON_FAST_PYCALL
         if (PyFunction_Check(__pyx_t_4)) {
           PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
-          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1523, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1526, __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;
@@ -18945,26 +18986,26 @@ static size_t __pyx_f_9pywrapfst_4_Fst_num_arcs(struct __pyx_obj_9pywrapfst__Fst
         #if CYTHON_FAST_PYCCALL
         if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
           PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
-          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1523, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1526, __pyx_L1_error)
           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
           __Pyx_GOTREF(__pyx_t_2);
           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         } else
         #endif
         {
-          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1523, __pyx_L1_error)
+          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1526, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_6);
           __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
           __Pyx_GIVEREF(__pyx_t_3);
           PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
           __pyx_t_3 = 0;
-          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1523, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1526, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_2);
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         }
       }
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1523, __pyx_L1_error)
+      __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1526, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __pyx_r = __pyx_t_7;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -18973,7 +19014,7 @@ static size_t __pyx_f_9pywrapfst_4_Fst_num_arcs(struct __pyx_obj_9pywrapfst__Fst
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":1540
+  /* "pywrapfst.pyx":1543
  *     See also: `num_states`.
  *     """
  *     cdef size_t result = self._fst.get().NumArcs(state)             # <<<<<<<<<<<<<<
@@ -18982,11 +19023,11 @@ static size_t __pyx_f_9pywrapfst_4_Fst_num_arcs(struct __pyx_obj_9pywrapfst__Fst
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 1540, __pyx_L1_error)
+    __PYX_ERR(0, 1543, __pyx_L1_error)
   }
   __pyx_v_result = __pyx_v_self->_fst.get()->NumArcs(__pyx_v_state);
 
-  /* "pywrapfst.pyx":1541
+  /* "pywrapfst.pyx":1544
  *     """
  *     cdef size_t result = self._fst.get().NumArcs(state)
  *     if result == SIZE_MAX:             # <<<<<<<<<<<<<<
@@ -18996,23 +19037,23 @@ static size_t __pyx_f_9pywrapfst_4_Fst_num_arcs(struct __pyx_obj_9pywrapfst__Fst
   __pyx_t_8 = ((__pyx_v_result == SIZE_MAX) != 0);
   if (__pyx_t_8) {
 
-    /* "pywrapfst.pyx":1542
+    /* "pywrapfst.pyx":1545
  *     cdef size_t result = self._fst.get().NumArcs(state)
  *     if result == SIZE_MAX:
  *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
  *     return result
  * 
  */
-    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1542, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1545, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1542, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1545, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 1542, __pyx_L1_error)
+    __PYX_ERR(0, 1545, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":1541
+    /* "pywrapfst.pyx":1544
  *     """
  *     cdef size_t result = self._fst.get().NumArcs(state)
  *     if result == SIZE_MAX:             # <<<<<<<<<<<<<<
@@ -19021,7 +19062,7 @@ static size_t __pyx_f_9pywrapfst_4_Fst_num_arcs(struct __pyx_obj_9pywrapfst__Fst
  */
   }
 
-  /* "pywrapfst.pyx":1543
+  /* "pywrapfst.pyx":1546
  *     if result == SIZE_MAX:
  *       raise FstIndexError("State index out of range")
  *     return result             # <<<<<<<<<<<<<<
@@ -19031,7 +19072,7 @@ static size_t __pyx_f_9pywrapfst_4_Fst_num_arcs(struct __pyx_obj_9pywrapfst__Fst
   __pyx_r = __pyx_v_result;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":1523
+  /* "pywrapfst.pyx":1526
  *         self._fst.get().InputSymbols()), self._fst)
  * 
  *   cpdef size_t num_arcs(self, int64 state) except *:             # <<<<<<<<<<<<<<
@@ -19063,7 +19104,7 @@ static PyObject *__pyx_pw_9pywrapfst_4_Fst_23num_arcs(PyObject *__pyx_v_self, Py
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("num_arcs (wrapper)", 0);
   assert(__pyx_arg_state); {
-    __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1523, __pyx_L3_error)
+    __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1526, __pyx_L3_error)
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L3_error:;
@@ -19085,8 +19126,8 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_22num_arcs(struct __pyx_obj_9pywrapfs
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("num_arcs", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_9pywrapfst_4_Fst_num_arcs(__pyx_v_self, __pyx_v_state, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1523, __pyx_L1_error)
-  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1523, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_9pywrapfst_4_Fst_num_arcs(__pyx_v_self, __pyx_v_state, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1526, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1526, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
@@ -19103,7 +19144,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_22num_arcs(struct __pyx_obj_9pywrapfs
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":1545
+/* "pywrapfst.pyx":1548
  *     return result
  * 
  *   cpdef size_t num_input_epsilons(self, int64 state) except *:             # <<<<<<<<<<<<<<
@@ -19129,10 +19170,10 @@ static size_t __pyx_f_9pywrapfst_4_Fst_num_input_epsilons(struct __pyx_obj_9pywr
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_input_epsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1545, __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, 1548, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_25num_input_epsilons)) {
-      __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1545, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1548, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_INCREF(__pyx_t_1);
       __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
@@ -19146,14 +19187,14 @@ static size_t __pyx_f_9pywrapfst_4_Fst_num_input_epsilons(struct __pyx_obj_9pywr
         }
       }
       if (!__pyx_t_5) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1545, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1548, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         __Pyx_GOTREF(__pyx_t_2);
       } else {
         #if CYTHON_FAST_PYCALL
         if (PyFunction_Check(__pyx_t_4)) {
           PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
-          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1545, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1548, __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;
@@ -19162,26 +19203,26 @@ static size_t __pyx_f_9pywrapfst_4_Fst_num_input_epsilons(struct __pyx_obj_9pywr
         #if CYTHON_FAST_PYCCALL
         if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
           PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
-          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1545, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1548, __pyx_L1_error)
           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
           __Pyx_GOTREF(__pyx_t_2);
           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         } else
         #endif
         {
-          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1545, __pyx_L1_error)
+          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1548, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_6);
           __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
           __Pyx_GIVEREF(__pyx_t_3);
           PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
           __pyx_t_3 = 0;
-          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1545, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1548, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_2);
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         }
       }
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1545, __pyx_L1_error)
+      __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1548, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __pyx_r = __pyx_t_7;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -19190,7 +19231,7 @@ static size_t __pyx_f_9pywrapfst_4_Fst_num_input_epsilons(struct __pyx_obj_9pywr
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":1562
+  /* "pywrapfst.pyx":1565
  *     See also: `num_output_epsilons`.
  *     """
  *     cdef size_t result = self._fst.get().NumInputEpsilons(state)             # <<<<<<<<<<<<<<
@@ -19199,11 +19240,11 @@ static size_t __pyx_f_9pywrapfst_4_Fst_num_input_epsilons(struct __pyx_obj_9pywr
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 1562, __pyx_L1_error)
+    __PYX_ERR(0, 1565, __pyx_L1_error)
   }
   __pyx_v_result = __pyx_v_self->_fst.get()->NumInputEpsilons(__pyx_v_state);
 
-  /* "pywrapfst.pyx":1563
+  /* "pywrapfst.pyx":1566
  *     """
  *     cdef size_t result = self._fst.get().NumInputEpsilons(state)
  *     if result == SIZE_MAX:             # <<<<<<<<<<<<<<
@@ -19213,23 +19254,23 @@ static size_t __pyx_f_9pywrapfst_4_Fst_num_input_epsilons(struct __pyx_obj_9pywr
   __pyx_t_8 = ((__pyx_v_result == SIZE_MAX) != 0);
   if (__pyx_t_8) {
 
-    /* "pywrapfst.pyx":1564
+    /* "pywrapfst.pyx":1567
  *     cdef size_t result = self._fst.get().NumInputEpsilons(state)
  *     if result == SIZE_MAX:
  *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
  *     return result
  * 
  */
-    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1564, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1567, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1564, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1567, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 1564, __pyx_L1_error)
+    __PYX_ERR(0, 1567, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":1563
+    /* "pywrapfst.pyx":1566
  *     """
  *     cdef size_t result = self._fst.get().NumInputEpsilons(state)
  *     if result == SIZE_MAX:             # <<<<<<<<<<<<<<
@@ -19238,7 +19279,7 @@ static size_t __pyx_f_9pywrapfst_4_Fst_num_input_epsilons(struct __pyx_obj_9pywr
  */
   }
 
-  /* "pywrapfst.pyx":1565
+  /* "pywrapfst.pyx":1568
  *     if result == SIZE_MAX:
  *       raise FstIndexError("State index out of range")
  *     return result             # <<<<<<<<<<<<<<
@@ -19248,7 +19289,7 @@ static size_t __pyx_f_9pywrapfst_4_Fst_num_input_epsilons(struct __pyx_obj_9pywr
   __pyx_r = __pyx_v_result;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":1545
+  /* "pywrapfst.pyx":1548
  *     return result
  * 
  *   cpdef size_t num_input_epsilons(self, int64 state) except *:             # <<<<<<<<<<<<<<
@@ -19280,7 +19321,7 @@ static PyObject *__pyx_pw_9pywrapfst_4_Fst_25num_input_epsilons(PyObject *__pyx_
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("num_input_epsilons (wrapper)", 0);
   assert(__pyx_arg_state); {
-    __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1545, __pyx_L3_error)
+    __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1548, __pyx_L3_error)
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L3_error:;
@@ -19302,8 +19343,8 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_24num_input_epsilons(struct __pyx_obj
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("num_input_epsilons", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_9pywrapfst_4_Fst_num_input_epsilons(__pyx_v_self, __pyx_v_state, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1545, __pyx_L1_error)
-  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1545, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_9pywrapfst_4_Fst_num_input_epsilons(__pyx_v_self, __pyx_v_state, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1548, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1548, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
@@ -19320,7 +19361,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_24num_input_epsilons(struct __pyx_obj
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":1567
+/* "pywrapfst.pyx":1570
  *     return result
  * 
  *   cpdef size_t num_output_epsilons(self, int64 state) except *:             # <<<<<<<<<<<<<<
@@ -19346,10 +19387,10 @@ static size_t __pyx_f_9pywrapfst_4_Fst_num_output_epsilons(struct __pyx_obj_9pyw
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_output_epsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1567, __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, 1570, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_27num_output_epsilons)) {
-      __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1567, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1570, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_INCREF(__pyx_t_1);
       __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
@@ -19363,14 +19404,14 @@ static size_t __pyx_f_9pywrapfst_4_Fst_num_output_epsilons(struct __pyx_obj_9pyw
         }
       }
       if (!__pyx_t_5) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1567, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1570, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         __Pyx_GOTREF(__pyx_t_2);
       } else {
         #if CYTHON_FAST_PYCALL
         if (PyFunction_Check(__pyx_t_4)) {
           PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
-          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1567, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1570, __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;
@@ -19379,26 +19420,26 @@ static size_t __pyx_f_9pywrapfst_4_Fst_num_output_epsilons(struct __pyx_obj_9pyw
         #if CYTHON_FAST_PYCCALL
         if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
           PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
-          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1567, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1570, __pyx_L1_error)
           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
           __Pyx_GOTREF(__pyx_t_2);
           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         } else
         #endif
         {
-          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1567, __pyx_L1_error)
+          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1570, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_6);
           __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
           __Pyx_GIVEREF(__pyx_t_3);
           PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
           __pyx_t_3 = 0;
-          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1567, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1570, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_2);
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         }
       }
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1567, __pyx_L1_error)
+      __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1570, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __pyx_r = __pyx_t_7;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -19407,7 +19448,7 @@ static size_t __pyx_f_9pywrapfst_4_Fst_num_output_epsilons(struct __pyx_obj_9pyw
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":1584
+  /* "pywrapfst.pyx":1587
  *     See also: `num_input_epsilons`.
  *     """
  *     cdef size_t result = self._fst.get().NumOutputEpsilons(state)             # <<<<<<<<<<<<<<
@@ -19416,11 +19457,11 @@ static size_t __pyx_f_9pywrapfst_4_Fst_num_output_epsilons(struct __pyx_obj_9pyw
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 1584, __pyx_L1_error)
+    __PYX_ERR(0, 1587, __pyx_L1_error)
   }
   __pyx_v_result = __pyx_v_self->_fst.get()->NumOutputEpsilons(__pyx_v_state);
 
-  /* "pywrapfst.pyx":1585
+  /* "pywrapfst.pyx":1588
  *     """
  *     cdef size_t result = self._fst.get().NumOutputEpsilons(state)
  *     if result == SIZE_MAX:             # <<<<<<<<<<<<<<
@@ -19430,23 +19471,23 @@ static size_t __pyx_f_9pywrapfst_4_Fst_num_output_epsilons(struct __pyx_obj_9pyw
   __pyx_t_8 = ((__pyx_v_result == SIZE_MAX) != 0);
   if (__pyx_t_8) {
 
-    /* "pywrapfst.pyx":1586
+    /* "pywrapfst.pyx":1589
  *     cdef size_t result = self._fst.get().NumOutputEpsilons(state)
  *     if result == SIZE_MAX:
  *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
  *     return result
  * 
  */
-    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1586, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1589, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1586, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1589, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 1586, __pyx_L1_error)
+    __PYX_ERR(0, 1589, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":1585
+    /* "pywrapfst.pyx":1588
  *     """
  *     cdef size_t result = self._fst.get().NumOutputEpsilons(state)
  *     if result == SIZE_MAX:             # <<<<<<<<<<<<<<
@@ -19455,7 +19496,7 @@ static size_t __pyx_f_9pywrapfst_4_Fst_num_output_epsilons(struct __pyx_obj_9pyw
  */
   }
 
-  /* "pywrapfst.pyx":1587
+  /* "pywrapfst.pyx":1590
  *     if result == SIZE_MAX:
  *       raise FstIndexError("State index out of range")
  *     return result             # <<<<<<<<<<<<<<
@@ -19465,7 +19506,7 @@ static size_t __pyx_f_9pywrapfst_4_Fst_num_output_epsilons(struct __pyx_obj_9pyw
   __pyx_r = __pyx_v_result;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":1567
+  /* "pywrapfst.pyx":1570
  *     return result
  * 
  *   cpdef size_t num_output_epsilons(self, int64 state) except *:             # <<<<<<<<<<<<<<
@@ -19497,7 +19538,7 @@ static PyObject *__pyx_pw_9pywrapfst_4_Fst_27num_output_epsilons(PyObject *__pyx
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("num_output_epsilons (wrapper)", 0);
   assert(__pyx_arg_state); {
-    __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1567, __pyx_L3_error)
+    __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1570, __pyx_L3_error)
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L3_error:;
@@ -19519,8 +19560,8 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_26num_output_epsilons(struct __pyx_ob
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("num_output_epsilons", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_9pywrapfst_4_Fst_num_output_epsilons(__pyx_v_self, __pyx_v_state, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1567, __pyx_L1_error)
-  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1567, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_9pywrapfst_4_Fst_num_output_epsilons(__pyx_v_self, __pyx_v_state, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1570, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1570, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
@@ -19537,7 +19578,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_26num_output_epsilons(struct __pyx_ob
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":1589
+/* "pywrapfst.pyx":1592
  *     return result
  * 
  *   cpdef _FstSymbolTable output_symbols(self):             # <<<<<<<<<<<<<<
@@ -19559,7 +19600,7 @@ static struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_f_9pywrapfst_4_Fst_out
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_output_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1589, __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, 1592, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_29output_symbols)) {
       __Pyx_XDECREF(((PyObject *)__pyx_r));
@@ -19575,14 +19616,14 @@ static struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_f_9pywrapfst_4_Fst_out
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1589, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1592, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1589, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1592, __pyx_L1_error)
       }
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__FstSymbolTable))))) __PYX_ERR(0, 1589, __pyx_L1_error)
+      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__FstSymbolTable))))) __PYX_ERR(0, 1592, __pyx_L1_error)
       __pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTable *)__pyx_t_2);
       __pyx_t_2 = 0;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -19591,7 +19632,7 @@ static struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_f_9pywrapfst_4_Fst_out
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":1590
+  /* "pywrapfst.pyx":1593
  * 
  *   cpdef _FstSymbolTable output_symbols(self):
  *     if self._fst.get().OutputSymbols() == NULL:             # <<<<<<<<<<<<<<
@@ -19600,12 +19641,12 @@ static struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_f_9pywrapfst_4_Fst_out
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 1590, __pyx_L1_error)
+    __PYX_ERR(0, 1593, __pyx_L1_error)
   }
   __pyx_t_5 = ((__pyx_v_self->_fst.get()->OutputSymbols() == NULL) != 0);
   if (__pyx_t_5) {
 
-    /* "pywrapfst.pyx":1591
+    /* "pywrapfst.pyx":1594
  *   cpdef _FstSymbolTable output_symbols(self):
  *     if self._fst.get().OutputSymbols() == NULL:
  *       return             # <<<<<<<<<<<<<<
@@ -19616,7 +19657,7 @@ static struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_f_9pywrapfst_4_Fst_out
     __pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTable *)Py_None); __Pyx_INCREF(Py_None);
     goto __pyx_L0;
 
-    /* "pywrapfst.pyx":1590
+    /* "pywrapfst.pyx":1593
  * 
  *   cpdef _FstSymbolTable output_symbols(self):
  *     if self._fst.get().OutputSymbols() == NULL:             # <<<<<<<<<<<<<<
@@ -19625,7 +19666,7 @@ static struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_f_9pywrapfst_4_Fst_out
  */
   }
 
-  /* "pywrapfst.pyx":1592
+  /* "pywrapfst.pyx":1595
  *     if self._fst.get().OutputSymbols() == NULL:
  *       return
  *     return _init_FstSymbolTable(const_cast[SymbolTable_ptr](             # <<<<<<<<<<<<<<
@@ -19634,7 +19675,7 @@ static struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_f_9pywrapfst_4_Fst_out
  */
   __Pyx_XDECREF(((PyObject *)__pyx_r));
 
-  /* "pywrapfst.pyx":1593
+  /* "pywrapfst.pyx":1596
  *       return
  *     return _init_FstSymbolTable(const_cast[SymbolTable_ptr](
  *         self._fst.get().OutputSymbols()), self._fst)             # <<<<<<<<<<<<<<
@@ -19643,10 +19684,10 @@ static struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_f_9pywrapfst_4_Fst_out
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 1593, __pyx_L1_error)
+    __PYX_ERR(0, 1596, __pyx_L1_error)
   }
 
-  /* "pywrapfst.pyx":1592
+  /* "pywrapfst.pyx":1595
  *     if self._fst.get().OutputSymbols() == NULL:
  *       return
  *     return _init_FstSymbolTable(const_cast[SymbolTable_ptr](             # <<<<<<<<<<<<<<
@@ -19655,23 +19696,23 @@ static struct __pyx_obj_9pywrapfst__FstSymbolTable *__pyx_f_9pywrapfst_4_Fst_out
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 1593, __pyx_L1_error)
+    __PYX_ERR(0, 1596, __pyx_L1_error)
   }
 
-  /* "pywrapfst.pyx":1593
+  /* "pywrapfst.pyx":1596
  *       return
  *     return _init_FstSymbolTable(const_cast[SymbolTable_ptr](
  *         self._fst.get().OutputSymbols()), self._fst)             # <<<<<<<<<<<<<<
  * 
  *   cpdef uint64 properties(self, uint64 mask, bool test):
  */
-  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_FstSymbolTable(const_cast<__pyx_t_9pywrapfst_SymbolTable_ptr>(__pyx_v_self->_fst.get()->OutputSymbols()), __pyx_v_self->_fst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1592, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_FstSymbolTable(const_cast<__pyx_t_9pywrapfst_SymbolTable_ptr>(__pyx_v_self->_fst.get()->OutputSymbols()), __pyx_v_self->_fst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1595, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTable *)__pyx_t_1);
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":1589
+  /* "pywrapfst.pyx":1592
  *     return result
  * 
  *   cpdef _FstSymbolTable output_symbols(self):             # <<<<<<<<<<<<<<
@@ -19712,7 +19753,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_28output_symbols(struct __pyx_obj_9py
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("output_symbols", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_4_Fst_output_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1589, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_4_Fst_output_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1592, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -19729,7 +19770,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_28output_symbols(struct __pyx_obj_9py
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":1595
+/* "pywrapfst.pyx":1598
  *         self._fst.get().OutputSymbols()), self._fst)
  * 
  *   cpdef uint64 properties(self, uint64 mask, bool test):             # <<<<<<<<<<<<<<
@@ -19755,12 +19796,12 @@ static __pyx_t_10basictypes_uint64 __pyx_f_9pywrapfst_4_Fst_properties(struct __
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_properties); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1595, __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, 1598, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_31properties)) {
-      __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_mask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1595, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyInt_From_uint64_t(__pyx_v_mask); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1598, __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, 1595, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_test); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1598, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_INCREF(__pyx_t_1);
       __pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL;
@@ -19778,7 +19819,7 @@ static __pyx_t_10basictypes_uint64 __pyx_f_9pywrapfst_4_Fst_properties(struct __
       #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, 1595, __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, 1598, __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;
@@ -19788,7 +19829,7 @@ static __pyx_t_10basictypes_uint64 __pyx_f_9pywrapfst_4_Fst_properties(struct __
       #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, 1595, __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, 1598, __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;
@@ -19796,7 +19837,7 @@ static __pyx_t_10basictypes_uint64 __pyx_f_9pywrapfst_4_Fst_properties(struct __
       } else
       #endif
       {
-        __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1595, __pyx_L1_error)
+        __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1598, __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;
@@ -19807,12 +19848,12 @@ static __pyx_t_10basictypes_uint64 __pyx_f_9pywrapfst_4_Fst_properties(struct __
         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, 1595, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1598, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_2);
         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       }
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_9 = __Pyx_PyInt_As_uint64_t(__pyx_t_2); if (unlikely((__pyx_t_9 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1595, __pyx_L1_error)
+      __pyx_t_9 = __Pyx_PyInt_As_uint64_t(__pyx_t_2); if (unlikely((__pyx_t_9 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1598, __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;
@@ -19821,7 +19862,7 @@ static __pyx_t_10basictypes_uint64 __pyx_f_9pywrapfst_4_Fst_properties(struct __
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":1613
+  /* "pywrapfst.pyx":1616
  *       A 64-bit bitmask representing the requested properties.
  *     """
  *     return self._fst.get().Properties(mask, test)             # <<<<<<<<<<<<<<
@@ -19830,12 +19871,12 @@ static __pyx_t_10basictypes_uint64 __pyx_f_9pywrapfst_4_Fst_properties(struct __
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 1613, __pyx_L1_error)
+    __PYX_ERR(0, 1616, __pyx_L1_error)
   }
   __pyx_r = __pyx_v_self->_fst.get()->Properties(__pyx_v_mask, __pyx_v_test);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":1595
+  /* "pywrapfst.pyx":1598
  *         self._fst.get().OutputSymbols()), self._fst)
  * 
  *   cpdef uint64 properties(self, uint64 mask, bool test):             # <<<<<<<<<<<<<<
@@ -19888,11 +19929,11 @@ static PyObject *__pyx_pw_9pywrapfst_4_Fst_31properties(PyObject *__pyx_v_self,
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_test)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("properties", 1, 2, 2, 1); __PYX_ERR(0, 1595, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("properties", 1, 2, 2, 1); __PYX_ERR(0, 1598, __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, 1595, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "properties") < 0)) __PYX_ERR(0, 1598, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -19900,12 +19941,12 @@ static PyObject *__pyx_pw_9pywrapfst_4_Fst_31properties(PyObject *__pyx_v_self,
       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
     }
-    __pyx_v_mask = __Pyx_PyInt_As_uint64_t(values[0]); if (unlikely((__pyx_v_mask == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1595, __pyx_L3_error)
-    __pyx_v_test = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_test == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1595, __pyx_L3_error)
+    __pyx_v_mask = __Pyx_PyInt_As_uint64_t(values[0]); if (unlikely((__pyx_v_mask == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1598, __pyx_L3_error)
+    __pyx_v_test = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_test == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1598, __pyx_L3_error)
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("properties", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1595, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("properties", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1598, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("pywrapfst._Fst.properties", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -19924,7 +19965,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_30properties(struct __pyx_obj_9pywrap
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("properties", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_f_9pywrapfst_4_Fst_properties(__pyx_v_self, __pyx_v_mask, __pyx_v_test, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1595, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyInt_From_uint64_t(__pyx_f_9pywrapfst_4_Fst_properties(__pyx_v_self, __pyx_v_mask, __pyx_v_test, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1598, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -19941,7 +19982,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_30properties(struct __pyx_obj_9pywrap
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":1615
+/* "pywrapfst.pyx":1618
  *     return self._fst.get().Properties(mask, test)
  * 
  *   cpdef int64 start(self):             # <<<<<<<<<<<<<<
@@ -19963,7 +20004,7 @@ static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_4_Fst_start(struct __pyx_ob
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1615, __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, 1618, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_33start)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -19978,14 +20019,14 @@ static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_4_Fst_start(struct __pyx_ob
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1615, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1618, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1615, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1618, __pyx_L1_error)
       }
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1615, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1618, __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;
@@ -19994,7 +20035,7 @@ static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_4_Fst_start(struct __pyx_ob
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":1616
+  /* "pywrapfst.pyx":1619
  * 
  *   cpdef int64 start(self):
  *     return self._fst.get().Start()             # <<<<<<<<<<<<<<
@@ -20003,12 +20044,12 @@ static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_4_Fst_start(struct __pyx_ob
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 1616, __pyx_L1_error)
+    __PYX_ERR(0, 1619, __pyx_L1_error)
   }
   __pyx_r = __pyx_v_self->_fst.get()->Start();
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":1615
+  /* "pywrapfst.pyx":1618
  *     return self._fst.get().Properties(mask, test)
  * 
  *   cpdef int64 start(self):             # <<<<<<<<<<<<<<
@@ -20048,7 +20089,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_32start(struct __pyx_obj_9pywrapfst__
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("start", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_9pywrapfst_4_Fst_start(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1615, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_9pywrapfst_4_Fst_start(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1618, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -20065,7 +20106,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_32start(struct __pyx_obj_9pywrapfst__
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":1618
+/* "pywrapfst.pyx":1621
  *     return self._fst.get().Start()
  * 
  *   cpdef StateIterator states(self):             # <<<<<<<<<<<<<<
@@ -20086,7 +20127,7 @@ static struct __pyx_obj_9pywrapfst_StateIterator *__pyx_f_9pywrapfst_4_Fst_state
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1618, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1621, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_35states)) {
       __Pyx_XDECREF(((PyObject *)__pyx_r));
@@ -20102,14 +20143,14 @@ static struct __pyx_obj_9pywrapfst_StateIterator *__pyx_f_9pywrapfst_4_Fst_state
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1618, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1621, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1618, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1621, __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, 1618, __pyx_L1_error)
+      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_StateIterator))))) __PYX_ERR(0, 1621, __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;
@@ -20118,7 +20159,7 @@ static struct __pyx_obj_9pywrapfst_StateIterator *__pyx_f_9pywrapfst_4_Fst_state
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":1629
+  /* "pywrapfst.pyx":1632
  *     See also: `arcs`, `mutable_arcs`.
  *     """
  *     return StateIterator(self)             # <<<<<<<<<<<<<<
@@ -20126,19 +20167,19 @@ static struct __pyx_obj_9pywrapfst_StateIterator *__pyx_f_9pywrapfst_4_Fst_state
  *   cpdef string text(self, _SymbolTable isymbols=None,
  */
   __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1629, __pyx_L1_error)
+  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1632, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
-  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9pywrapfst_StateIterator), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1629, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9pywrapfst_StateIterator), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1632, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = ((struct __pyx_obj_9pywrapfst_StateIterator *)__pyx_t_2);
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":1618
+  /* "pywrapfst.pyx":1621
  *     return self._fst.get().Start()
  * 
  *   cpdef StateIterator states(self):             # <<<<<<<<<<<<<<
@@ -20180,7 +20221,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_34states(struct __pyx_obj_9pywrapfst_
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("states", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_4_Fst_states(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1618, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_4_Fst_states(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1621, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -20197,7 +20238,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_34states(struct __pyx_obj_9pywrapfst_
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":1631
+/* "pywrapfst.pyx":1634
  *     return StateIterator(self)
  * 
  *   cpdef string text(self, _SymbolTable isymbols=None,             # <<<<<<<<<<<<<<
@@ -20209,7 +20250,7 @@ static PyObject *__pyx_pw_9pywrapfst_4_Fst_37text(PyObject *__pyx_v_self, PyObje
 static std::string __pyx_f_9pywrapfst_4_Fst_text(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_4_Fst_text *__pyx_optional_args) {
   struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_isymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
 
-  /* "pywrapfst.pyx":1632
+  /* "pywrapfst.pyx":1635
  * 
  *   cpdef string text(self, _SymbolTable isymbols=None,
  *       _SymbolTable osymbols=None, _SymbolTable ssymbols=None,             # <<<<<<<<<<<<<<
@@ -20219,7 +20260,7 @@ static std::string __pyx_f_9pywrapfst_4_Fst_text(struct __pyx_obj_9pywrapfst__Fs
   struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
   struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_ssymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
 
-  /* "pywrapfst.pyx":1633
+  /* "pywrapfst.pyx":1636
  *   cpdef string text(self, _SymbolTable isymbols=None,
  *       _SymbolTable osymbols=None, _SymbolTable ssymbols=None,
  *       bool acceptor=False, bool show_weight_one=False, missing_sym=b""):             # <<<<<<<<<<<<<<
@@ -20270,7 +20311,7 @@ static std::string __pyx_f_9pywrapfst_4_Fst_text(struct __pyx_obj_9pywrapfst__Fs
     }
   }
 
-  /* "pywrapfst.pyx":1631
+  /* "pywrapfst.pyx":1634
  *     return StateIterator(self)
  * 
  *   cpdef string text(self, _SymbolTable isymbols=None,             # <<<<<<<<<<<<<<
@@ -20281,12 +20322,12 @@ static std::string __pyx_f_9pywrapfst_4_Fst_text(struct __pyx_obj_9pywrapfst__Fs
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1631, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1634, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_37text)) {
-      __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_acceptor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1631, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_acceptor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1634, __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, 1631, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_show_weight_one); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1634, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_INCREF(__pyx_t_1);
       __pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL;
@@ -20304,7 +20345,7 @@ static std::string __pyx_f_9pywrapfst_4_Fst_text(struct __pyx_obj_9pywrapfst__Fs
       #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, 1631, __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, 1634, __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;
@@ -20314,7 +20355,7 @@ static std::string __pyx_f_9pywrapfst_4_Fst_text(struct __pyx_obj_9pywrapfst__Fs
       #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, 1631, __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, 1634, __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;
@@ -20322,7 +20363,7 @@ static std::string __pyx_f_9pywrapfst_4_Fst_text(struct __pyx_obj_9pywrapfst__Fs
       } else
       #endif
       {
-        __pyx_t_8 = PyTuple_New(6+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1631, __pyx_L1_error)
+        __pyx_t_8 = PyTuple_New(6+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1634, __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;
@@ -20345,12 +20386,12 @@ static std::string __pyx_f_9pywrapfst_4_Fst_text(struct __pyx_obj_9pywrapfst__Fs
         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, 1631, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1634, __pyx_L1_error)
         __Pyx_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, 1631, __pyx_L1_error)
+      __pyx_t_9 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1634, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __pyx_r = __pyx_t_9;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -20359,7 +20400,7 @@ static std::string __pyx_f_9pywrapfst_4_Fst_text(struct __pyx_obj_9pywrapfst__Fs
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":1656
+  /* "pywrapfst.pyx":1659
  *     """
  *     # Prints FST to stringstream, then returns resulting string.
  *     cdef fst.SymbolTable *ssymbols_ptr = NULL             # <<<<<<<<<<<<<<
@@ -20368,7 +20409,7 @@ static std::string __pyx_f_9pywrapfst_4_Fst_text(struct __pyx_obj_9pywrapfst__Fs
  */
   __pyx_v_ssymbols_ptr = NULL;
 
-  /* "pywrapfst.pyx":1657
+  /* "pywrapfst.pyx":1660
  *     # Prints FST to stringstream, then returns resulting string.
  *     cdef fst.SymbolTable *ssymbols_ptr = NULL
  *     if ssymbols is not None:             # <<<<<<<<<<<<<<
@@ -20379,7 +20420,7 @@ static std::string __pyx_f_9pywrapfst_4_Fst_text(struct __pyx_obj_9pywrapfst__Fs
   __pyx_t_11 = (__pyx_t_10 != 0);
   if (__pyx_t_11) {
 
-    /* "pywrapfst.pyx":1658
+    /* "pywrapfst.pyx":1661
  *     cdef fst.SymbolTable *ssymbols_ptr = NULL
  *     if ssymbols is not None:
  *       ssymbols_ptr = ssymbols._table             # <<<<<<<<<<<<<<
@@ -20388,12 +20429,12 @@ static std::string __pyx_f_9pywrapfst_4_Fst_text(struct __pyx_obj_9pywrapfst__Fs
  */
     if (unlikely(((PyObject *)__pyx_v_ssymbols) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
-      __PYX_ERR(0, 1658, __pyx_L1_error)
+      __PYX_ERR(0, 1661, __pyx_L1_error)
     }
     __pyx_t_12 = __pyx_v_ssymbols->_table;
     __pyx_v_ssymbols_ptr = __pyx_t_12;
 
-    /* "pywrapfst.pyx":1657
+    /* "pywrapfst.pyx":1660
  *     # Prints FST to stringstream, then returns resulting string.
  *     cdef fst.SymbolTable *ssymbols_ptr = NULL
  *     if ssymbols is not None:             # <<<<<<<<<<<<<<
@@ -20402,7 +20443,7 @@ static std::string __pyx_f_9pywrapfst_4_Fst_text(struct __pyx_obj_9pywrapfst__Fs
  */
   }
 
-  /* "pywrapfst.pyx":1660
+  /* "pywrapfst.pyx":1663
  *       ssymbols_ptr = ssymbols._table
  *     cdef stringstream sstrm
  *     fst.PrintFst(deref(self._fst), sstrm, "<pywrapfst>",             # <<<<<<<<<<<<<<
@@ -20411,11 +20452,11 @@ static std::string __pyx_f_9pywrapfst_4_Fst_text(struct __pyx_obj_9pywrapfst__Fs
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 1660, __pyx_L1_error)
+    __PYX_ERR(0, 1663, __pyx_L1_error)
   }
-  __pyx_t_9 = __pyx_convert_string_from_py_std__in_string(__pyx_kp_b_pywrapfst); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1660, __pyx_L1_error)
+  __pyx_t_9 = __pyx_convert_string_from_py_std__in_string(__pyx_kp_b_pywrapfst); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1663, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":1661
+  /* "pywrapfst.pyx":1664
  *     cdef stringstream sstrm
  *     fst.PrintFst(deref(self._fst), sstrm, "<pywrapfst>",
  *         self._fst.get().InputSymbols() if isymbols is None             # <<<<<<<<<<<<<<
@@ -20426,12 +20467,12 @@ static std::string __pyx_f_9pywrapfst_4_Fst_text(struct __pyx_obj_9pywrapfst__Fs
   if ((__pyx_t_11 != 0)) {
     if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-      __PYX_ERR(0, 1661, __pyx_L1_error)
+      __PYX_ERR(0, 1664, __pyx_L1_error)
     }
     __pyx_t_13 = __pyx_v_self->_fst.get()->InputSymbols();
   } else {
 
-    /* "pywrapfst.pyx":1662
+    /* "pywrapfst.pyx":1665
  *     fst.PrintFst(deref(self._fst), sstrm, "<pywrapfst>",
  *         self._fst.get().InputSymbols() if isymbols is None
  *         else isymbols._table,             # <<<<<<<<<<<<<<
@@ -20440,12 +20481,12 @@ static std::string __pyx_f_9pywrapfst_4_Fst_text(struct __pyx_obj_9pywrapfst__Fs
  */
     if (unlikely(((PyObject *)__pyx_v_isymbols) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
-      __PYX_ERR(0, 1662, __pyx_L1_error)
+      __PYX_ERR(0, 1665, __pyx_L1_error)
     }
     __pyx_t_13 = __pyx_v_isymbols->_table;
   }
 
-  /* "pywrapfst.pyx":1663
+  /* "pywrapfst.pyx":1666
  *         self._fst.get().InputSymbols() if isymbols is None
  *         else isymbols._table,
  *         self._fst.get().OutputSymbols() if osymbols is None             # <<<<<<<<<<<<<<
@@ -20456,12 +20497,12 @@ static std::string __pyx_f_9pywrapfst_4_Fst_text(struct __pyx_obj_9pywrapfst__Fs
   if ((__pyx_t_11 != 0)) {
     if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-      __PYX_ERR(0, 1663, __pyx_L1_error)
+      __PYX_ERR(0, 1666, __pyx_L1_error)
     }
     __pyx_t_14 = __pyx_v_self->_fst.get()->OutputSymbols();
   } else {
 
-    /* "pywrapfst.pyx":1664
+    /* "pywrapfst.pyx":1667
  *         else isymbols._table,
  *         self._fst.get().OutputSymbols() if osymbols is None
  *         else osymbols._table,             # <<<<<<<<<<<<<<
@@ -20470,21 +20511,21 @@ static std::string __pyx_f_9pywrapfst_4_Fst_text(struct __pyx_obj_9pywrapfst__Fs
  */
     if (unlikely(((PyObject *)__pyx_v_osymbols) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
-      __PYX_ERR(0, 1664, __pyx_L1_error)
+      __PYX_ERR(0, 1667, __pyx_L1_error)
     }
     __pyx_t_14 = __pyx_v_osymbols->_table;
   }
 
-  /* "pywrapfst.pyx":1665
+  /* "pywrapfst.pyx":1668
  *         self._fst.get().OutputSymbols() if osymbols is None
  *         else osymbols._table,
  *         ssymbols_ptr, acceptor, show_weight_one, tostring(missing_sym))             # <<<<<<<<<<<<<<
  *     return sstrm.str()
  * 
  */
-  __pyx_t_15 = __pyx_f_9pywrapfst_tostring(__pyx_v_missing_sym, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1665, __pyx_L1_error)
+  __pyx_t_15 = __pyx_f_9pywrapfst_tostring(__pyx_v_missing_sym, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1668, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":1660
+  /* "pywrapfst.pyx":1663
  *       ssymbols_ptr = ssymbols._table
  *     cdef stringstream sstrm
  *     fst.PrintFst(deref(self._fst), sstrm, "<pywrapfst>",             # <<<<<<<<<<<<<<
@@ -20493,7 +20534,7 @@ static std::string __pyx_f_9pywrapfst_4_Fst_text(struct __pyx_obj_9pywrapfst__Fs
  */
   fst::script::PrintFst((*__pyx_v_self->_fst), __pyx_v_sstrm, __pyx_t_9, __pyx_t_13, __pyx_t_14, __pyx_v_ssymbols_ptr, __pyx_v_acceptor, __pyx_v_show_weight_one, __pyx_t_15);
 
-  /* "pywrapfst.pyx":1666
+  /* "pywrapfst.pyx":1669
  *         else osymbols._table,
  *         ssymbols_ptr, acceptor, show_weight_one, tostring(missing_sym))
  *     return sstrm.str()             # <<<<<<<<<<<<<<
@@ -20503,7 +20544,7 @@ static std::string __pyx_f_9pywrapfst_4_Fst_text(struct __pyx_obj_9pywrapfst__Fs
   __pyx_r = __pyx_v_sstrm.str();
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":1631
+  /* "pywrapfst.pyx":1634
  *     return StateIterator(self)
  * 
  *   cpdef string text(self, _SymbolTable isymbols=None,             # <<<<<<<<<<<<<<
@@ -20544,7 +20585,7 @@ static PyObject *__pyx_pw_9pywrapfst_4_Fst_37text(PyObject *__pyx_v_self, PyObje
     PyObject* values[6] = {0,0,0,0,0,0};
     values[0] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
 
-    /* "pywrapfst.pyx":1632
+    /* "pywrapfst.pyx":1635
  * 
  *   cpdef string text(self, _SymbolTable isymbols=None,
  *       _SymbolTable osymbols=None, _SymbolTable ssymbols=None,             # <<<<<<<<<<<<<<
@@ -20601,7 +20642,7 @@ static PyObject *__pyx_pw_9pywrapfst_4_Fst_37text(PyObject *__pyx_v_self, PyObje
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "text") < 0)) __PYX_ERR(0, 1631, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "text") < 0)) __PYX_ERR(0, 1634, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -20619,10 +20660,10 @@ static PyObject *__pyx_pw_9pywrapfst_4_Fst_37text(PyObject *__pyx_v_self, PyObje
     __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, 1633, __pyx_L3_error)
+      __pyx_v_acceptor = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_acceptor == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1636, __pyx_L3_error)
     } else {
 
-      /* "pywrapfst.pyx":1633
+      /* "pywrapfst.pyx":1636
  *   cpdef string text(self, _SymbolTable isymbols=None,
  *       _SymbolTable osymbols=None, _SymbolTable ssymbols=None,
  *       bool acceptor=False, bool show_weight_one=False, missing_sym=b""):             # <<<<<<<<<<<<<<
@@ -20632,7 +20673,7 @@ static PyObject *__pyx_pw_9pywrapfst_4_Fst_37text(PyObject *__pyx_v_self, PyObje
       __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, 1633, __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, 1636, __pyx_L3_error)
     } else {
       __pyx_v_show_weight_one = ((bool)0);
     }
@@ -20640,18 +20681,18 @@ static PyObject *__pyx_pw_9pywrapfst_4_Fst_37text(PyObject *__pyx_v_self, PyObje
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("text", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1631, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("text", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1634, __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, 1631, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 1632, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 1632, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "isymbols", 0))) __PYX_ERR(0, 1634, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 1635, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 1635, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_4_Fst_36text(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), __pyx_v_isymbols, __pyx_v_osymbols, __pyx_v_ssymbols, __pyx_v_acceptor, __pyx_v_show_weight_one, __pyx_v_missing_sym);
 
-  /* "pywrapfst.pyx":1631
+  /* "pywrapfst.pyx":1634
  *     return StateIterator(self)
  * 
  *   cpdef string text(self, _SymbolTable isymbols=None,             # <<<<<<<<<<<<<<
@@ -20684,7 +20725,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_36text(struct __pyx_obj_9pywrapfst__F
   __pyx_t_2.show_weight_one = __pyx_v_show_weight_one;
   __pyx_t_2.missing_sym = __pyx_v_missing_sym;
   __pyx_t_1 = __pyx_vtabptr_9pywrapfst__Fst->text(__pyx_v_self, 1, &__pyx_t_2); 
-  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1631, __pyx_L1_error)
+  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1634, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
@@ -20701,7 +20742,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_36text(struct __pyx_obj_9pywrapfst__F
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":1668
+/* "pywrapfst.pyx":1671
  *     return sstrm.str()
  * 
  *   cpdef bool verify(self):             # <<<<<<<<<<<<<<
@@ -20723,7 +20764,7 @@ static bool __pyx_f_9pywrapfst_4_Fst_verify(struct __pyx_obj_9pywrapfst__Fst *__
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_verify); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1668, __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, 1671, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_39verify)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -20738,14 +20779,14 @@ static bool __pyx_f_9pywrapfst_4_Fst_verify(struct __pyx_obj_9pywrapfst__Fst *__
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1668, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1671, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1668, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1671, __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, 1668, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1671, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __pyx_r = __pyx_t_5;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -20754,7 +20795,7 @@ static bool __pyx_f_9pywrapfst_4_Fst_verify(struct __pyx_obj_9pywrapfst__Fst *__
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":1677
+  /* "pywrapfst.pyx":1680
  *       True if the contents are sane, False otherwise.
  *     """
  *     return fst.Verify(deref(self._fst))             # <<<<<<<<<<<<<<
@@ -20763,12 +20804,12 @@ static bool __pyx_f_9pywrapfst_4_Fst_verify(struct __pyx_obj_9pywrapfst__Fst *__
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 1677, __pyx_L1_error)
+    __PYX_ERR(0, 1680, __pyx_L1_error)
   }
   __pyx_r = fst::script::Verify((*__pyx_v_self->_fst));
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":1668
+  /* "pywrapfst.pyx":1671
  *     return sstrm.str()
  * 
  *   cpdef bool verify(self):             # <<<<<<<<<<<<<<
@@ -20809,7 +20850,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_38verify(struct __pyx_obj_9pywrapfst_
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("verify", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_4_Fst_verify(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1668, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_4_Fst_verify(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1671, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -20826,7 +20867,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_38verify(struct __pyx_obj_9pywrapfst_
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":1679
+/* "pywrapfst.pyx":1682
  *     return fst.Verify(deref(self._fst))
  * 
  *   cpdef string weight_type(self):             # <<<<<<<<<<<<<<
@@ -20848,7 +20889,7 @@ static std::string __pyx_f_9pywrapfst_4_Fst_weight_type(struct __pyx_obj_9pywrap
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_weight_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1679, __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, 1682, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_41weight_type)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -20863,14 +20904,14 @@ static std::string __pyx_f_9pywrapfst_4_Fst_weight_type(struct __pyx_obj_9pywrap
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1679, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1682, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1679, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1682, __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, 1679, __pyx_L1_error)
+      __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1682, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __pyx_r = __pyx_t_5;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -20879,7 +20920,7 @@ static std::string __pyx_f_9pywrapfst_4_Fst_weight_type(struct __pyx_obj_9pywrap
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":1688
+  /* "pywrapfst.pyx":1691
  *       A string representing the weight type.
  *     """
  *     return self._fst.get().WeightType()             # <<<<<<<<<<<<<<
@@ -20888,12 +20929,12 @@ static std::string __pyx_f_9pywrapfst_4_Fst_weight_type(struct __pyx_obj_9pywrap
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 1688, __pyx_L1_error)
+    __PYX_ERR(0, 1691, __pyx_L1_error)
   }
   __pyx_r = __pyx_v_self->_fst.get()->WeightType();
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":1679
+  /* "pywrapfst.pyx":1682
  *     return fst.Verify(deref(self._fst))
  * 
  *   cpdef string weight_type(self):             # <<<<<<<<<<<<<<
@@ -20933,7 +20974,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_40weight_type(struct __pyx_obj_9pywra
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("weight_type", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_4_Fst_weight_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1679, __pyx_L1_error)
+  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_4_Fst_weight_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1682, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -20950,7 +20991,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_40weight_type(struct __pyx_obj_9pywra
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":1690
+/* "pywrapfst.pyx":1693
  *     return self._fst.get().WeightType()
  * 
  *   cpdef void write(self, filename) except *:             # <<<<<<<<<<<<<<
@@ -20974,7 +21015,7 @@ static void __pyx_f_9pywrapfst_4_Fst_write(struct __pyx_obj_9pywrapfst__Fst *__p
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1690, __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, 1693, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_43write)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -20989,13 +21030,13 @@ static void __pyx_f_9pywrapfst_4_Fst_write(struct __pyx_obj_9pywrapfst__Fst *__p
         }
       }
       if (!__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1690, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_filename); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1693, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_2);
       } else {
         #if CYTHON_FAST_PYCALL
         if (PyFunction_Check(__pyx_t_3)) {
           PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
-          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1690, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1693, __pyx_L1_error)
           __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
           __Pyx_GOTREF(__pyx_t_2);
         } else
@@ -21003,19 +21044,19 @@ static void __pyx_f_9pywrapfst_4_Fst_write(struct __pyx_obj_9pywrapfst__Fst *__p
         #if CYTHON_FAST_PYCCALL
         if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
           PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
-          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1690, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1693, __pyx_L1_error)
           __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
           __Pyx_GOTREF(__pyx_t_2);
         } else
         #endif
         {
-          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1690, __pyx_L1_error)
+          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1693, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_5);
           __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
           __Pyx_INCREF(__pyx_v_filename);
           __Pyx_GIVEREF(__pyx_v_filename);
           PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_filename);
-          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1690, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1693, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_2);
           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
         }
@@ -21028,7 +21069,7 @@ static void __pyx_f_9pywrapfst_4_Fst_write(struct __pyx_obj_9pywrapfst__Fst *__p
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":1704
+  /* "pywrapfst.pyx":1707
  *       FstIOError: Write failed.
  *     """
  *     if not self._fst.get().Write(tostring(filename)):             # <<<<<<<<<<<<<<
@@ -21037,22 +21078,22 @@ static void __pyx_f_9pywrapfst_4_Fst_write(struct __pyx_obj_9pywrapfst__Fst *__p
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 1704, __pyx_L1_error)
+    __PYX_ERR(0, 1707, __pyx_L1_error)
   }
-  __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1704, __pyx_L1_error)
+  __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1707, __pyx_L1_error)
   __pyx_t_7 = ((!(__pyx_v_self->_fst.get()->Write(__pyx_t_6) != 0)) != 0);
   if (__pyx_t_7) {
 
-    /* "pywrapfst.pyx":1705
+    /* "pywrapfst.pyx":1708
  *     """
  *     if not self._fst.get().Write(tostring(filename)):
  *       raise FstIOError("Write failed: {!r}".format(filename))             # <<<<<<<<<<<<<<
  * 
  *   cpdef string WriteToString(self):
  */
-    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1705, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1708, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Write_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1705, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Write_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1708, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __pyx_t_4 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
@@ -21065,13 +21106,13 @@ static void __pyx_f_9pywrapfst_4_Fst_write(struct __pyx_obj_9pywrapfst__Fst *__p
       }
     }
     if (!__pyx_t_4) {
-      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_filename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1705, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_filename); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1708, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
     } else {
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_5)) {
         PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
-        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1705, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1708, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
         __Pyx_GOTREF(__pyx_t_3);
       } else
@@ -21079,19 +21120,19 @@ static void __pyx_f_9pywrapfst_4_Fst_write(struct __pyx_obj_9pywrapfst__Fst *__p
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
         PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
-        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1705, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1708, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
         __Pyx_GOTREF(__pyx_t_3);
       } else
       #endif
       {
-        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1705, __pyx_L1_error)
+        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1708, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
         __Pyx_INCREF(__pyx_v_filename);
         __Pyx_GIVEREF(__pyx_v_filename);
         PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_filename);
-        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1705, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1708, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       }
@@ -21108,14 +21149,14 @@ static void __pyx_f_9pywrapfst_4_Fst_write(struct __pyx_obj_9pywrapfst__Fst *__p
       }
     }
     if (!__pyx_t_5) {
-      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1705, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1708, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_GOTREF(__pyx_t_1);
     } else {
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_2)) {
         PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
-        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1705, __pyx_L1_error)
+        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1708, __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;
@@ -21124,20 +21165,20 @@ static void __pyx_f_9pywrapfst_4_Fst_write(struct __pyx_obj_9pywrapfst__Fst *__p
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
         PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
-        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1705, __pyx_L1_error)
+        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1708, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
         __Pyx_GOTREF(__pyx_t_1);
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       } else
       #endif
       {
-        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1705, __pyx_L1_error)
+        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1708, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
         __Pyx_GIVEREF(__pyx_t_3);
         PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_3);
         __pyx_t_3 = 0;
-        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1705, __pyx_L1_error)
+        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1708, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       }
@@ -21145,9 +21186,9 @@ static void __pyx_f_9pywrapfst_4_Fst_write(struct __pyx_obj_9pywrapfst__Fst *__p
     __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, 1705, __pyx_L1_error)
+    __PYX_ERR(0, 1708, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":1704
+    /* "pywrapfst.pyx":1707
  *       FstIOError: Write failed.
  *     """
  *     if not self._fst.get().Write(tostring(filename)):             # <<<<<<<<<<<<<<
@@ -21156,7 +21197,7 @@ static void __pyx_f_9pywrapfst_4_Fst_write(struct __pyx_obj_9pywrapfst__Fst *__p
  */
   }
 
-  /* "pywrapfst.pyx":1690
+  /* "pywrapfst.pyx":1693
  *     return self._fst.get().WeightType()
  * 
  *   cpdef void write(self, filename) except *:             # <<<<<<<<<<<<<<
@@ -21198,8 +21239,8 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_42write(struct __pyx_obj_9pywrapfst__
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("write", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_f_9pywrapfst_4_Fst_write(__pyx_v_self, __pyx_v_filename, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1690, __pyx_L1_error)
-  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1690, __pyx_L1_error)
+  __pyx_f_9pywrapfst_4_Fst_write(__pyx_v_self, __pyx_v_filename, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1693, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1693, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -21216,7 +21257,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_42write(struct __pyx_obj_9pywrapfst__
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":1707
+/* "pywrapfst.pyx":1710
  *       raise FstIOError("Write failed: {!r}".format(filename))
  * 
  *   cpdef string WriteToString(self):             # <<<<<<<<<<<<<<
@@ -21238,7 +21279,7 @@ static std::string __pyx_f_9pywrapfst_4_Fst_WriteToString(struct __pyx_obj_9pywr
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_WriteToString); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1707, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_WriteToString); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1710, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_4_Fst_45WriteToString)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -21253,14 +21294,14 @@ static std::string __pyx_f_9pywrapfst_4_Fst_WriteToString(struct __pyx_obj_9pywr
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1707, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1710, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1707, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1710, __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, 1707, __pyx_L1_error)
+      __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1710, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __pyx_r = __pyx_t_5;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -21269,7 +21310,7 @@ static std::string __pyx_f_9pywrapfst_4_Fst_WriteToString(struct __pyx_obj_9pywr
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":1708
+  /* "pywrapfst.pyx":1711
  * 
  *   cpdef string WriteToString(self):
  *     return self._fst.get().WriteToString()             # <<<<<<<<<<<<<<
@@ -21278,12 +21319,12 @@ static std::string __pyx_f_9pywrapfst_4_Fst_WriteToString(struct __pyx_obj_9pywr
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 1708, __pyx_L1_error)
+    __PYX_ERR(0, 1711, __pyx_L1_error)
   }
   __pyx_r = __pyx_v_self->_fst.get()->WriteToString();
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":1707
+  /* "pywrapfst.pyx":1710
  *       raise FstIOError("Write failed: {!r}".format(filename))
  * 
  *   cpdef string WriteToString(self):             # <<<<<<<<<<<<<<
@@ -21322,7 +21363,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_44WriteToString(struct __pyx_obj_9pyw
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("WriteToString", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_4_Fst_WriteToString(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1707, __pyx_L1_error)
+  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_4_Fst_WriteToString(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1710, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -21339,7 +21380,7 @@ static PyObject *__pyx_pf_9pywrapfst_4_Fst_44WriteToString(struct __pyx_obj_9pyw
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":1721
+/* "pywrapfst.pyx":1724
  *   """
  * 
  *   cdef void _check_mutating_imethod(self) except *:             # <<<<<<<<<<<<<<
@@ -21354,7 +21395,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__check_mutating_imethod(struct __py
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("_check_mutating_imethod", 0);
 
-  /* "pywrapfst.pyx":1726
+  /* "pywrapfst.pyx":1729
  *     This function is not visible to Python users.
  *     """
  *     if self._fst.get().Properties(fst.kError, True) == fst.kError:             # <<<<<<<<<<<<<<
@@ -21363,28 +21404,28 @@ static void __pyx_f_9pywrapfst_11_MutableFst__check_mutating_imethod(struct __py
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 1726, __pyx_L1_error)
+    __PYX_ERR(0, 1729, __pyx_L1_error)
   }
   __pyx_t_1 = ((__pyx_v_self->__pyx_base._fst.get()->Properties(fst::kError, 1) == fst::kError) != 0);
   if (__pyx_t_1) {
 
-    /* "pywrapfst.pyx":1727
+    /* "pywrapfst.pyx":1730
  *     """
  *     if self._fst.get().Properties(fst.kError, True) == fst.kError:
  *       raise FstOpError("Operation failed")             # <<<<<<<<<<<<<<
  * 
  *   cdef void _add_arc(self, int64 state, Arc arc) except *:
  */
-    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1727, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1730, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1727, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1730, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __PYX_ERR(0, 1727, __pyx_L1_error)
+    __PYX_ERR(0, 1730, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":1726
+    /* "pywrapfst.pyx":1729
  *     This function is not visible to Python users.
  *     """
  *     if self._fst.get().Properties(fst.kError, True) == fst.kError:             # <<<<<<<<<<<<<<
@@ -21393,7 +21434,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__check_mutating_imethod(struct __py
  */
   }
 
-  /* "pywrapfst.pyx":1721
+  /* "pywrapfst.pyx":1724
  *   """
  * 
  *   cdef void _check_mutating_imethod(self) except *:             # <<<<<<<<<<<<<<
@@ -21411,7 +21452,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__check_mutating_imethod(struct __py
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":1729
+/* "pywrapfst.pyx":1732
  *       raise FstOpError("Operation failed")
  * 
  *   cdef void _add_arc(self, int64 state, Arc arc) except *:             # <<<<<<<<<<<<<<
@@ -21426,7 +21467,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__add_arc(struct __pyx_obj_9pywrapfs
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("_add_arc", 0);
 
-  /* "pywrapfst.pyx":1730
+  /* "pywrapfst.pyx":1733
  * 
  *   cdef void _add_arc(self, int64 state, Arc arc) except *:
  *     if not self._fst.get().ValidStateId(state):             # <<<<<<<<<<<<<<
@@ -21435,28 +21476,28 @@ static void __pyx_f_9pywrapfst_11_MutableFst__add_arc(struct __pyx_obj_9pywrapfs
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 1730, __pyx_L1_error)
+    __PYX_ERR(0, 1733, __pyx_L1_error)
   }
   __pyx_t_1 = ((!(__pyx_v_self->__pyx_base._fst.get()->ValidStateId(__pyx_v_state) != 0)) != 0);
   if (__pyx_t_1) {
 
-    /* "pywrapfst.pyx":1731
+    /* "pywrapfst.pyx":1734
  *   cdef void _add_arc(self, int64 state, Arc arc) except *:
  *     if not self._fst.get().ValidStateId(state):
  *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
  *     if not self._mfst.get().AddArc(state, deref(arc._arc)):
  *       raise FstOpError("Incompatible or invalid weight type")
  */
-    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1731, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1734, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1731, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1734, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __PYX_ERR(0, 1731, __pyx_L1_error)
+    __PYX_ERR(0, 1734, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":1730
+    /* "pywrapfst.pyx":1733
  * 
  *   cdef void _add_arc(self, int64 state, Arc arc) except *:
  *     if not self._fst.get().ValidStateId(state):             # <<<<<<<<<<<<<<
@@ -21465,7 +21506,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__add_arc(struct __pyx_obj_9pywrapfs
  */
   }
 
-  /* "pywrapfst.pyx":1732
+  /* "pywrapfst.pyx":1735
  *     if not self._fst.get().ValidStateId(state):
  *       raise FstIndexError("State index out of range")
  *     if not self._mfst.get().AddArc(state, deref(arc._arc)):             # <<<<<<<<<<<<<<
@@ -21474,32 +21515,32 @@ static void __pyx_f_9pywrapfst_11_MutableFst__add_arc(struct __pyx_obj_9pywrapfs
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 1732, __pyx_L1_error)
+    __PYX_ERR(0, 1735, __pyx_L1_error)
   }
   if (unlikely(((PyObject *)__pyx_v_arc) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_arc");
-    __PYX_ERR(0, 1732, __pyx_L1_error)
+    __PYX_ERR(0, 1735, __pyx_L1_error)
   }
   __pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->AddArc(__pyx_v_state, (*__pyx_v_arc->_arc)) != 0)) != 0);
   if (__pyx_t_1) {
 
-    /* "pywrapfst.pyx":1733
+    /* "pywrapfst.pyx":1736
  *       raise FstIndexError("State index out of range")
  *     if not self._mfst.get().AddArc(state, deref(arc._arc)):
  *       raise FstOpError("Incompatible or invalid weight type")             # <<<<<<<<<<<<<<
  *     self._check_mutating_imethod()
  * 
  */
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1733, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1736, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1733, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1736, __pyx_L1_error)
     __Pyx_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, 1733, __pyx_L1_error)
+    __PYX_ERR(0, 1736, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":1732
+    /* "pywrapfst.pyx":1735
  *     if not self._fst.get().ValidStateId(state):
  *       raise FstIndexError("State index out of range")
  *     if not self._mfst.get().AddArc(state, deref(arc._arc)):             # <<<<<<<<<<<<<<
@@ -21508,7 +21549,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__add_arc(struct __pyx_obj_9pywrapfs
  */
   }
 
-  /* "pywrapfst.pyx":1734
+  /* "pywrapfst.pyx":1737
  *     if not self._mfst.get().AddArc(state, deref(arc._arc)):
  *       raise FstOpError("Incompatible or invalid weight type")
  *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
@@ -21517,11 +21558,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__add_arc(struct __pyx_obj_9pywrapfs
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
-    __PYX_ERR(0, 1734, __pyx_L1_error)
+    __PYX_ERR(0, 1737, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1734, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1737, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":1729
+  /* "pywrapfst.pyx":1732
  *       raise FstOpError("Operation failed")
  * 
  *   cdef void _add_arc(self, int64 state, Arc arc) except *:             # <<<<<<<<<<<<<<
@@ -21539,7 +21580,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__add_arc(struct __pyx_obj_9pywrapfs
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":1736
+/* "pywrapfst.pyx":1739
  *     self._check_mutating_imethod()
  * 
  *   def add_arc(self, int64 state, Arc arc):             # <<<<<<<<<<<<<<
@@ -21576,11 +21617,11 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_1add_arc(PyObject *__pyx_v_se
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arc)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("add_arc", 1, 2, 2, 1); __PYX_ERR(0, 1736, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("add_arc", 1, 2, 2, 1); __PYX_ERR(0, 1739, __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, 1736, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_arc") < 0)) __PYX_ERR(0, 1739, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -21588,18 +21629,18 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_1add_arc(PyObject *__pyx_v_se
       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
     }
-    __pyx_v_state = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1736, __pyx_L3_error)
+    __pyx_v_state = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1739, __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, 1736, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("add_arc", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1739, __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, 1736, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arc), __pyx_ptype_9pywrapfst_Arc, 1, "arc", 0))) __PYX_ERR(0, 1739, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_add_arc(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_state, __pyx_v_arc);
 
   /* function exit code */
@@ -21616,7 +21657,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_add_arc(struct __pyx_obj_9pyw
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("add_arc", 0);
 
-  /* "pywrapfst.pyx":1755
+  /* "pywrapfst.pyx":1758
  *     See also: `add_state`.
  *     """
  *     self._add_arc(state, arc)             # <<<<<<<<<<<<<<
@@ -21625,11 +21666,11 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_add_arc(struct __pyx_obj_9pyw
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_add_arc");
-    __PYX_ERR(0, 1755, __pyx_L1_error)
+    __PYX_ERR(0, 1758, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_add_arc(__pyx_v_self, __pyx_v_state, __pyx_v_arc); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1755, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_add_arc(__pyx_v_self, __pyx_v_state, __pyx_v_arc); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1758, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":1756
+  /* "pywrapfst.pyx":1759
  *     """
  *     self._add_arc(state, arc)
  *     return self             # <<<<<<<<<<<<<<
@@ -21641,7 +21682,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_add_arc(struct __pyx_obj_9pyw
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":1736
+  /* "pywrapfst.pyx":1739
  *     self._check_mutating_imethod()
  * 
  *   def add_arc(self, int64 state, Arc arc):             # <<<<<<<<<<<<<<
@@ -21659,7 +21700,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_add_arc(struct __pyx_obj_9pyw
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":1758
+/* "pywrapfst.pyx":1761
  *     return self
  * 
  *   cpdef int64 add_state(self) except *:             # <<<<<<<<<<<<<<
@@ -21682,7 +21723,7 @@ static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_11_MutableFst_add_state(str
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1758, __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, 1761, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_3add_state)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -21697,14 +21738,14 @@ static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_11_MutableFst_add_state(str
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1758, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1761, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1758, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1761, __pyx_L1_error)
       }
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1758, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1761, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __pyx_r = __pyx_t_5;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -21713,7 +21754,7 @@ static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_11_MutableFst_add_state(str
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":1769
+  /* "pywrapfst.pyx":1772
  *     See also: `add_arc`, `set_start`, `set_final`.
  *     """
  *     cdef int64 result = self._mfst.get().AddState()             # <<<<<<<<<<<<<<
@@ -21722,11 +21763,11 @@ static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_11_MutableFst_add_state(str
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 1769, __pyx_L1_error)
+    __PYX_ERR(0, 1772, __pyx_L1_error)
   }
   __pyx_v_result = __pyx_v_self->_mfst.get()->AddState();
 
-  /* "pywrapfst.pyx":1770
+  /* "pywrapfst.pyx":1773
  *     """
  *     cdef int64 result = self._mfst.get().AddState()
  *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
@@ -21735,11 +21776,11 @@ static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_11_MutableFst_add_state(str
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
-    __PYX_ERR(0, 1770, __pyx_L1_error)
+    __PYX_ERR(0, 1773, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1770, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1773, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":1771
+  /* "pywrapfst.pyx":1774
  *     cdef int64 result = self._mfst.get().AddState()
  *     self._check_mutating_imethod()
  *     return result             # <<<<<<<<<<<<<<
@@ -21749,7 +21790,7 @@ static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_11_MutableFst_add_state(str
   __pyx_r = __pyx_v_result;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":1758
+  /* "pywrapfst.pyx":1761
  *     return self
  * 
  *   cpdef int64 add_state(self) except *:             # <<<<<<<<<<<<<<
@@ -21791,8 +21832,8 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_2add_state(struct __pyx_obj_9
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("add_state", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_9pywrapfst_11_MutableFst_add_state(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1758, __pyx_L1_error)
-  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1758, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_9pywrapfst_11_MutableFst_add_state(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1761, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1761, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
@@ -21809,7 +21850,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_2add_state(struct __pyx_obj_9
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":1773
+/* "pywrapfst.pyx":1776
  *     return result
  * 
  *   cdef void _arcsort(self, st=b"ilabel") except *:             # <<<<<<<<<<<<<<
@@ -21837,29 +21878,29 @@ static void __pyx_f_9pywrapfst_11_MutableFst__arcsort(struct __pyx_obj_9pywrapfs
     }
   }
 
-  /* "pywrapfst.pyx":1775
+  /* "pywrapfst.pyx":1778
  *   cdef void _arcsort(self, st=b"ilabel") except *:
  *     cdef fst.ArcSortType sort_type
  *     if not fst.GetArcSortType(tostring(st), addr(sort_type)):             # <<<<<<<<<<<<<<
  *       raise FstArgError("Unknown sort type {!r}".format(sort_type))
  *     fst.ArcSort(self._mfst.get(), sort_type)
  */
-  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_st, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1775, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_st, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1778, __pyx_L1_error)
   __pyx_t_2 = ((!(fst::script::GetArcSortType(__pyx_t_1, (&__pyx_v_sort_type)) != 0)) != 0);
   if (__pyx_t_2) {
 
-    /* "pywrapfst.pyx":1776
+    /* "pywrapfst.pyx":1779
  *     cdef fst.ArcSortType sort_type
  *     if not fst.GetArcSortType(tostring(st), addr(sort_type)):
  *       raise FstArgError("Unknown sort type {!r}".format(sort_type))             # <<<<<<<<<<<<<<
  *     fst.ArcSort(self._mfst.get(), sort_type)
  *     self._check_mutating_imethod()
  */
-    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1776, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1779, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_sort_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1776, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_sort_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1779, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_7 = __Pyx_PyInt_From_enum__fst_3a__3a_script_3a__3a_ArcSortType(__pyx_v_sort_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1776, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyInt_From_enum__fst_3a__3a_script_3a__3a_ArcSortType(__pyx_v_sort_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1779, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     __pyx_t_8 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
@@ -21872,14 +21913,14 @@ static void __pyx_f_9pywrapfst_11_MutableFst__arcsort(struct __pyx_obj_9pywrapfs
       }
     }
     if (!__pyx_t_8) {
-      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1776, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1779, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_GOTREF(__pyx_t_5);
     } else {
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_6)) {
         PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
-        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1776, __pyx_L1_error)
+        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1779, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
@@ -21888,20 +21929,20 @@ static void __pyx_f_9pywrapfst_11_MutableFst__arcsort(struct __pyx_obj_9pywrapfs
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
         PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
-        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1776, __pyx_L1_error)
+        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1779, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
       } else
       #endif
       {
-        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1776, __pyx_L1_error)
+        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1779, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_9);
         __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
         __Pyx_GIVEREF(__pyx_t_7);
         PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
         __pyx_t_7 = 0;
-        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1776, __pyx_L1_error)
+        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1779, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
       }
@@ -21918,14 +21959,14 @@ static void __pyx_f_9pywrapfst_11_MutableFst__arcsort(struct __pyx_obj_9pywrapfs
       }
     }
     if (!__pyx_t_6) {
-      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1776, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1779, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_GOTREF(__pyx_t_3);
     } else {
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_4)) {
         PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
-        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1776, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1779, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -21934,20 +21975,20 @@ static void __pyx_f_9pywrapfst_11_MutableFst__arcsort(struct __pyx_obj_9pywrapfs
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
         PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
-        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1776, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1779, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       } else
       #endif
       {
-        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1776, __pyx_L1_error)
+        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1779, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_9);
         __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
         __Pyx_GIVEREF(__pyx_t_5);
         PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_5);
         __pyx_t_5 = 0;
-        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1776, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1779, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
       }
@@ -21955,9 +21996,9 @@ static void __pyx_f_9pywrapfst_11_MutableFst__arcsort(struct __pyx_obj_9pywrapfs
     __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, 1776, __pyx_L1_error)
+    __PYX_ERR(0, 1779, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":1775
+    /* "pywrapfst.pyx":1778
  *   cdef void _arcsort(self, st=b"ilabel") except *:
  *     cdef fst.ArcSortType sort_type
  *     if not fst.GetArcSortType(tostring(st), addr(sort_type)):             # <<<<<<<<<<<<<<
@@ -21966,7 +22007,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__arcsort(struct __pyx_obj_9pywrapfs
  */
   }
 
-  /* "pywrapfst.pyx":1777
+  /* "pywrapfst.pyx":1780
  *     if not fst.GetArcSortType(tostring(st), addr(sort_type)):
  *       raise FstArgError("Unknown sort type {!r}".format(sort_type))
  *     fst.ArcSort(self._mfst.get(), sort_type)             # <<<<<<<<<<<<<<
@@ -21975,11 +22016,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__arcsort(struct __pyx_obj_9pywrapfs
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 1777, __pyx_L1_error)
+    __PYX_ERR(0, 1780, __pyx_L1_error)
   }
   fst::script::ArcSort(__pyx_v_self->_mfst.get(), __pyx_v_sort_type);
 
-  /* "pywrapfst.pyx":1778
+  /* "pywrapfst.pyx":1781
  *       raise FstArgError("Unknown sort type {!r}".format(sort_type))
  *     fst.ArcSort(self._mfst.get(), sort_type)
  *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
@@ -21988,11 +22029,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__arcsort(struct __pyx_obj_9pywrapfs
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
-    __PYX_ERR(0, 1778, __pyx_L1_error)
+    __PYX_ERR(0, 1781, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1778, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1781, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":1773
+  /* "pywrapfst.pyx":1776
  *     return result
  * 
  *   cdef void _arcsort(self, st=b"ilabel") except *:             # <<<<<<<<<<<<<<
@@ -22015,7 +22056,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__arcsort(struct __pyx_obj_9pywrapfs
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":1780
+/* "pywrapfst.pyx":1783
  *     self._check_mutating_imethod()
  * 
  *   def arcsort(self, st=b"ilabel"):             # <<<<<<<<<<<<<<
@@ -22052,7 +22093,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_5arcsort(PyObject *__pyx_v_se
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arcsort") < 0)) __PYX_ERR(0, 1780, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arcsort") < 0)) __PYX_ERR(0, 1783, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -22065,7 +22106,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_5arcsort(PyObject *__pyx_v_se
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("arcsort", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1780, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("arcsort", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1783, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("pywrapfst._MutableFst.arcsort", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -22084,7 +22125,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_4arcsort(struct __pyx_obj_9py
   struct __pyx_opt_args_9pywrapfst_11_MutableFst__arcsort __pyx_t_1;
   __Pyx_RefNannySetupContext("arcsort", 0);
 
-  /* "pywrapfst.pyx":1801
+  /* "pywrapfst.pyx":1804
  *     See also: `topsort`.
  *     """
  *     self._arcsort(st)             # <<<<<<<<<<<<<<
@@ -22093,13 +22134,13 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_4arcsort(struct __pyx_obj_9py
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_arcsort");
-    __PYX_ERR(0, 1801, __pyx_L1_error)
+    __PYX_ERR(0, 1804, __pyx_L1_error)
   }
   __pyx_t_1.__pyx_n = 1;
   __pyx_t_1.st = __pyx_v_st;
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_arcsort(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1801, __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, 1804, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":1802
+  /* "pywrapfst.pyx":1805
  *     """
  *     self._arcsort(st)
  *     return self             # <<<<<<<<<<<<<<
@@ -22111,7 +22152,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_4arcsort(struct __pyx_obj_9py
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":1780
+  /* "pywrapfst.pyx":1783
  *     self._check_mutating_imethod()
  * 
  *   def arcsort(self, st=b"ilabel"):             # <<<<<<<<<<<<<<
@@ -22129,7 +22170,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_4arcsort(struct __pyx_obj_9py
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":1804
+/* "pywrapfst.pyx":1807
  *     return self
  * 
  *   cdef void _closure(self, bool closure_plus=False) except *:             # <<<<<<<<<<<<<<
@@ -22147,7 +22188,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__closure(struct __pyx_obj_9pywrapfs
     }
   }
 
-  /* "pywrapfst.pyx":1805
+  /* "pywrapfst.pyx":1808
  * 
  *   cdef void _closure(self, bool closure_plus=False) except *:
  *     fst.Closure(self._mfst.get(), fst.GetClosureType(closure_plus))             # <<<<<<<<<<<<<<
@@ -22156,11 +22197,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__closure(struct __pyx_obj_9pywrapfs
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 1805, __pyx_L1_error)
+    __PYX_ERR(0, 1808, __pyx_L1_error)
   }
   fst::script::Closure(__pyx_v_self->_mfst.get(), fst::script::GetClosureType(__pyx_v_closure_plus));
 
-  /* "pywrapfst.pyx":1806
+  /* "pywrapfst.pyx":1809
  *   cdef void _closure(self, bool closure_plus=False) except *:
  *     fst.Closure(self._mfst.get(), fst.GetClosureType(closure_plus))
  *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
@@ -22169,11 +22210,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__closure(struct __pyx_obj_9pywrapfs
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
-    __PYX_ERR(0, 1806, __pyx_L1_error)
+    __PYX_ERR(0, 1809, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1806, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1809, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":1804
+  /* "pywrapfst.pyx":1807
  *     return self
  * 
  *   cdef void _closure(self, bool closure_plus=False) except *:             # <<<<<<<<<<<<<<
@@ -22189,7 +22230,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__closure(struct __pyx_obj_9pywrapfs
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":1808
+/* "pywrapfst.pyx":1811
  *     self._check_mutating_imethod()
  * 
  *   def closure(self, bool closure_plus=False):             # <<<<<<<<<<<<<<
@@ -22225,7 +22266,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_7closure(PyObject *__pyx_v_se
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "closure") < 0)) __PYX_ERR(0, 1808, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "closure") < 0)) __PYX_ERR(0, 1811, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -22235,14 +22276,14 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_7closure(PyObject *__pyx_v_se
       }
     }
     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, 1808, __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, 1811, __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, 1808, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("closure", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1811, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("pywrapfst._MutableFst.closure", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -22261,7 +22302,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_6closure(struct __pyx_obj_9py
   struct __pyx_opt_args_9pywrapfst_11_MutableFst__closure __pyx_t_1;
   __Pyx_RefNannySetupContext("closure", 0);
 
-  /* "pywrapfst.pyx":1826
+  /* "pywrapfst.pyx":1829
  *       self.
  *     """
  *     self._closure(closure_plus)             # <<<<<<<<<<<<<<
@@ -22270,13 +22311,13 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_6closure(struct __pyx_obj_9py
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_closure");
-    __PYX_ERR(0, 1826, __pyx_L1_error)
+    __PYX_ERR(0, 1829, __pyx_L1_error)
   }
   __pyx_t_1.__pyx_n = 1;
   __pyx_t_1.closure_plus = __pyx_v_closure_plus;
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_closure(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1826, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_closure(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1829, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":1827
+  /* "pywrapfst.pyx":1830
  *     """
  *     self._closure(closure_plus)
  *     return self             # <<<<<<<<<<<<<<
@@ -22288,7 +22329,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_6closure(struct __pyx_obj_9py
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":1808
+  /* "pywrapfst.pyx":1811
  *     self._check_mutating_imethod()
  * 
  *   def closure(self, bool closure_plus=False):             # <<<<<<<<<<<<<<
@@ -22306,7 +22347,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_6closure(struct __pyx_obj_9py
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":1829
+/* "pywrapfst.pyx":1832
  *     return self
  * 
  *   cdef void _concat(self, _Fst ifst) except *:             # <<<<<<<<<<<<<<
@@ -22318,7 +22359,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__concat(struct __pyx_obj_9pywrapfst
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_concat", 0);
 
-  /* "pywrapfst.pyx":1830
+  /* "pywrapfst.pyx":1833
  * 
  *   cdef void _concat(self, _Fst ifst) except *:
  *     fst.Concat(self._mfst.get(), deref(ifst._fst))             # <<<<<<<<<<<<<<
@@ -22327,15 +22368,15 @@ static void __pyx_f_9pywrapfst_11_MutableFst__concat(struct __pyx_obj_9pywrapfst
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 1830, __pyx_L1_error)
+    __PYX_ERR(0, 1833, __pyx_L1_error)
   }
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 1830, __pyx_L1_error)
+    __PYX_ERR(0, 1833, __pyx_L1_error)
   }
   fst::script::Concat(__pyx_v_self->_mfst.get(), (*__pyx_v_ifst->_fst));
 
-  /* "pywrapfst.pyx":1831
+  /* "pywrapfst.pyx":1834
  *   cdef void _concat(self, _Fst ifst) except *:
  *     fst.Concat(self._mfst.get(), deref(ifst._fst))
  *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
@@ -22344,11 +22385,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__concat(struct __pyx_obj_9pywrapfst
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
-    __PYX_ERR(0, 1831, __pyx_L1_error)
+    __PYX_ERR(0, 1834, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1831, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1834, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":1829
+  /* "pywrapfst.pyx":1832
  *     return self
  * 
  *   cdef void _concat(self, _Fst ifst) except *:             # <<<<<<<<<<<<<<
@@ -22364,7 +22405,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__concat(struct __pyx_obj_9pywrapfst
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":1833
+/* "pywrapfst.pyx":1836
  *     self._check_mutating_imethod()
  * 
  *   def concat(self, _Fst ifst):             # <<<<<<<<<<<<<<
@@ -22379,7 +22420,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_9concat(PyObject *__pyx_v_sel
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("concat (wrapper)", 0);
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 1833, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 1836, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_8concat(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_ifst));
 
   /* function exit code */
@@ -22396,7 +22437,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_8concat(struct __pyx_obj_9pyw
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("concat", 0);
 
-  /* "pywrapfst.pyx":1850
+  /* "pywrapfst.pyx":1853
  *       self.
  *     """
  *     self._concat(ifst)             # <<<<<<<<<<<<<<
@@ -22405,11 +22446,11 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_8concat(struct __pyx_obj_9pyw
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_concat");
-    __PYX_ERR(0, 1850, __pyx_L1_error)
+    __PYX_ERR(0, 1853, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_concat(__pyx_v_self, __pyx_v_ifst); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1850, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_concat(__pyx_v_self, __pyx_v_ifst); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1853, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":1851
+  /* "pywrapfst.pyx":1854
  *     """
  *     self._concat(ifst)
  *     return self             # <<<<<<<<<<<<<<
@@ -22421,7 +22462,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_8concat(struct __pyx_obj_9pyw
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":1833
+  /* "pywrapfst.pyx":1836
  *     self._check_mutating_imethod()
  * 
  *   def concat(self, _Fst ifst):             # <<<<<<<<<<<<<<
@@ -22439,7 +22480,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_8concat(struct __pyx_obj_9pyw
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":1853
+/* "pywrapfst.pyx":1856
  *     return self
  * 
  *   cdef void _connect(self) except *:             # <<<<<<<<<<<<<<
@@ -22451,7 +22492,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__connect(struct __pyx_obj_9pywrapfs
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_connect", 0);
 
-  /* "pywrapfst.pyx":1854
+  /* "pywrapfst.pyx":1857
  * 
  *   cdef void _connect(self) except *:
  *     fst.Connect(self._mfst.get())             # <<<<<<<<<<<<<<
@@ -22460,11 +22501,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__connect(struct __pyx_obj_9pywrapfs
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 1854, __pyx_L1_error)
+    __PYX_ERR(0, 1857, __pyx_L1_error)
   }
   fst::script::Connect(__pyx_v_self->_mfst.get());
 
-  /* "pywrapfst.pyx":1855
+  /* "pywrapfst.pyx":1858
  *   cdef void _connect(self) except *:
  *     fst.Connect(self._mfst.get())
  *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
@@ -22473,11 +22514,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__connect(struct __pyx_obj_9pywrapfs
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
-    __PYX_ERR(0, 1855, __pyx_L1_error)
+    __PYX_ERR(0, 1858, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1855, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1858, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":1853
+  /* "pywrapfst.pyx":1856
  *     return self
  * 
  *   cdef void _connect(self) except *:             # <<<<<<<<<<<<<<
@@ -22493,7 +22534,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__connect(struct __pyx_obj_9pywrapfs
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":1857
+/* "pywrapfst.pyx":1860
  *     self._check_mutating_imethod()
  * 
  *   def connect(self):             # <<<<<<<<<<<<<<
@@ -22520,7 +22561,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_10connect(struct __pyx_obj_9p
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("connect", 0);
 
-  /* "pywrapfst.pyx":1869
+  /* "pywrapfst.pyx":1872
  *       self.
  *     """
  *     self._connect()             # <<<<<<<<<<<<<<
@@ -22529,11 +22570,11 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_10connect(struct __pyx_obj_9p
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_connect");
-    __PYX_ERR(0, 1869, __pyx_L1_error)
+    __PYX_ERR(0, 1872, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_connect(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1869, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_connect(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1872, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":1870
+  /* "pywrapfst.pyx":1873
  *     """
  *     self._connect()
  *     return self             # <<<<<<<<<<<<<<
@@ -22545,7 +22586,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_10connect(struct __pyx_obj_9p
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":1857
+  /* "pywrapfst.pyx":1860
  *     self._check_mutating_imethod()
  * 
  *   def connect(self):             # <<<<<<<<<<<<<<
@@ -22563,7 +22604,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_10connect(struct __pyx_obj_9p
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":1872
+/* "pywrapfst.pyx":1875
  *     return self
  * 
  *   cdef void _decode(self, EncodeMapper encoder) except *:             # <<<<<<<<<<<<<<
@@ -22575,7 +22616,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__decode(struct __pyx_obj_9pywrapfst
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_decode", 0);
 
-  /* "pywrapfst.pyx":1873
+  /* "pywrapfst.pyx":1876
  * 
  *   cdef void _decode(self, EncodeMapper encoder) except *:
  *     fst.Decode(self._mfst.get(), deref(encoder._encoder))             # <<<<<<<<<<<<<<
@@ -22584,15 +22625,15 @@ static void __pyx_f_9pywrapfst_11_MutableFst__decode(struct __pyx_obj_9pywrapfst
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 1873, __pyx_L1_error)
+    __PYX_ERR(0, 1876, __pyx_L1_error)
   }
   if (unlikely(((PyObject *)__pyx_v_encoder) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_encoder");
-    __PYX_ERR(0, 1873, __pyx_L1_error)
+    __PYX_ERR(0, 1876, __pyx_L1_error)
   }
   fst::script::Decode(__pyx_v_self->_mfst.get(), (*__pyx_v_encoder->_encoder));
 
-  /* "pywrapfst.pyx":1874
+  /* "pywrapfst.pyx":1877
  *   cdef void _decode(self, EncodeMapper encoder) except *:
  *     fst.Decode(self._mfst.get(), deref(encoder._encoder))
  *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
@@ -22601,11 +22642,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__decode(struct __pyx_obj_9pywrapfst
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
-    __PYX_ERR(0, 1874, __pyx_L1_error)
+    __PYX_ERR(0, 1877, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1874, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1877, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":1872
+  /* "pywrapfst.pyx":1875
  *     return self
  * 
  *   cdef void _decode(self, EncodeMapper encoder) except *:             # <<<<<<<<<<<<<<
@@ -22621,7 +22662,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__decode(struct __pyx_obj_9pywrapfst
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":1876
+/* "pywrapfst.pyx":1879
  *     self._check_mutating_imethod()
  * 
  *   def decode(self, EncodeMapper encoder):             # <<<<<<<<<<<<<<
@@ -22636,7 +22677,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_13decode(PyObject *__pyx_v_se
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("decode (wrapper)", 0);
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoder), __pyx_ptype_9pywrapfst_EncodeMapper, 1, "encoder", 0))) __PYX_ERR(0, 1876, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoder), __pyx_ptype_9pywrapfst_EncodeMapper, 1, "encoder", 0))) __PYX_ERR(0, 1879, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_12decode(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_encoder));
 
   /* function exit code */
@@ -22653,7 +22694,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_12decode(struct __pyx_obj_9py
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("decode", 0);
 
-  /* "pywrapfst.pyx":1892
+  /* "pywrapfst.pyx":1895
  *     See also: `encode`.
  *     """
  *     self._decode(encoder)             # <<<<<<<<<<<<<<
@@ -22662,11 +22703,11 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_12decode(struct __pyx_obj_9py
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_decode");
-    __PYX_ERR(0, 1892, __pyx_L1_error)
+    __PYX_ERR(0, 1895, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_decode(__pyx_v_self, __pyx_v_encoder); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1892, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_decode(__pyx_v_self, __pyx_v_encoder); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1895, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":1893
+  /* "pywrapfst.pyx":1896
  *     """
  *     self._decode(encoder)
  *     return self             # <<<<<<<<<<<<<<
@@ -22678,7 +22719,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_12decode(struct __pyx_obj_9py
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":1876
+  /* "pywrapfst.pyx":1879
  *     self._check_mutating_imethod()
  * 
  *   def decode(self, EncodeMapper encoder):             # <<<<<<<<<<<<<<
@@ -22696,7 +22737,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_12decode(struct __pyx_obj_9py
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":1895
+/* "pywrapfst.pyx":1898
  *     return self
  * 
  *   cdef void _delete_arcs(self, int64 state, size_t n=0) except *:             # <<<<<<<<<<<<<<
@@ -22718,7 +22759,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__delete_arcs(struct __pyx_obj_9pywr
     }
   }
 
-  /* "pywrapfst.pyx":1896
+  /* "pywrapfst.pyx":1899
  * 
  *   cdef void _delete_arcs(self, int64 state, size_t n=0) except *:
  *     if not (self._mfst.get().DeleteArcs(state, n) if n else             # <<<<<<<<<<<<<<
@@ -22728,12 +22769,12 @@ static void __pyx_f_9pywrapfst_11_MutableFst__delete_arcs(struct __pyx_obj_9pywr
   if ((__pyx_v_n != 0)) {
     if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-      __PYX_ERR(0, 1896, __pyx_L1_error)
+      __PYX_ERR(0, 1899, __pyx_L1_error)
     }
     __pyx_t_1 = __pyx_v_self->_mfst.get()->DeleteArcs(__pyx_v_state, __pyx_v_n);
   } else {
 
-    /* "pywrapfst.pyx":1897
+    /* "pywrapfst.pyx":1900
  *   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)):             # <<<<<<<<<<<<<<
@@ -22742,12 +22783,12 @@ static void __pyx_f_9pywrapfst_11_MutableFst__delete_arcs(struct __pyx_obj_9pywr
  */
     if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-      __PYX_ERR(0, 1897, __pyx_L1_error)
+      __PYX_ERR(0, 1900, __pyx_L1_error)
     }
     __pyx_t_1 = __pyx_v_self->_mfst.get()->DeleteArcs(__pyx_v_state);
   }
 
-  /* "pywrapfst.pyx":1896
+  /* "pywrapfst.pyx":1899
  * 
  *   cdef void _delete_arcs(self, int64 state, size_t n=0) except *:
  *     if not (self._mfst.get().DeleteArcs(state, n) if n else             # <<<<<<<<<<<<<<
@@ -22757,23 +22798,23 @@ static void __pyx_f_9pywrapfst_11_MutableFst__delete_arcs(struct __pyx_obj_9pywr
   __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
   if (__pyx_t_2) {
 
-    /* "pywrapfst.pyx":1898
+    /* "pywrapfst.pyx":1901
  *     if not (self._mfst.get().DeleteArcs(state, n) if n else
  *             self._mfst.get().DeleteArcs(state)):
  *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
  *     self._check_mutating_imethod()
  * 
  */
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1898, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1901, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1898, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1901, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_Raise(__pyx_t_4, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __PYX_ERR(0, 1898, __pyx_L1_error)
+    __PYX_ERR(0, 1901, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":1896
+    /* "pywrapfst.pyx":1899
  * 
  *   cdef void _delete_arcs(self, int64 state, size_t n=0) except *:
  *     if not (self._mfst.get().DeleteArcs(state, n) if n else             # <<<<<<<<<<<<<<
@@ -22782,7 +22823,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__delete_arcs(struct __pyx_obj_9pywr
  */
   }
 
-  /* "pywrapfst.pyx":1899
+  /* "pywrapfst.pyx":1902
  *             self._mfst.get().DeleteArcs(state)):
  *       raise FstIndexError("State index out of range")
  *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
@@ -22791,11 +22832,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__delete_arcs(struct __pyx_obj_9pywr
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
-    __PYX_ERR(0, 1899, __pyx_L1_error)
+    __PYX_ERR(0, 1902, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1899, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1902, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":1895
+  /* "pywrapfst.pyx":1898
  *     return self
  * 
  *   cdef void _delete_arcs(self, int64 state, size_t n=0) except *:             # <<<<<<<<<<<<<<
@@ -22813,7 +22854,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__delete_arcs(struct __pyx_obj_9pywr
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":1901
+/* "pywrapfst.pyx":1904
  *     self._check_mutating_imethod()
  * 
  *   def delete_arcs(self, int64 state, size_t n=0):             # <<<<<<<<<<<<<<
@@ -22854,7 +22895,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_15delete_arcs(PyObject *__pyx
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete_arcs") < 0)) __PYX_ERR(0, 1901, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete_arcs") < 0)) __PYX_ERR(0, 1904, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -22864,16 +22905,16 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_15delete_arcs(PyObject *__pyx
         default: goto __pyx_L5_argtuple_error;
       }
     }
-    __pyx_v_state = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1901, __pyx_L3_error)
+    __pyx_v_state = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1904, __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, 1901, __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, 1904, __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, 1901, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("delete_arcs", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1904, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("pywrapfst._MutableFst.delete_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -22892,7 +22933,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_14delete_arcs(struct __pyx_ob
   struct __pyx_opt_args_9pywrapfst_11_MutableFst__delete_arcs __pyx_t_1;
   __Pyx_RefNannySetupContext("delete_arcs", 0);
 
-  /* "pywrapfst.pyx":1921
+  /* "pywrapfst.pyx":1924
  *     See also: `delete_states`.
  *     """
  *     self._delete_arcs(state, n)             # <<<<<<<<<<<<<<
@@ -22901,13 +22942,13 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_14delete_arcs(struct __pyx_ob
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_delete_arcs");
-    __PYX_ERR(0, 1921, __pyx_L1_error)
+    __PYX_ERR(0, 1924, __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, 1921, __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, 1924, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":1922
+  /* "pywrapfst.pyx":1925
  *     """
  *     self._delete_arcs(state, n)
  *     return self             # <<<<<<<<<<<<<<
@@ -22919,7 +22960,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_14delete_arcs(struct __pyx_ob
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":1901
+  /* "pywrapfst.pyx":1904
  *     self._check_mutating_imethod()
  * 
  *   def delete_arcs(self, int64 state, size_t n=0):             # <<<<<<<<<<<<<<
@@ -22937,7 +22978,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_14delete_arcs(struct __pyx_ob
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":1924
+/* "pywrapfst.pyx":1927
  *     return self
  * 
  *   cdef void _delete_states(self, states=None) except *:             # <<<<<<<<<<<<<<
@@ -22959,17 +23000,17 @@ static void __pyx_f_9pywrapfst_11_MutableFst__delete_states(struct __pyx_obj_9py
     }
   }
 
-  /* "pywrapfst.pyx":1926
+  /* "pywrapfst.pyx":1929
  *   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, 1926, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_states); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1929, __pyx_L1_error)
   if (__pyx_t_1) {
 
-    /* "pywrapfst.pyx":1927
+    /* "pywrapfst.pyx":1930
  *     # Only the former signature has a possible indexing failure.
  *     if states:
  *       if not self._mfst.get().DeleteStates(<const vector[int64]> states):             # <<<<<<<<<<<<<<
@@ -22978,29 +23019,29 @@ static void __pyx_f_9pywrapfst_11_MutableFst__delete_states(struct __pyx_obj_9py
  */
     if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-      __PYX_ERR(0, 1927, __pyx_L1_error)
+      __PYX_ERR(0, 1930, __pyx_L1_error)
     }
-    __pyx_t_2 = __pyx_convert_vector_from_py___pyx_t_10basictypes_int64(__pyx_v_states); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1927, __pyx_L1_error)
+    __pyx_t_2 = __pyx_convert_vector_from_py___pyx_t_10basictypes_int64(__pyx_v_states); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1930, __pyx_L1_error)
     __pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->DeleteStates(((std::vector<__pyx_t_10basictypes_int64>  const )__pyx_t_2)) != 0)) != 0);
     if (__pyx_t_1) {
 
-      /* "pywrapfst.pyx":1928
+      /* "pywrapfst.pyx":1931
  *     if states:
  *       if not self._mfst.get().DeleteStates(<const vector[int64]> states):
  *         raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
  *     else:
  *       self._mfst.get().DeleteStates()
  */
-      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1928, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1931, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1928, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1931, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_Raise(__pyx_t_4, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __PYX_ERR(0, 1928, __pyx_L1_error)
+      __PYX_ERR(0, 1931, __pyx_L1_error)
 
-      /* "pywrapfst.pyx":1927
+      /* "pywrapfst.pyx":1930
  *     # Only the former signature has a possible indexing failure.
  *     if states:
  *       if not self._mfst.get().DeleteStates(<const vector[int64]> states):             # <<<<<<<<<<<<<<
@@ -23009,7 +23050,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__delete_states(struct __pyx_obj_9py
  */
     }
 
-    /* "pywrapfst.pyx":1926
+    /* "pywrapfst.pyx":1929
  *   cdef void _delete_states(self, states=None) except *:
  *     # Only the former signature has a possible indexing failure.
  *     if states:             # <<<<<<<<<<<<<<
@@ -23019,7 +23060,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__delete_states(struct __pyx_obj_9py
     goto __pyx_L3;
   }
 
-  /* "pywrapfst.pyx":1930
+  /* "pywrapfst.pyx":1933
  *         raise FstIndexError("State index out of range")
  *     else:
  *       self._mfst.get().DeleteStates()             # <<<<<<<<<<<<<<
@@ -23029,13 +23070,13 @@ static void __pyx_f_9pywrapfst_11_MutableFst__delete_states(struct __pyx_obj_9py
   /*else*/ {
     if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-      __PYX_ERR(0, 1930, __pyx_L1_error)
+      __PYX_ERR(0, 1933, __pyx_L1_error)
     }
     __pyx_v_self->_mfst.get()->DeleteStates();
   }
   __pyx_L3:;
 
-  /* "pywrapfst.pyx":1931
+  /* "pywrapfst.pyx":1934
  *     else:
  *       self._mfst.get().DeleteStates()
  *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
@@ -23044,11 +23085,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__delete_states(struct __pyx_obj_9py
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
-    __PYX_ERR(0, 1931, __pyx_L1_error)
+    __PYX_ERR(0, 1934, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1931, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1934, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":1924
+  /* "pywrapfst.pyx":1927
  *     return self
  * 
  *   cdef void _delete_states(self, states=None) except *:             # <<<<<<<<<<<<<<
@@ -23066,7 +23107,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__delete_states(struct __pyx_obj_9py
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":1933
+/* "pywrapfst.pyx":1936
  *     self._check_mutating_imethod()
  * 
  *   def delete_states(self, states=None):             # <<<<<<<<<<<<<<
@@ -23103,7 +23144,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_17delete_states(PyObject *__p
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete_states") < 0)) __PYX_ERR(0, 1933, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "delete_states") < 0)) __PYX_ERR(0, 1936, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -23116,7 +23157,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_17delete_states(PyObject *__p
   }
   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, 1933, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("delete_states", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1936, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("pywrapfst._MutableFst.delete_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -23135,7 +23176,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_16delete_states(struct __pyx_
   struct __pyx_opt_args_9pywrapfst_11_MutableFst__delete_states __pyx_t_1;
   __Pyx_RefNannySetupContext("delete_states", 0);
 
-  /* "pywrapfst.pyx":1951
+  /* "pywrapfst.pyx":1954
  *     See also: `delete_arcs`.
  *     """
  *     self._delete_states(states)             # <<<<<<<<<<<<<<
@@ -23144,13 +23185,13 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_16delete_states(struct __pyx_
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_delete_states");
-    __PYX_ERR(0, 1951, __pyx_L1_error)
+    __PYX_ERR(0, 1954, __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, 1951, __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, 1954, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":1952
+  /* "pywrapfst.pyx":1955
  *     """
  *     self._delete_states(states)
  *     return self             # <<<<<<<<<<<<<<
@@ -23162,7 +23203,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_16delete_states(struct __pyx_
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":1933
+  /* "pywrapfst.pyx":1936
  *     self._check_mutating_imethod()
  * 
  *   def delete_states(self, states=None):             # <<<<<<<<<<<<<<
@@ -23180,7 +23221,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_16delete_states(struct __pyx_
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":1954
+/* "pywrapfst.pyx":1957
  *     return self
  * 
  *   cdef void _encode(self, EncodeMapper encoder) except *:             # <<<<<<<<<<<<<<
@@ -23192,7 +23233,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__encode(struct __pyx_obj_9pywrapfst
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_encode", 0);
 
-  /* "pywrapfst.pyx":1955
+  /* "pywrapfst.pyx":1958
  * 
  *   cdef void _encode(self, EncodeMapper encoder) except *:
  *     fst.Encode(self._mfst.get(), encoder._encoder.get())             # <<<<<<<<<<<<<<
@@ -23201,15 +23242,15 @@ static void __pyx_f_9pywrapfst_11_MutableFst__encode(struct __pyx_obj_9pywrapfst
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 1955, __pyx_L1_error)
+    __PYX_ERR(0, 1958, __pyx_L1_error)
   }
   if (unlikely(((PyObject *)__pyx_v_encoder) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_encoder");
-    __PYX_ERR(0, 1955, __pyx_L1_error)
+    __PYX_ERR(0, 1958, __pyx_L1_error)
   }
   fst::script::Encode(__pyx_v_self->_mfst.get(), __pyx_v_encoder->_encoder.get());
 
-  /* "pywrapfst.pyx":1956
+  /* "pywrapfst.pyx":1959
  *   cdef void _encode(self, EncodeMapper encoder) except *:
  *     fst.Encode(self._mfst.get(), encoder._encoder.get())
  *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
@@ -23218,11 +23259,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__encode(struct __pyx_obj_9pywrapfst
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
-    __PYX_ERR(0, 1956, __pyx_L1_error)
+    __PYX_ERR(0, 1959, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1956, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1959, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":1954
+  /* "pywrapfst.pyx":1957
  *     return self
  * 
  *   cdef void _encode(self, EncodeMapper encoder) except *:             # <<<<<<<<<<<<<<
@@ -23238,7 +23279,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__encode(struct __pyx_obj_9pywrapfst
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":1958
+/* "pywrapfst.pyx":1961
  *     self._check_mutating_imethod()
  * 
  *   def encode(self, EncodeMapper encoder):             # <<<<<<<<<<<<<<
@@ -23253,7 +23294,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_19encode(PyObject *__pyx_v_se
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("encode (wrapper)", 0);
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoder), __pyx_ptype_9pywrapfst_EncodeMapper, 1, "encoder", 0))) __PYX_ERR(0, 1958, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoder), __pyx_ptype_9pywrapfst_EncodeMapper, 1, "encoder", 0))) __PYX_ERR(0, 1961, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_18encode(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_encoder));
 
   /* function exit code */
@@ -23270,7 +23311,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_18encode(struct __pyx_obj_9py
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("encode", 0);
 
-  /* "pywrapfst.pyx":1979
+  /* "pywrapfst.pyx":1982
  *     See also: `decode`.
  *     """
  *     self._encode(encoder)             # <<<<<<<<<<<<<<
@@ -23279,11 +23320,11 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_18encode(struct __pyx_obj_9py
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_encode");
-    __PYX_ERR(0, 1979, __pyx_L1_error)
+    __PYX_ERR(0, 1982, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_encode(__pyx_v_self, __pyx_v_encoder); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1979, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_encode(__pyx_v_self, __pyx_v_encoder); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1982, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":1980
+  /* "pywrapfst.pyx":1983
  *     """
  *     self._encode(encoder)
  *     return self             # <<<<<<<<<<<<<<
@@ -23295,7 +23336,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_18encode(struct __pyx_obj_9py
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":1958
+  /* "pywrapfst.pyx":1961
  *     self._check_mutating_imethod()
  * 
  *   def encode(self, EncodeMapper encoder):             # <<<<<<<<<<<<<<
@@ -23313,7 +23354,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_18encode(struct __pyx_obj_9py
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":1982
+/* "pywrapfst.pyx":1985
  *     return self
  * 
  *   cdef void _invert(self) except *:             # <<<<<<<<<<<<<<
@@ -23325,7 +23366,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__invert(struct __pyx_obj_9pywrapfst
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_invert", 0);
 
-  /* "pywrapfst.pyx":1983
+  /* "pywrapfst.pyx":1986
  * 
  *   cdef void _invert(self) except *:
  *     fst.Invert(self._mfst.get())             # <<<<<<<<<<<<<<
@@ -23334,11 +23375,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__invert(struct __pyx_obj_9pywrapfst
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 1983, __pyx_L1_error)
+    __PYX_ERR(0, 1986, __pyx_L1_error)
   }
   fst::script::Invert(__pyx_v_self->_mfst.get());
 
-  /* "pywrapfst.pyx":1984
+  /* "pywrapfst.pyx":1987
  *   cdef void _invert(self) except *:
  *     fst.Invert(self._mfst.get())
  *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
@@ -23347,11 +23388,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__invert(struct __pyx_obj_9pywrapfst
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
-    __PYX_ERR(0, 1984, __pyx_L1_error)
+    __PYX_ERR(0, 1987, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1984, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1987, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":1982
+  /* "pywrapfst.pyx":1985
  *     return self
  * 
  *   cdef void _invert(self) except *:             # <<<<<<<<<<<<<<
@@ -23367,7 +23408,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__invert(struct __pyx_obj_9pywrapfst
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":1986
+/* "pywrapfst.pyx":1989
  *     self._check_mutating_imethod()
  * 
  *   def invert(self):             # <<<<<<<<<<<<<<
@@ -23394,7 +23435,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_20invert(struct __pyx_obj_9py
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("invert", 0);
 
-  /* "pywrapfst.pyx":1998
+  /* "pywrapfst.pyx":2001
  *       self.
  *     """
  *     self._invert()             # <<<<<<<<<<<<<<
@@ -23403,11 +23444,11 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_20invert(struct __pyx_obj_9py
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_invert");
-    __PYX_ERR(0, 1998, __pyx_L1_error)
+    __PYX_ERR(0, 2001, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_invert(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1998, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_invert(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2001, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":1999
+  /* "pywrapfst.pyx":2002
  *     """
  *     self._invert()
  *     return self             # <<<<<<<<<<<<<<
@@ -23419,7 +23460,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_20invert(struct __pyx_obj_9py
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":1986
+  /* "pywrapfst.pyx":1989
  *     self._check_mutating_imethod()
  * 
  *   def invert(self):             # <<<<<<<<<<<<<<
@@ -23437,7 +23478,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_20invert(struct __pyx_obj_9py
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2001
+/* "pywrapfst.pyx":2004
  *     return self
  * 
  *   cdef void _minimize(self, float delta=fst.kDelta,             # <<<<<<<<<<<<<<
@@ -23448,7 +23489,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_20invert(struct __pyx_obj_9py
 static void __pyx_f_9pywrapfst_11_MutableFst__minimize(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__minimize *__pyx_optional_args) {
   float __pyx_v_delta = __pyx_k__11;
 
-  /* "pywrapfst.pyx":2002
+  /* "pywrapfst.pyx":2005
  * 
  *   cdef void _minimize(self, float delta=fst.kDelta,
  *                       bool allow_nondet=False) except *:             # <<<<<<<<<<<<<<
@@ -23467,7 +23508,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__minimize(struct __pyx_obj_9pywrapf
     }
   }
 
-  /* "pywrapfst.pyx":2004
+  /* "pywrapfst.pyx":2007
  *                       bool allow_nondet=False) except *:
  *     # This runs in-place when the second argument is null.
  *     fst.Minimize(self._mfst.get(), NULL, delta, allow_nondet)             # <<<<<<<<<<<<<<
@@ -23476,11 +23517,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__minimize(struct __pyx_obj_9pywrapf
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 2004, __pyx_L1_error)
+    __PYX_ERR(0, 2007, __pyx_L1_error)
   }
   fst::script::Minimize(__pyx_v_self->_mfst.get(), NULL, __pyx_v_delta, __pyx_v_allow_nondet);
 
-  /* "pywrapfst.pyx":2005
+  /* "pywrapfst.pyx":2008
  *     # This runs in-place when the second argument is null.
  *     fst.Minimize(self._mfst.get(), NULL, delta, allow_nondet)
  *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
@@ -23489,11 +23530,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__minimize(struct __pyx_obj_9pywrapf
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
-    __PYX_ERR(0, 2005, __pyx_L1_error)
+    __PYX_ERR(0, 2008, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2005, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2008, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2001
+  /* "pywrapfst.pyx":2004
  *     return self
  * 
  *   cdef void _minimize(self, float delta=fst.kDelta,             # <<<<<<<<<<<<<<
@@ -23509,7 +23550,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__minimize(struct __pyx_obj_9pywrapf
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":2007
+/* "pywrapfst.pyx":2010
  *     self._check_mutating_imethod()
  * 
  *   def minimize(self, float delta=fst.kDelta, bool allow_nondet=False):             # <<<<<<<<<<<<<<
@@ -23552,7 +23593,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_23minimize(PyObject *__pyx_v_
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "minimize") < 0)) __PYX_ERR(0, 2007, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "minimize") < 0)) __PYX_ERR(0, 2010, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -23563,19 +23604,19 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_23minimize(PyObject *__pyx_v_
       }
     }
     if (values[0]) {
-      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2007, __pyx_L3_error)
+      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2010, __pyx_L3_error)
     } else {
       __pyx_v_delta = __pyx_k__12;
     }
     if (values[1]) {
-      __pyx_v_allow_nondet = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_allow_nondet == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2007, __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, 2010, __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, 2007, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("minimize", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2010, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("pywrapfst._MutableFst.minimize", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -23594,7 +23635,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_22minimize(struct __pyx_obj_9
   struct __pyx_opt_args_9pywrapfst_11_MutableFst__minimize __pyx_t_1;
   __Pyx_RefNannySetupContext("minimize", 0);
 
-  /* "pywrapfst.pyx":2033
+  /* "pywrapfst.pyx":2036
  *       self.
  *     """
  *     self._minimize(delta)             # <<<<<<<<<<<<<<
@@ -23603,13 +23644,13 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_22minimize(struct __pyx_obj_9
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_minimize");
-    __PYX_ERR(0, 2033, __pyx_L1_error)
+    __PYX_ERR(0, 2036, __pyx_L1_error)
   }
   __pyx_t_1.__pyx_n = 1;
   __pyx_t_1.delta = __pyx_v_delta;
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_minimize(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2033, __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, 2036, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2034
+  /* "pywrapfst.pyx":2037
  *     """
  *     self._minimize(delta)
  *     return self             # <<<<<<<<<<<<<<
@@ -23621,7 +23662,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_22minimize(struct __pyx_obj_9
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2007
+  /* "pywrapfst.pyx":2010
  *     self._check_mutating_imethod()
  * 
  *   def minimize(self, float delta=fst.kDelta, bool allow_nondet=False):             # <<<<<<<<<<<<<<
@@ -23639,7 +23680,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_22minimize(struct __pyx_obj_9
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2036
+/* "pywrapfst.pyx":2039
  *     return self
  * 
  *   cpdef MutableArcIterator mutable_arcs(self, int64 state):             # <<<<<<<<<<<<<<
@@ -23662,11 +23703,11 @@ static struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_f_9pywrapfst_11_Mut
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mutable_arcs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2036, __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, 2039, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_25mutable_arcs)) {
       __Pyx_XDECREF(((PyObject *)__pyx_r));
-      __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2036, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2039, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_INCREF(__pyx_t_1);
       __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
@@ -23680,14 +23721,14 @@ static struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_f_9pywrapfst_11_Mut
         }
       }
       if (!__pyx_t_5) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2036, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2039, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         __Pyx_GOTREF(__pyx_t_2);
       } else {
         #if CYTHON_FAST_PYCALL
         if (PyFunction_Check(__pyx_t_4)) {
           PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
-          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2036, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2039, __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;
@@ -23696,26 +23737,26 @@ static struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_f_9pywrapfst_11_Mut
         #if CYTHON_FAST_PYCCALL
         if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
           PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
-          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2036, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2039, __pyx_L1_error)
           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
           __Pyx_GOTREF(__pyx_t_2);
           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         } else
         #endif
         {
-          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2036, __pyx_L1_error)
+          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2039, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_6);
           __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
           __Pyx_GIVEREF(__pyx_t_3);
           PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
           __pyx_t_3 = 0;
-          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2036, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2039, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_2);
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         }
       }
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_MutableArcIterator))))) __PYX_ERR(0, 2036, __pyx_L1_error)
+      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_MutableArcIterator))))) __PYX_ERR(0, 2039, __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;
@@ -23724,7 +23765,7 @@ static struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_f_9pywrapfst_11_Mut
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":2051
+  /* "pywrapfst.pyx":2054
  *     See also: `arcs`, `states`.
  *     """
  *     return MutableArcIterator(self, state)             # <<<<<<<<<<<<<<
@@ -23732,9 +23773,9 @@ static struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_f_9pywrapfst_11_Mut
  *   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, 2051, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2054, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2051, __pyx_L1_error)
+  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2054, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
@@ -23742,14 +23783,14 @@ static struct __pyx_obj_9pywrapfst_MutableArcIterator *__pyx_f_9pywrapfst_11_Mut
   __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, 2051, __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, 2054, __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":2036
+  /* "pywrapfst.pyx":2039
  *     return self
  * 
  *   cpdef MutableArcIterator mutable_arcs(self, int64 state):             # <<<<<<<<<<<<<<
@@ -23782,7 +23823,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_25mutable_arcs(PyObject *__py
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("mutable_arcs (wrapper)", 0);
   assert(__pyx_arg_state); {
-    __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2036, __pyx_L3_error)
+    __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2039, __pyx_L3_error)
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L3_error:;
@@ -23803,7 +23844,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_24mutable_arcs(struct __pyx_o
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("mutable_arcs", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_11_MutableFst_mutable_arcs(__pyx_v_self, __pyx_v_state, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2036, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_11_MutableFst_mutable_arcs(__pyx_v_self, __pyx_v_state, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2039, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -23820,7 +23861,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_24mutable_arcs(struct __pyx_o
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2053
+/* "pywrapfst.pyx":2056
  *     return MutableArcIterator(self, state)
  * 
  *   def mutable_input_symbols(self):             # <<<<<<<<<<<<<<
@@ -23849,7 +23890,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_26mutable_input_symbols(struc
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("mutable_input_symbols", 0);
 
-  /* "pywrapfst.pyx":2054
+  /* "pywrapfst.pyx":2057
  * 
  *   def mutable_input_symbols(self):
  *     cdef fst.SymbolTable *tst = self._mfst.get().MutableInputSymbols()             # <<<<<<<<<<<<<<
@@ -23858,11 +23899,11 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_26mutable_input_symbols(struc
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 2054, __pyx_L1_error)
+    __PYX_ERR(0, 2057, __pyx_L1_error)
   }
   __pyx_v_tst = __pyx_v_self->_mfst.get()->MutableInputSymbols();
 
-  /* "pywrapfst.pyx":2055
+  /* "pywrapfst.pyx":2058
  *   def mutable_input_symbols(self):
  *     cdef fst.SymbolTable *tst = self._mfst.get().MutableInputSymbols()
  *     if tst == NULL:             # <<<<<<<<<<<<<<
@@ -23872,7 +23913,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_26mutable_input_symbols(struc
   __pyx_t_1 = ((__pyx_v_tst == NULL) != 0);
   if (__pyx_t_1) {
 
-    /* "pywrapfst.pyx":2056
+    /* "pywrapfst.pyx":2059
  *     cdef fst.SymbolTable *tst = self._mfst.get().MutableInputSymbols()
  *     if tst == NULL:
  *       return             # <<<<<<<<<<<<<<
@@ -23883,7 +23924,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_26mutable_input_symbols(struc
     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
     goto __pyx_L0;
 
-    /* "pywrapfst.pyx":2055
+    /* "pywrapfst.pyx":2058
  *   def mutable_input_symbols(self):
  *     cdef fst.SymbolTable *tst = self._mfst.get().MutableInputSymbols()
  *     if tst == NULL:             # <<<<<<<<<<<<<<
@@ -23892,7 +23933,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_26mutable_input_symbols(struc
  */
   }
 
-  /* "pywrapfst.pyx":2057
+  /* "pywrapfst.pyx":2060
  *     if tst == NULL:
  *       return
  *     return _init_MutableFstSymbolTable(tst, self._mfst)             # <<<<<<<<<<<<<<
@@ -23902,15 +23943,15 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_26mutable_input_symbols(struc
   __Pyx_XDECREF(__pyx_r);
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 2057, __pyx_L1_error)
+    __PYX_ERR(0, 2060, __pyx_L1_error)
   }
-  __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFstSymbolTable(__pyx_v_tst, __pyx_v_self->_mfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2057, __pyx_L1_error)
+  __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFstSymbolTable(__pyx_v_tst, __pyx_v_self->_mfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2060, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2053
+  /* "pywrapfst.pyx":2056
  *     return MutableArcIterator(self, state)
  * 
  *   def mutable_input_symbols(self):             # <<<<<<<<<<<<<<
@@ -23929,7 +23970,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_26mutable_input_symbols(struc
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2059
+/* "pywrapfst.pyx":2062
  *     return _init_MutableFstSymbolTable(tst, self._mfst)
  * 
  *   def mutable_output_symbols(self):             # <<<<<<<<<<<<<<
@@ -23958,7 +23999,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_28mutable_output_symbols(stru
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("mutable_output_symbols", 0);
 
-  /* "pywrapfst.pyx":2060
+  /* "pywrapfst.pyx":2063
  * 
  *   def mutable_output_symbols(self):
  *     cdef fst.SymbolTable *tst = self._mfst.get().MutableOutputSymbols()             # <<<<<<<<<<<<<<
@@ -23967,11 +24008,11 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_28mutable_output_symbols(stru
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 2060, __pyx_L1_error)
+    __PYX_ERR(0, 2063, __pyx_L1_error)
   }
   __pyx_v_tst = __pyx_v_self->_mfst.get()->MutableOutputSymbols();
 
-  /* "pywrapfst.pyx":2061
+  /* "pywrapfst.pyx":2064
  *   def mutable_output_symbols(self):
  *     cdef fst.SymbolTable *tst = self._mfst.get().MutableOutputSymbols()
  *     if tst == NULL:             # <<<<<<<<<<<<<<
@@ -23981,7 +24022,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_28mutable_output_symbols(stru
   __pyx_t_1 = ((__pyx_v_tst == NULL) != 0);
   if (__pyx_t_1) {
 
-    /* "pywrapfst.pyx":2062
+    /* "pywrapfst.pyx":2065
  *     cdef fst.SymbolTable *tst = self._mfst.get().MutableOutputSymbols()
  *     if tst == NULL:
  *       return             # <<<<<<<<<<<<<<
@@ -23992,7 +24033,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_28mutable_output_symbols(stru
     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
     goto __pyx_L0;
 
-    /* "pywrapfst.pyx":2061
+    /* "pywrapfst.pyx":2064
  *   def mutable_output_symbols(self):
  *     cdef fst.SymbolTable *tst = self._mfst.get().MutableOutputSymbols()
  *     if tst == NULL:             # <<<<<<<<<<<<<<
@@ -24001,7 +24042,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_28mutable_output_symbols(stru
  */
   }
 
-  /* "pywrapfst.pyx":2063
+  /* "pywrapfst.pyx":2066
  *     if tst == NULL:
  *       return
  *     return _init_MutableFstSymbolTable(tst, self._mfst)             # <<<<<<<<<<<<<<
@@ -24011,15 +24052,15 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_28mutable_output_symbols(stru
   __Pyx_XDECREF(__pyx_r);
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 2063, __pyx_L1_error)
+    __PYX_ERR(0, 2066, __pyx_L1_error)
   }
-  __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFstSymbolTable(__pyx_v_tst, __pyx_v_self->_mfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2063, __pyx_L1_error)
+  __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFstSymbolTable(__pyx_v_tst, __pyx_v_self->_mfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2066, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2059
+  /* "pywrapfst.pyx":2062
  *     return _init_MutableFstSymbolTable(tst, self._mfst)
  * 
  *   def mutable_output_symbols(self):             # <<<<<<<<<<<<<<
@@ -24038,7 +24079,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_28mutable_output_symbols(stru
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2065
+/* "pywrapfst.pyx":2068
  *     return _init_MutableFstSymbolTable(tst, self._mfst)
  * 
  *   cpdef int64 num_states(self):             # <<<<<<<<<<<<<<
@@ -24060,7 +24101,7 @@ static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_11_MutableFst_num_states(st
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2065, __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, 2068, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11_MutableFst_31num_states)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -24075,14 +24116,14 @@ static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_11_MutableFst_num_states(st
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2065, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2068, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2065, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2068, __pyx_L1_error)
       }
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2065, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2068, __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;
@@ -24091,7 +24132,7 @@ static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_11_MutableFst_num_states(st
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":2066
+  /* "pywrapfst.pyx":2069
  * 
  *   cpdef int64 num_states(self):
  *     return self._mfst.get().NumStates()             # <<<<<<<<<<<<<<
@@ -24100,12 +24141,12 @@ static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_11_MutableFst_num_states(st
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 2066, __pyx_L1_error)
+    __PYX_ERR(0, 2069, __pyx_L1_error)
   }
   __pyx_r = __pyx_v_self->_mfst.get()->NumStates();
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2065
+  /* "pywrapfst.pyx":2068
  *     return _init_MutableFstSymbolTable(tst, self._mfst)
  * 
  *   cpdef int64 num_states(self):             # <<<<<<<<<<<<<<
@@ -24145,7 +24186,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_30num_states(struct __pyx_obj
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("num_states", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_9pywrapfst_11_MutableFst_num_states(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2065, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_9pywrapfst_11_MutableFst_num_states(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2068, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -24162,7 +24203,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_30num_states(struct __pyx_obj
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2068
+/* "pywrapfst.pyx":2071
  *     return self._mfst.get().NumStates()
  * 
  *   cdef void _project(self, bool project_output=False) except *:             # <<<<<<<<<<<<<<
@@ -24180,7 +24221,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__project(struct __pyx_obj_9pywrapfs
     }
   }
 
-  /* "pywrapfst.pyx":2069
+  /* "pywrapfst.pyx":2072
  * 
  *   cdef void _project(self, bool project_output=False) except *:
  *     fst.Project(self._mfst.get(), fst.GetProjectType(project_output))             # <<<<<<<<<<<<<<
@@ -24189,11 +24230,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__project(struct __pyx_obj_9pywrapfs
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 2069, __pyx_L1_error)
+    __PYX_ERR(0, 2072, __pyx_L1_error)
   }
   fst::script::Project(__pyx_v_self->_mfst.get(), fst::script::GetProjectType(__pyx_v_project_output));
 
-  /* "pywrapfst.pyx":2070
+  /* "pywrapfst.pyx":2073
  *   cdef void _project(self, bool project_output=False) except *:
  *     fst.Project(self._mfst.get(), fst.GetProjectType(project_output))
  *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
@@ -24202,11 +24243,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__project(struct __pyx_obj_9pywrapfs
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
-    __PYX_ERR(0, 2070, __pyx_L1_error)
+    __PYX_ERR(0, 2073, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2070, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2073, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2068
+  /* "pywrapfst.pyx":2071
  *     return self._mfst.get().NumStates()
  * 
  *   cdef void _project(self, bool project_output=False) except *:             # <<<<<<<<<<<<<<
@@ -24222,7 +24263,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__project(struct __pyx_obj_9pywrapfs
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":2072
+/* "pywrapfst.pyx":2075
  *     self._check_mutating_imethod()
  * 
  *   def project(self, bool project_output=False):             # <<<<<<<<<<<<<<
@@ -24258,7 +24299,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_33project(PyObject *__pyx_v_s
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "project") < 0)) __PYX_ERR(0, 2072, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "project") < 0)) __PYX_ERR(0, 2075, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -24268,14 +24309,14 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_33project(PyObject *__pyx_v_s
       }
     }
     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, 2072, __pyx_L3_error)
+      __pyx_v_project_output = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_project_output == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2075, __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, 2072, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("project", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2075, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("pywrapfst._MutableFst.project", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -24294,7 +24335,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_32project(struct __pyx_obj_9p
   struct __pyx_opt_args_9pywrapfst_11_MutableFst__project __pyx_t_1;
   __Pyx_RefNannySetupContext("project", 0);
 
-  /* "pywrapfst.pyx":2090
+  /* "pywrapfst.pyx":2093
  *     See also: `decode`, `encode`, `relabel_pairs`, `relabel_symbols`.
  *     """
  *     self._project(project_output)             # <<<<<<<<<<<<<<
@@ -24303,13 +24344,13 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_32project(struct __pyx_obj_9p
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_project");
-    __PYX_ERR(0, 2090, __pyx_L1_error)
+    __PYX_ERR(0, 2093, __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, 2090, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_project(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2093, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2091
+  /* "pywrapfst.pyx":2094
  *     """
  *     self._project(project_output)
  *     return self             # <<<<<<<<<<<<<<
@@ -24321,7 +24362,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_32project(struct __pyx_obj_9p
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2072
+  /* "pywrapfst.pyx":2075
  *     self._check_mutating_imethod()
  * 
  *   def project(self, bool project_output=False):             # <<<<<<<<<<<<<<
@@ -24339,7 +24380,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_32project(struct __pyx_obj_9p
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2093
+/* "pywrapfst.pyx":2096
  *     return self
  * 
  *   cdef void _prune(self, float delta=fst.kDelta, int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
@@ -24351,7 +24392,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__prune(struct __pyx_obj_9pywrapfst_
   float __pyx_v_delta = __pyx_k__13;
   __pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__14;
 
-  /* "pywrapfst.pyx":2094
+  /* "pywrapfst.pyx":2097
  * 
  *   cdef void _prune(self, float delta=fst.kDelta, int64 nstate=fst.kNoStateId,
  *                    weight=None) except *:             # <<<<<<<<<<<<<<
@@ -24375,7 +24416,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__prune(struct __pyx_obj_9pywrapfst_
     }
   }
 
-  /* "pywrapfst.pyx":2096
+  /* "pywrapfst.pyx":2099
  *                    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(),             # <<<<<<<<<<<<<<
@@ -24384,20 +24425,20 @@ static void __pyx_f_9pywrapfst_11_MutableFst__prune(struct __pyx_obj_9pywrapfst_
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "weight_type");
-    __PYX_ERR(0, 2096, __pyx_L1_error)
+    __PYX_ERR(0, 2099, __pyx_L1_error)
   }
 
-  /* "pywrapfst.pyx":2097
+  /* "pywrapfst.pyx":2100
  *     # Threshold is set to semiring Zero (no pruning) if no weight is specified.
  *     cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(),
  *                                                        weight)             # <<<<<<<<<<<<<<
  *     fst.Prune(self._mfst.get(), wc, nstate, delta)
  *     self._check_mutating_imethod()
  */
-  __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2096, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2099, __pyx_L1_error)
   __pyx_v_wc = __pyx_t_1;
 
-  /* "pywrapfst.pyx":2098
+  /* "pywrapfst.pyx":2101
  *     cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(),
  *                                                        weight)
  *     fst.Prune(self._mfst.get(), wc, nstate, delta)             # <<<<<<<<<<<<<<
@@ -24406,11 +24447,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__prune(struct __pyx_obj_9pywrapfst_
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 2098, __pyx_L1_error)
+    __PYX_ERR(0, 2101, __pyx_L1_error)
   }
   fst::script::Prune(__pyx_v_self->_mfst.get(), __pyx_v_wc, __pyx_v_nstate, __pyx_v_delta);
 
-  /* "pywrapfst.pyx":2099
+  /* "pywrapfst.pyx":2102
  *                                                        weight)
  *     fst.Prune(self._mfst.get(), wc, nstate, delta)
  *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
@@ -24419,11 +24460,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__prune(struct __pyx_obj_9pywrapfst_
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
-    __PYX_ERR(0, 2099, __pyx_L1_error)
+    __PYX_ERR(0, 2102, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2099, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2102, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2093
+  /* "pywrapfst.pyx":2096
  *     return self
  * 
  *   cdef void _prune(self, float delta=fst.kDelta, int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
@@ -24439,7 +24480,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__prune(struct __pyx_obj_9pywrapfst_
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":2101
+/* "pywrapfst.pyx":2104
  *     self._check_mutating_imethod()
  * 
  *   def prune(self,             # <<<<<<<<<<<<<<
@@ -24461,7 +24502,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_35prune(PyObject *__pyx_v_sel
     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":2104
+    /* "pywrapfst.pyx":2107
  *             float delta=fst.kDelta,
  *             int64 nstate=fst.kNoStateId,
  *             weight=None):             # <<<<<<<<<<<<<<
@@ -24498,7 +24539,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_35prune(PyObject *__pyx_v_sel
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prune") < 0)) __PYX_ERR(0, 2101, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prune") < 0)) __PYX_ERR(0, 2104, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -24510,12 +24551,12 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_35prune(PyObject *__pyx_v_sel
       }
     }
     if (values[0]) {
-      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2102, __pyx_L3_error)
+      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2105, __pyx_L3_error)
     } else {
       __pyx_v_delta = __pyx_k__15;
     }
     if (values[1]) {
-      __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2103, __pyx_L3_error)
+      __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2106, __pyx_L3_error)
     } else {
       __pyx_v_nstate = __pyx_k__16;
     }
@@ -24523,7 +24564,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_35prune(PyObject *__pyx_v_sel
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("prune", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2101, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("prune", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2104, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("pywrapfst._MutableFst.prune", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -24531,7 +24572,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_35prune(PyObject *__pyx_v_sel
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_34prune(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_delta, __pyx_v_nstate, __pyx_v_weight);
 
-  /* "pywrapfst.pyx":2101
+  /* "pywrapfst.pyx":2104
  *     self._check_mutating_imethod()
  * 
  *   def prune(self,             # <<<<<<<<<<<<<<
@@ -24550,7 +24591,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_34prune(struct __pyx_obj_9pyw
   struct __pyx_opt_args_9pywrapfst_11_MutableFst__prune __pyx_t_1;
   __Pyx_RefNannySetupContext("prune", 0);
 
-  /* "pywrapfst.pyx":2126
+  /* "pywrapfst.pyx":2129
  *     See also: The constructive variant.
  *     """
  *     self._prune(delta, nstate, weight)             # <<<<<<<<<<<<<<
@@ -24559,15 +24600,15 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_34prune(struct __pyx_obj_9pyw
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_prune");
-    __PYX_ERR(0, 2126, __pyx_L1_error)
+    __PYX_ERR(0, 2129, __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, 2126, __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, 2129, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2127
+  /* "pywrapfst.pyx":2130
  *     """
  *     self._prune(delta, nstate, weight)
  *     return self             # <<<<<<<<<<<<<<
@@ -24579,7 +24620,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_34prune(struct __pyx_obj_9pyw
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2101
+  /* "pywrapfst.pyx":2104
  *     self._check_mutating_imethod()
  * 
  *   def prune(self,             # <<<<<<<<<<<<<<
@@ -24597,7 +24638,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_34prune(struct __pyx_obj_9pyw
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2129
+/* "pywrapfst.pyx":2132
  *     return self
  * 
  *   cdef void _push(self,             # <<<<<<<<<<<<<<
@@ -24608,7 +24649,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_34prune(struct __pyx_obj_9pyw
 static void __pyx_f_9pywrapfst_11_MutableFst__push(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__push *__pyx_optional_args) {
   float __pyx_v_delta = __pyx_k__17;
 
-  /* "pywrapfst.pyx":2131
+  /* "pywrapfst.pyx":2134
  *   cdef void _push(self,
  *                   float delta=fst.kDelta,
  *                   bool remove_total_weight=False,             # <<<<<<<<<<<<<<
@@ -24617,7 +24658,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__push(struct __pyx_obj_9pywrapfst__
  */
   bool __pyx_v_remove_total_weight = ((bool)0);
 
-  /* "pywrapfst.pyx":2132
+  /* "pywrapfst.pyx":2135
  *                   float delta=fst.kDelta,
  *                   bool remove_total_weight=False,
  *                   bool to_final=False) except *:             # <<<<<<<<<<<<<<
@@ -24639,7 +24680,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__push(struct __pyx_obj_9pywrapfst__
     }
   }
 
-  /* "pywrapfst.pyx":2133
+  /* "pywrapfst.pyx":2136
  *                   bool remove_total_weight=False,
  *                   bool to_final=False) except *:
  *     fst.Push(self._mfst.get(), fst.GetReweightType(to_final), delta,             # <<<<<<<<<<<<<<
@@ -24648,10 +24689,10 @@ static void __pyx_f_9pywrapfst_11_MutableFst__push(struct __pyx_obj_9pywrapfst__
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 2133, __pyx_L1_error)
+    __PYX_ERR(0, 2136, __pyx_L1_error)
   }
 
-  /* "pywrapfst.pyx":2134
+  /* "pywrapfst.pyx":2137
  *                   bool to_final=False) except *:
  *     fst.Push(self._mfst.get(), fst.GetReweightType(to_final), delta,
  *              remove_total_weight)             # <<<<<<<<<<<<<<
@@ -24660,7 +24701,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__push(struct __pyx_obj_9pywrapfst__
  */
   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":2135
+  /* "pywrapfst.pyx":2138
  *     fst.Push(self._mfst.get(), fst.GetReweightType(to_final), delta,
  *              remove_total_weight)
  *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
@@ -24669,11 +24710,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__push(struct __pyx_obj_9pywrapfst__
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
-    __PYX_ERR(0, 2135, __pyx_L1_error)
+    __PYX_ERR(0, 2138, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2135, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2138, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2129
+  /* "pywrapfst.pyx":2132
  *     return self
  * 
  *   cdef void _push(self,             # <<<<<<<<<<<<<<
@@ -24689,7 +24730,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__push(struct __pyx_obj_9pywrapfst__
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":2137
+/* "pywrapfst.pyx":2140
  *     self._check_mutating_imethod()
  * 
  *   def push(self,             # <<<<<<<<<<<<<<
@@ -24739,7 +24780,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_37push(PyObject *__pyx_v_self
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "push") < 0)) __PYX_ERR(0, 2137, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "push") < 0)) __PYX_ERR(0, 2140, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -24751,15 +24792,15 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_37push(PyObject *__pyx_v_self
       }
     }
     if (values[0]) {
-      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2138, __pyx_L3_error)
+      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2141, __pyx_L3_error)
     } else {
       __pyx_v_delta = __pyx_k__18;
     }
     if (values[1]) {
-      __pyx_v_remove_total_weight = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_remove_total_weight == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2139, __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, 2142, __pyx_L3_error)
     } else {
 
-      /* "pywrapfst.pyx":2139
+      /* "pywrapfst.pyx":2142
  *   def push(self,
  *            float delta=fst.kDelta,
  *            bool remove_total_weight=False,             # <<<<<<<<<<<<<<
@@ -24769,10 +24810,10 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_37push(PyObject *__pyx_v_self
       __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, 2140, __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, 2143, __pyx_L3_error)
     } else {
 
-      /* "pywrapfst.pyx":2140
+      /* "pywrapfst.pyx":2143
  *            float delta=fst.kDelta,
  *            bool remove_total_weight=False,
  *            bool to_final=False):             # <<<<<<<<<<<<<<
@@ -24784,7 +24825,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_37push(PyObject *__pyx_v_self
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("push", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2137, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("push", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2140, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("pywrapfst._MutableFst.push", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -24792,7 +24833,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_37push(PyObject *__pyx_v_self
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_36push(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_delta, __pyx_v_remove_total_weight, __pyx_v_to_final);
 
-  /* "pywrapfst.pyx":2137
+  /* "pywrapfst.pyx":2140
  *     self._check_mutating_imethod()
  * 
  *   def push(self,             # <<<<<<<<<<<<<<
@@ -24811,7 +24852,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_36push(struct __pyx_obj_9pywr
   struct __pyx_opt_args_9pywrapfst_11_MutableFst__push __pyx_t_1;
   __Pyx_RefNannySetupContext("push", 0);
 
-  /* "pywrapfst.pyx":2166
+  /* "pywrapfst.pyx":2169
  *     See also: The constructive variant, which also supports label pushing.
  *     """
  *     self._push(delta, remove_total_weight, to_final)             # <<<<<<<<<<<<<<
@@ -24820,15 +24861,15 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_36push(struct __pyx_obj_9pywr
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_push");
-    __PYX_ERR(0, 2166, __pyx_L1_error)
+    __PYX_ERR(0, 2169, __pyx_L1_error)
   }
   __pyx_t_1.__pyx_n = 3;
   __pyx_t_1.delta = __pyx_v_delta;
   __pyx_t_1.remove_total_weight = __pyx_v_remove_total_weight;
   __pyx_t_1.to_final = __pyx_v_to_final;
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_push(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2166, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_push(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2169, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2167
+  /* "pywrapfst.pyx":2170
  *     """
  *     self._push(delta, remove_total_weight, to_final)
  *     return self             # <<<<<<<<<<<<<<
@@ -24840,7 +24881,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_36push(struct __pyx_obj_9pywr
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2137
+  /* "pywrapfst.pyx":2140
  *     self._check_mutating_imethod()
  * 
  *   def push(self,             # <<<<<<<<<<<<<<
@@ -24858,7 +24899,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_36push(struct __pyx_obj_9pywr
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2169
+/* "pywrapfst.pyx":2172
  *     return self
  * 
  *   cdef void _relabel_pairs(self, ipairs=None, opairs=None) except *:             # <<<<<<<<<<<<<<
@@ -24898,7 +24939,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_pairs(struct __pyx_obj_9py
     }
   }
 
-  /* "pywrapfst.pyx":2171
+  /* "pywrapfst.pyx":2174
  *   cdef void _relabel_pairs(self, ipairs=None, opairs=None) except *:
  *     cdef unique_ptr[vector[fst.LabelPair]] _ipairs
  *     _ipairs.reset(new vector[fst.LabelPair]())             # <<<<<<<<<<<<<<
@@ -24909,11 +24950,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_pairs(struct __pyx_obj_9py
     __pyx_t_1 = new std::vector<__pyx_t_3fst_LabelPair> ();
   } catch(...) {
     __Pyx_CppExn2PyErr();
-    __PYX_ERR(0, 2171, __pyx_L1_error)
+    __PYX_ERR(0, 2174, __pyx_L1_error)
   }
   __pyx_v__ipairs.reset(__pyx_t_1);
 
-  /* "pywrapfst.pyx":2173
+  /* "pywrapfst.pyx":2176
  *     _ipairs.reset(new vector[fst.LabelPair]())
  *     cdef unique_ptr[vector[fst.LabelPair]] _opairs
  *     _opairs.reset(new vector[fst.LabelPair]())             # <<<<<<<<<<<<<<
@@ -24924,21 +24965,21 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_pairs(struct __pyx_obj_9py
     __pyx_t_1 = new std::vector<__pyx_t_3fst_LabelPair> ();
   } catch(...) {
     __Pyx_CppExn2PyErr();
-    __PYX_ERR(0, 2173, __pyx_L1_error)
+    __PYX_ERR(0, 2176, __pyx_L1_error)
   }
   __pyx_v__opairs.reset(__pyx_t_1);
 
-  /* "pywrapfst.pyx":2176
+  /* "pywrapfst.pyx":2179
  *     cdef int64 before
  *     cdef int64 after
  *     if ipairs:             # <<<<<<<<<<<<<<
  *       for (before, after) in ipairs:
  *         _ipairs.get().push_back(fst.LabelPair(before, after))
  */
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_ipairs); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2176, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_ipairs); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2179, __pyx_L1_error)
   if (__pyx_t_2) {
 
-    /* "pywrapfst.pyx":2177
+    /* "pywrapfst.pyx":2180
  *     cdef int64 after
  *     if ipairs:
  *       for (before, after) in ipairs:             # <<<<<<<<<<<<<<
@@ -24949,26 +24990,26 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_pairs(struct __pyx_obj_9py
       __pyx_t_3 = __pyx_v_ipairs; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
       __pyx_t_5 = NULL;
     } else {
-      __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_ipairs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2177, __pyx_L1_error)
+      __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_ipairs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2180, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2177, __pyx_L1_error)
+      __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2180, __pyx_L1_error)
     }
     for (;;) {
       if (likely(!__pyx_t_5)) {
         if (likely(PyList_CheckExact(__pyx_t_3))) {
           if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2177, __pyx_L1_error)
+          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2180, __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, 2177, __pyx_L1_error)
+          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2180, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_6);
           #endif
         } else {
           if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2177, __pyx_L1_error)
+          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2180, __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, 2177, __pyx_L1_error)
+          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2180, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_6);
           #endif
         }
@@ -24978,7 +25019,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_pairs(struct __pyx_obj_9py
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
             if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else __PYX_ERR(0, 2177, __pyx_L1_error)
+            else __PYX_ERR(0, 2180, __pyx_L1_error)
           }
           break;
         }
@@ -24994,7 +25035,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_pairs(struct __pyx_obj_9py
         if (unlikely(size != 2)) {
           if (size > 2) __Pyx_RaiseTooManyValuesError(2);
           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-          __PYX_ERR(0, 2177, __pyx_L1_error)
+          __PYX_ERR(0, 2180, __pyx_L1_error)
         }
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
         if (likely(PyTuple_CheckExact(sequence))) {
@@ -25007,15 +25048,15 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_pairs(struct __pyx_obj_9py
         __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, 2177, __pyx_L1_error)
+        __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2180, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_7);
-        __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2177, __pyx_L1_error)
+        __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2180, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_8);
         #endif
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       } else {
         Py_ssize_t index = -1;
-        __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2177, __pyx_L1_error)
+        __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2180, __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;
@@ -25023,7 +25064,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_pairs(struct __pyx_obj_9py
         __Pyx_GOTREF(__pyx_t_7);
         index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed;
         __Pyx_GOTREF(__pyx_t_8);
-        if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 2177, __pyx_L1_error)
+        if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 2180, __pyx_L1_error)
         __pyx_t_10 = NULL;
         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
         goto __pyx_L7_unpacking_done;
@@ -25031,17 +25072,17 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_pairs(struct __pyx_obj_9py
         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
         __pyx_t_10 = NULL;
         if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-        __PYX_ERR(0, 2177, __pyx_L1_error)
+        __PYX_ERR(0, 2180, __pyx_L1_error)
         __pyx_L7_unpacking_done:;
       }
-      __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_7); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2177, __pyx_L1_error)
+      __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_7); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2180, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_12 = __Pyx_PyInt_As_int64_t(__pyx_t_8); if (unlikely((__pyx_t_12 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2177, __pyx_L1_error)
+      __pyx_t_12 = __Pyx_PyInt_As_int64_t(__pyx_t_8); if (unlikely((__pyx_t_12 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2180, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       __pyx_v_before = __pyx_t_11;
       __pyx_v_after = __pyx_t_12;
 
-      /* "pywrapfst.pyx":2178
+      /* "pywrapfst.pyx":2181
  *     if ipairs:
  *       for (before, after) in ipairs:
  *         _ipairs.get().push_back(fst.LabelPair(before, after))             # <<<<<<<<<<<<<<
@@ -25052,16 +25093,16 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_pairs(struct __pyx_obj_9py
         __pyx_t_13 = __pyx_t_3fst_LabelPair(__pyx_v_before, __pyx_v_after);
       } catch(...) {
         __Pyx_CppExn2PyErr();
-        __PYX_ERR(0, 2178, __pyx_L1_error)
+        __PYX_ERR(0, 2181, __pyx_L1_error)
       }
       try {
         __pyx_v__ipairs.get()->push_back(__pyx_t_13);
       } catch(...) {
         __Pyx_CppExn2PyErr();
-        __PYX_ERR(0, 2178, __pyx_L1_error)
+        __PYX_ERR(0, 2181, __pyx_L1_error)
       }
 
-      /* "pywrapfst.pyx":2177
+      /* "pywrapfst.pyx":2180
  *     cdef int64 after
  *     if ipairs:
  *       for (before, after) in ipairs:             # <<<<<<<<<<<<<<
@@ -25071,7 +25112,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_pairs(struct __pyx_obj_9py
     }
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-    /* "pywrapfst.pyx":2176
+    /* "pywrapfst.pyx":2179
  *     cdef int64 before
  *     cdef int64 after
  *     if ipairs:             # <<<<<<<<<<<<<<
@@ -25080,17 +25121,17 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_pairs(struct __pyx_obj_9py
  */
   }
 
-  /* "pywrapfst.pyx":2179
+  /* "pywrapfst.pyx":2182
  *       for (before, after) in ipairs:
  *         _ipairs.get().push_back(fst.LabelPair(before, after))
  *     if opairs:             # <<<<<<<<<<<<<<
  *       for (before, after) in opairs:
  *         _opairs.get().push_back(fst.LabelPair(before, after))
  */
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_opairs); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2179, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_opairs); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2182, __pyx_L1_error)
   if (__pyx_t_2) {
 
-    /* "pywrapfst.pyx":2180
+    /* "pywrapfst.pyx":2183
  *         _ipairs.get().push_back(fst.LabelPair(before, after))
  *     if opairs:
  *       for (before, after) in opairs:             # <<<<<<<<<<<<<<
@@ -25101,26 +25142,26 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_pairs(struct __pyx_obj_9py
       __pyx_t_3 = __pyx_v_opairs; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
       __pyx_t_5 = NULL;
     } else {
-      __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_opairs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2180, __pyx_L1_error)
+      __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_opairs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2183, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2180, __pyx_L1_error)
+      __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2183, __pyx_L1_error)
     }
     for (;;) {
       if (likely(!__pyx_t_5)) {
         if (likely(PyList_CheckExact(__pyx_t_3))) {
           if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2180, __pyx_L1_error)
+          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2183, __pyx_L1_error)
           #else
-          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2180, __pyx_L1_error)
+          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2183, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_6);
           #endif
         } else {
           if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2180, __pyx_L1_error)
+          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2183, __pyx_L1_error)
           #else
-          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2180, __pyx_L1_error)
+          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2183, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_6);
           #endif
         }
@@ -25130,7 +25171,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_pairs(struct __pyx_obj_9py
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
             if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else __PYX_ERR(0, 2180, __pyx_L1_error)
+            else __PYX_ERR(0, 2183, __pyx_L1_error)
           }
           break;
         }
@@ -25146,7 +25187,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_pairs(struct __pyx_obj_9py
         if (unlikely(size != 2)) {
           if (size > 2) __Pyx_RaiseTooManyValuesError(2);
           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-          __PYX_ERR(0, 2180, __pyx_L1_error)
+          __PYX_ERR(0, 2183, __pyx_L1_error)
         }
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
         if (likely(PyTuple_CheckExact(sequence))) {
@@ -25159,15 +25200,15 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_pairs(struct __pyx_obj_9py
         __Pyx_INCREF(__pyx_t_8);
         __Pyx_INCREF(__pyx_t_7);
         #else
-        __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2180, __pyx_L1_error)
+        __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2183, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_8);
-        __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2180, __pyx_L1_error)
+        __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2183, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_7);
         #endif
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       } else {
         Py_ssize_t index = -1;
-        __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2180, __pyx_L1_error)
+        __pyx_t_9 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2183, __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;
@@ -25175,7 +25216,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_pairs(struct __pyx_obj_9py
         __Pyx_GOTREF(__pyx_t_8);
         index = 1; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L11_unpacking_failed;
         __Pyx_GOTREF(__pyx_t_7);
-        if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 2180, __pyx_L1_error)
+        if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 2183, __pyx_L1_error)
         __pyx_t_10 = NULL;
         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
         goto __pyx_L12_unpacking_done;
@@ -25183,17 +25224,17 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_pairs(struct __pyx_obj_9py
         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
         __pyx_t_10 = NULL;
         if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-        __PYX_ERR(0, 2180, __pyx_L1_error)
+        __PYX_ERR(0, 2183, __pyx_L1_error)
         __pyx_L12_unpacking_done:;
       }
-      __pyx_t_12 = __Pyx_PyInt_As_int64_t(__pyx_t_8); if (unlikely((__pyx_t_12 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2180, __pyx_L1_error)
+      __pyx_t_12 = __Pyx_PyInt_As_int64_t(__pyx_t_8); if (unlikely((__pyx_t_12 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2183, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_7); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2180, __pyx_L1_error)
+      __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_7); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2183, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
       __pyx_v_before = __pyx_t_12;
       __pyx_v_after = __pyx_t_11;
 
-      /* "pywrapfst.pyx":2181
+      /* "pywrapfst.pyx":2184
  *     if opairs:
  *       for (before, after) in opairs:
  *         _opairs.get().push_back(fst.LabelPair(before, after))             # <<<<<<<<<<<<<<
@@ -25204,16 +25245,16 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_pairs(struct __pyx_obj_9py
         __pyx_t_13 = __pyx_t_3fst_LabelPair(__pyx_v_before, __pyx_v_after);
       } catch(...) {
         __Pyx_CppExn2PyErr();
-        __PYX_ERR(0, 2181, __pyx_L1_error)
+        __PYX_ERR(0, 2184, __pyx_L1_error)
       }
       try {
         __pyx_v__opairs.get()->push_back(__pyx_t_13);
       } catch(...) {
         __Pyx_CppExn2PyErr();
-        __PYX_ERR(0, 2181, __pyx_L1_error)
+        __PYX_ERR(0, 2184, __pyx_L1_error)
       }
 
-      /* "pywrapfst.pyx":2180
+      /* "pywrapfst.pyx":2183
  *         _ipairs.get().push_back(fst.LabelPair(before, after))
  *     if opairs:
  *       for (before, after) in opairs:             # <<<<<<<<<<<<<<
@@ -25223,7 +25264,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_pairs(struct __pyx_obj_9py
     }
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-    /* "pywrapfst.pyx":2179
+    /* "pywrapfst.pyx":2182
  *       for (before, after) in ipairs:
  *         _ipairs.get().push_back(fst.LabelPair(before, after))
  *     if opairs:             # <<<<<<<<<<<<<<
@@ -25232,7 +25273,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_pairs(struct __pyx_obj_9py
  */
   }
 
-  /* "pywrapfst.pyx":2182
+  /* "pywrapfst.pyx":2185
  *       for (before, after) in opairs:
  *         _opairs.get().push_back(fst.LabelPair(before, after))
  *     if _ipairs.get().empty() and _opairs.get().empty():             # <<<<<<<<<<<<<<
@@ -25250,23 +25291,23 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_pairs(struct __pyx_obj_9py
   __pyx_L14_bool_binop_done:;
   if (__pyx_t_2) {
 
-    /* "pywrapfst.pyx":2183
+    /* "pywrapfst.pyx":2186
  *         _opairs.get().push_back(fst.LabelPair(before, after))
  *     if _ipairs.get().empty() and _opairs.get().empty():
  *       raise FstArgError("No relabeling pairs specified.")             # <<<<<<<<<<<<<<
  *     fst.Relabel(self._mfst.get(), deref(_ipairs), deref(_opairs))
  *     self._check_mutating_imethod()
  */
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2183, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2186, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2183, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2186, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_Raise(__pyx_t_6, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __PYX_ERR(0, 2183, __pyx_L1_error)
+    __PYX_ERR(0, 2186, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":2182
+    /* "pywrapfst.pyx":2185
  *       for (before, after) in opairs:
  *         _opairs.get().push_back(fst.LabelPair(before, after))
  *     if _ipairs.get().empty() and _opairs.get().empty():             # <<<<<<<<<<<<<<
@@ -25275,7 +25316,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_pairs(struct __pyx_obj_9py
  */
   }
 
-  /* "pywrapfst.pyx":2184
+  /* "pywrapfst.pyx":2187
  *     if _ipairs.get().empty() and _opairs.get().empty():
  *       raise FstArgError("No relabeling pairs specified.")
  *     fst.Relabel(self._mfst.get(), deref(_ipairs), deref(_opairs))             # <<<<<<<<<<<<<<
@@ -25284,11 +25325,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_pairs(struct __pyx_obj_9py
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 2184, __pyx_L1_error)
+    __PYX_ERR(0, 2187, __pyx_L1_error)
   }
   fst::script::Relabel(__pyx_v_self->_mfst.get(), (*__pyx_v__ipairs), (*__pyx_v__opairs));
 
-  /* "pywrapfst.pyx":2185
+  /* "pywrapfst.pyx":2188
  *       raise FstArgError("No relabeling pairs specified.")
  *     fst.Relabel(self._mfst.get(), deref(_ipairs), deref(_opairs))
  *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
@@ -25297,11 +25338,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_pairs(struct __pyx_obj_9py
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
-    __PYX_ERR(0, 2185, __pyx_L1_error)
+    __PYX_ERR(0, 2188, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2185, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2188, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2169
+  /* "pywrapfst.pyx":2172
  *     return self
  * 
  *   cdef void _relabel_pairs(self, ipairs=None, opairs=None) except *:             # <<<<<<<<<<<<<<
@@ -25322,7 +25363,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_pairs(struct __pyx_obj_9py
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":2187
+/* "pywrapfst.pyx":2190
  *     self._check_mutating_imethod()
  * 
  *   def relabel_pairs(self, ipairs=None, opairs=None):             # <<<<<<<<<<<<<<
@@ -25367,7 +25408,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_39relabel_pairs(PyObject *__p
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "relabel_pairs") < 0)) __PYX_ERR(0, 2187, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "relabel_pairs") < 0)) __PYX_ERR(0, 2190, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -25382,7 +25423,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_39relabel_pairs(PyObject *__p
   }
   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, 2187, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("relabel_pairs", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2190, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("pywrapfst._MutableFst.relabel_pairs", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -25401,7 +25442,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_38relabel_pairs(struct __pyx_
   struct __pyx_opt_args_9pywrapfst_11_MutableFst__relabel_pairs __pyx_t_1;
   __Pyx_RefNannySetupContext("relabel_pairs", 0);
 
-  /* "pywrapfst.pyx":2209
+  /* "pywrapfst.pyx":2212
  *     See also: `decode`, `encode`, `project`, `relabel_tables`.
  *     """
  *     self._relabel_pairs(ipairs, opairs)             # <<<<<<<<<<<<<<
@@ -25410,14 +25451,14 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_38relabel_pairs(struct __pyx_
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_relabel_pairs");
-    __PYX_ERR(0, 2209, __pyx_L1_error)
+    __PYX_ERR(0, 2212, __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, 2209, __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, 2212, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2210
+  /* "pywrapfst.pyx":2213
  *     """
  *     self._relabel_pairs(ipairs, opairs)
  *     return self             # <<<<<<<<<<<<<<
@@ -25429,7 +25470,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_38relabel_pairs(struct __pyx_
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2187
+  /* "pywrapfst.pyx":2190
  *     self._check_mutating_imethod()
  * 
  *   def relabel_pairs(self, ipairs=None, opairs=None):             # <<<<<<<<<<<<<<
@@ -25447,7 +25488,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_38relabel_pairs(struct __pyx_
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2212
+/* "pywrapfst.pyx":2215
  *     return self
  * 
  *   cdef void _relabel_tables(self,             # <<<<<<<<<<<<<<
@@ -25457,54 +25498,56 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_38relabel_pairs(struct __pyx_
 
 static void __pyx_f_9pywrapfst_11_MutableFst__relabel_tables(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__relabel_tables *__pyx_optional_args) {
 
-  /* "pywrapfst.pyx":2213
+  /* "pywrapfst.pyx":2216
  * 
  *   cdef void _relabel_tables(self,
  *                             _SymbolTable old_isymbols=None,             # <<<<<<<<<<<<<<
  *                             _SymbolTable new_isymbols=None,
- *                             bool attach_new_isymbols=True,
+ *                             unknown_isymbol=b"",
  */
   struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_isymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
 
-  /* "pywrapfst.pyx":2214
+  /* "pywrapfst.pyx":2217
  *   cdef void _relabel_tables(self,
  *                             _SymbolTable old_isymbols=None,
  *                             _SymbolTable new_isymbols=None,             # <<<<<<<<<<<<<<
+ *                             unknown_isymbol=b"",
  *                             bool attach_new_isymbols=True,
- *                             _SymbolTable old_osymbols=None,
  */
   struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_isymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
+  PyObject *__pyx_v_unknown_isymbol = ((PyObject *)__pyx_kp_b_);
 
-  /* "pywrapfst.pyx":2215
- *                             _SymbolTable old_isymbols=None,
+  /* "pywrapfst.pyx":2219
  *                             _SymbolTable new_isymbols=None,
+ *                             unknown_isymbol=b"",
  *                             bool attach_new_isymbols=True,             # <<<<<<<<<<<<<<
  *                             _SymbolTable old_osymbols=None,
  *                             _SymbolTable new_osymbols=None,
  */
   bool __pyx_v_attach_new_isymbols = ((bool)1);
 
-  /* "pywrapfst.pyx":2216
- *                             _SymbolTable new_isymbols=None,
+  /* "pywrapfst.pyx":2220
+ *                             unknown_isymbol=b"",
  *                             bool attach_new_isymbols=True,
  *                             _SymbolTable old_osymbols=None,             # <<<<<<<<<<<<<<
  *                             _SymbolTable new_osymbols=None,
- *                             bool attach_new_osymbols=True) except *:
+ *                             unknown_osymbol=b"",
  */
   struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
 
-  /* "pywrapfst.pyx":2217
+  /* "pywrapfst.pyx":2221
  *                             bool attach_new_isymbols=True,
  *                             _SymbolTable old_osymbols=None,
  *                             _SymbolTable new_osymbols=None,             # <<<<<<<<<<<<<<
+ *                             unknown_osymbol=b"",
  *                             bool attach_new_osymbols=True) except *:
- *     if new_isymbols is None and new_osymbols is None:
  */
   struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
+  PyObject *__pyx_v_unknown_osymbol = ((PyObject *)__pyx_kp_b_);
 
-  /* "pywrapfst.pyx":2218
- *                             _SymbolTable old_osymbols=None,
+  /* "pywrapfst.pyx":2223
  *                             _SymbolTable new_osymbols=None,
+ *                             unknown_osymbol=b"",
  *                             bool attach_new_osymbols=True) except *:             # <<<<<<<<<<<<<<
  *     if new_isymbols is None and new_osymbols is None:
  *       raise FstArgError("No new SymbolTables specified")
@@ -25520,7 +25563,9 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_tables(struct __pyx_obj_9p
   PyObject *__pyx_t_5 = NULL;
   fst::SymbolTable *__pyx_t_6;
   fst::SymbolTable const *__pyx_t_7;
-  fst::SymbolTable const *__pyx_t_8;
+  std::string __pyx_t_8;
+  fst::SymbolTable const *__pyx_t_9;
+  std::string __pyx_t_10;
   __Pyx_RefNannySetupContext("_relabel_tables", 0);
   if (__pyx_optional_args) {
     if (__pyx_optional_args->__pyx_n > 0) {
@@ -25528,13 +25573,19 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_tables(struct __pyx_obj_9p
       if (__pyx_optional_args->__pyx_n > 1) {
         __pyx_v_new_isymbols = __pyx_optional_args->new_isymbols;
         if (__pyx_optional_args->__pyx_n > 2) {
-          __pyx_v_attach_new_isymbols = __pyx_optional_args->attach_new_isymbols;
+          __pyx_v_unknown_isymbol = __pyx_optional_args->unknown_isymbol;
           if (__pyx_optional_args->__pyx_n > 3) {
-            __pyx_v_old_osymbols = __pyx_optional_args->old_osymbols;
+            __pyx_v_attach_new_isymbols = __pyx_optional_args->attach_new_isymbols;
             if (__pyx_optional_args->__pyx_n > 4) {
-              __pyx_v_new_osymbols = __pyx_optional_args->new_osymbols;
+              __pyx_v_old_osymbols = __pyx_optional_args->old_osymbols;
               if (__pyx_optional_args->__pyx_n > 5) {
-                __pyx_v_attach_new_osymbols = __pyx_optional_args->attach_new_osymbols;
+                __pyx_v_new_osymbols = __pyx_optional_args->new_osymbols;
+                if (__pyx_optional_args->__pyx_n > 6) {
+                  __pyx_v_unknown_osymbol = __pyx_optional_args->unknown_osymbol;
+                  if (__pyx_optional_args->__pyx_n > 7) {
+                    __pyx_v_attach_new_osymbols = __pyx_optional_args->attach_new_osymbols;
+                  }
+                }
               }
             }
           }
@@ -25543,8 +25594,8 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_tables(struct __pyx_obj_9p
     }
   }
 
-  /* "pywrapfst.pyx":2219
- *                             _SymbolTable new_osymbols=None,
+  /* "pywrapfst.pyx":2224
+ *                             unknown_osymbol=b"",
  *                             bool attach_new_osymbols=True) except *:
  *     if new_isymbols is None and new_osymbols is None:             # <<<<<<<<<<<<<<
  *       raise FstArgError("No new SymbolTables specified")
@@ -25563,24 +25614,24 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_tables(struct __pyx_obj_9p
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "pywrapfst.pyx":2220
+    /* "pywrapfst.pyx":2225
  *                             bool attach_new_osymbols=True) except *:
  *     if new_isymbols is None and new_osymbols is None:
  *       raise FstArgError("No new SymbolTables specified")             # <<<<<<<<<<<<<<
  *     cdef fst.SymbolTable *new_isymbols_ptr = NULL
  *     if new_isymbols is not None:
  */
-    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2220, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2225, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2220, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2225, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_Raise(__pyx_t_5, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __PYX_ERR(0, 2220, __pyx_L1_error)
+    __PYX_ERR(0, 2225, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":2219
- *                             _SymbolTable new_osymbols=None,
+    /* "pywrapfst.pyx":2224
+ *                             unknown_osymbol=b"",
  *                             bool attach_new_osymbols=True) except *:
  *     if new_isymbols is None and new_osymbols is None:             # <<<<<<<<<<<<<<
  *       raise FstArgError("No new SymbolTables specified")
@@ -25588,7 +25639,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_tables(struct __pyx_obj_9p
  */
   }
 
-  /* "pywrapfst.pyx":2221
+  /* "pywrapfst.pyx":2226
  *     if new_isymbols is None and new_osymbols is None:
  *       raise FstArgError("No new SymbolTables specified")
  *     cdef fst.SymbolTable *new_isymbols_ptr = NULL             # <<<<<<<<<<<<<<
@@ -25597,7 +25648,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_tables(struct __pyx_obj_9p
  */
   __pyx_v_new_isymbols_ptr = NULL;
 
-  /* "pywrapfst.pyx":2222
+  /* "pywrapfst.pyx":2227
  *       raise FstArgError("No new SymbolTables specified")
  *     cdef fst.SymbolTable *new_isymbols_ptr = NULL
  *     if new_isymbols is not None:             # <<<<<<<<<<<<<<
@@ -25608,7 +25659,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_tables(struct __pyx_obj_9p
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "pywrapfst.pyx":2223
+    /* "pywrapfst.pyx":2228
  *     cdef fst.SymbolTable *new_isymbols_ptr = NULL
  *     if new_isymbols is not None:
  *       new_isymbols_ptr = new_isymbols._table             # <<<<<<<<<<<<<<
@@ -25617,12 +25668,12 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_tables(struct __pyx_obj_9p
  */
     if (unlikely(((PyObject *)__pyx_v_new_isymbols) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
-      __PYX_ERR(0, 2223, __pyx_L1_error)
+      __PYX_ERR(0, 2228, __pyx_L1_error)
     }
     __pyx_t_6 = __pyx_v_new_isymbols->_table;
     __pyx_v_new_isymbols_ptr = __pyx_t_6;
 
-    /* "pywrapfst.pyx":2222
+    /* "pywrapfst.pyx":2227
  *       raise FstArgError("No new SymbolTables specified")
  *     cdef fst.SymbolTable *new_isymbols_ptr = NULL
  *     if new_isymbols is not None:             # <<<<<<<<<<<<<<
@@ -25631,7 +25682,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_tables(struct __pyx_obj_9p
  */
   }
 
-  /* "pywrapfst.pyx":2224
+  /* "pywrapfst.pyx":2229
  *     if new_isymbols is not None:
  *       new_isymbols_ptr = new_isymbols._table
  *     cdef fst.SymbolTable *new_osymbols_ptr = NULL             # <<<<<<<<<<<<<<
@@ -25640,7 +25691,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_tables(struct __pyx_obj_9p
  */
   __pyx_v_new_osymbols_ptr = NULL;
 
-  /* "pywrapfst.pyx":2225
+  /* "pywrapfst.pyx":2230
  *       new_isymbols_ptr = new_isymbols._table
  *     cdef fst.SymbolTable *new_osymbols_ptr = NULL
  *     if new_osymbols is not None:             # <<<<<<<<<<<<<<
@@ -25651,7 +25702,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_tables(struct __pyx_obj_9p
   __pyx_t_1 = (__pyx_t_2 != 0);
   if (__pyx_t_1) {
 
-    /* "pywrapfst.pyx":2226
+    /* "pywrapfst.pyx":2231
  *     cdef fst.SymbolTable *new_osymbols_ptr = NULL
  *     if new_osymbols is not None:
  *       new_osymbols_ptr = new_osymbols._table             # <<<<<<<<<<<<<<
@@ -25660,12 +25711,12 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_tables(struct __pyx_obj_9p
  */
     if (unlikely(((PyObject *)__pyx_v_new_osymbols) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
-      __PYX_ERR(0, 2226, __pyx_L1_error)
+      __PYX_ERR(0, 2231, __pyx_L1_error)
     }
     __pyx_t_6 = __pyx_v_new_osymbols->_table;
     __pyx_v_new_osymbols_ptr = __pyx_t_6;
 
-    /* "pywrapfst.pyx":2225
+    /* "pywrapfst.pyx":2230
  *       new_isymbols_ptr = new_isymbols._table
  *     cdef fst.SymbolTable *new_osymbols_ptr = NULL
  *     if new_osymbols is not None:             # <<<<<<<<<<<<<<
@@ -25674,101 +25725,103 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_tables(struct __pyx_obj_9p
  */
   }
 
-  /* "pywrapfst.pyx":2227
+  /* "pywrapfst.pyx":2232
  *     if new_osymbols is not None:
  *       new_osymbols_ptr = new_osymbols._table
  *     fst.Relabel(self._mfst.get(),             # <<<<<<<<<<<<<<
  *         self._fst.get().InputSymbols() if old_isymbols is None else
- *         old_isymbols._table, new_isymbols_ptr, attach_new_isymbols,
+ *         old_isymbols._table, new_isymbols_ptr, tostring(unknown_isymbol),
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 2227, __pyx_L1_error)
+    __PYX_ERR(0, 2232, __pyx_L1_error)
   }
 
-  /* "pywrapfst.pyx":2228
+  /* "pywrapfst.pyx":2233
  *       new_osymbols_ptr = new_osymbols._table
  *     fst.Relabel(self._mfst.get(),
  *         self._fst.get().InputSymbols() if old_isymbols is None else             # <<<<<<<<<<<<<<
- *         old_isymbols._table, new_isymbols_ptr, attach_new_isymbols,
- *         self._fst.get().OutputSymbols() if old_osymbols is None else
+ *         old_isymbols._table, new_isymbols_ptr, tostring(unknown_isymbol),
+ *         attach_new_isymbols,
  */
   __pyx_t_1 = (((PyObject *)__pyx_v_old_isymbols) == Py_None);
   if ((__pyx_t_1 != 0)) {
     if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-      __PYX_ERR(0, 2228, __pyx_L1_error)
+      __PYX_ERR(0, 2233, __pyx_L1_error)
     }
     __pyx_t_7 = __pyx_v_self->__pyx_base._fst.get()->InputSymbols();
   } else {
 
-    /* "pywrapfst.pyx":2229
+    /* "pywrapfst.pyx":2234
  *     fst.Relabel(self._mfst.get(),
  *         self._fst.get().InputSymbols() if old_isymbols is None else
- *         old_isymbols._table, new_isymbols_ptr, attach_new_isymbols,             # <<<<<<<<<<<<<<
+ *         old_isymbols._table, new_isymbols_ptr, tostring(unknown_isymbol),             # <<<<<<<<<<<<<<
+ *         attach_new_isymbols,
  *         self._fst.get().OutputSymbols() if old_osymbols is None else
- *         old_osymbols._table, new_osymbols_ptr, attach_new_osymbols)
  */
     if (unlikely(((PyObject *)__pyx_v_old_isymbols) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
-      __PYX_ERR(0, 2229, __pyx_L1_error)
+      __PYX_ERR(0, 2234, __pyx_L1_error)
     }
     __pyx_t_7 = __pyx_v_old_isymbols->_table;
   }
+  __pyx_t_8 = __pyx_f_9pywrapfst_tostring(__pyx_v_unknown_isymbol, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2234, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2230
- *         self._fst.get().InputSymbols() if old_isymbols is None else
- *         old_isymbols._table, new_isymbols_ptr, attach_new_isymbols,
+  /* "pywrapfst.pyx":2236
+ *         old_isymbols._table, new_isymbols_ptr, tostring(unknown_isymbol),
+ *         attach_new_isymbols,
  *         self._fst.get().OutputSymbols() if old_osymbols is None else             # <<<<<<<<<<<<<<
- *         old_osymbols._table, new_osymbols_ptr, attach_new_osymbols)
- *     self._check_mutating_imethod()
+ *         old_osymbols._table, new_osymbols_ptr, tostring(unknown_osymbol),
+ *         attach_new_osymbols)
  */
   __pyx_t_1 = (((PyObject *)__pyx_v_old_osymbols) == Py_None);
   if ((__pyx_t_1 != 0)) {
     if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-      __PYX_ERR(0, 2230, __pyx_L1_error)
+      __PYX_ERR(0, 2236, __pyx_L1_error)
     }
-    __pyx_t_8 = __pyx_v_self->__pyx_base._fst.get()->OutputSymbols();
+    __pyx_t_9 = __pyx_v_self->__pyx_base._fst.get()->OutputSymbols();
   } else {
 
-    /* "pywrapfst.pyx":2231
- *         old_isymbols._table, new_isymbols_ptr, attach_new_isymbols,
+    /* "pywrapfst.pyx":2237
+ *         attach_new_isymbols,
  *         self._fst.get().OutputSymbols() if old_osymbols is None else
- *         old_osymbols._table, new_osymbols_ptr, attach_new_osymbols)             # <<<<<<<<<<<<<<
+ *         old_osymbols._table, new_osymbols_ptr, tostring(unknown_osymbol),             # <<<<<<<<<<<<<<
+ *         attach_new_osymbols)
  *     self._check_mutating_imethod()
- * 
  */
     if (unlikely(((PyObject *)__pyx_v_old_osymbols) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
-      __PYX_ERR(0, 2231, __pyx_L1_error)
+      __PYX_ERR(0, 2237, __pyx_L1_error)
     }
-    __pyx_t_8 = __pyx_v_old_osymbols->_table;
+    __pyx_t_9 = __pyx_v_old_osymbols->_table;
   }
+  __pyx_t_10 = __pyx_f_9pywrapfst_tostring(__pyx_v_unknown_osymbol, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2237, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2227
+  /* "pywrapfst.pyx":2232
  *     if new_osymbols is not None:
  *       new_osymbols_ptr = new_osymbols._table
  *     fst.Relabel(self._mfst.get(),             # <<<<<<<<<<<<<<
  *         self._fst.get().InputSymbols() if old_isymbols is None else
- *         old_isymbols._table, new_isymbols_ptr, attach_new_isymbols,
+ *         old_isymbols._table, new_isymbols_ptr, tostring(unknown_isymbol),
  */
-  fst::script::Relabel(__pyx_v_self->_mfst.get(), __pyx_t_7, __pyx_v_new_isymbols_ptr, __pyx_v_attach_new_isymbols, __pyx_t_8, __pyx_v_new_osymbols_ptr, __pyx_v_attach_new_osymbols);
+  fst::script::Relabel(__pyx_v_self->_mfst.get(), __pyx_t_7, __pyx_v_new_isymbols_ptr, __pyx_t_8, __pyx_v_attach_new_isymbols, __pyx_t_9, __pyx_v_new_osymbols_ptr, __pyx_t_10, __pyx_v_attach_new_osymbols);
 
-  /* "pywrapfst.pyx":2232
- *         self._fst.get().OutputSymbols() if old_osymbols is None else
- *         old_osymbols._table, new_osymbols_ptr, attach_new_osymbols)
+  /* "pywrapfst.pyx":2239
+ *         old_osymbols._table, new_osymbols_ptr, tostring(unknown_osymbol),
+ *         attach_new_osymbols)
  *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
  * 
  *   def relabel_tables(self,
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
-    __PYX_ERR(0, 2232, __pyx_L1_error)
+    __PYX_ERR(0, 2239, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2232, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2239, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2212
+  /* "pywrapfst.pyx":2215
  *     return self
  * 
  *   cdef void _relabel_tables(self,             # <<<<<<<<<<<<<<
@@ -25786,70 +25839,76 @@ static void __pyx_f_9pywrapfst_11_MutableFst__relabel_tables(struct __pyx_obj_9p
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":2234
+/* "pywrapfst.pyx":2241
  *     self._check_mutating_imethod()
  * 
  *   def relabel_tables(self,             # <<<<<<<<<<<<<<
  *                      _SymbolTable old_isymbols=None,
- *                     _SymbolTable new_isymbols=None,
+ *                      _SymbolTable new_isymbols=None,
  */
 
 /* Python wrapper */
 static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_41relabel_tables(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_40relabel_tables[] = "\n    relabel_tables(self, old_isymbols=None, new_isymbols=None,\n                   attach_new_isymbols=True, old_osymbols=None,\n                   new_osymbols=None, 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       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       attach_new_isymbols: Should new_osymbols be made the FST's output symbol\n          table?\n\n    Returns:\n      self.\n\n    Raises:\n      FstArgError: No SymbolTable specified.\n\n    See also: `decode`, `encode`, `project`, `relabel_pairs`.\n    ";
+static char __pyx_doc_9pywrapfst_11_MutableFst_40relabel_tables[] = "\n    relabel_tables(self, old_isymbols=None, new_isymbols=None,\n                   unknown_isymbol=\"\", attach_new_isymbols=True,\n                   old_osymbols=None, new_osymbols=None,\n                   unknown_osymbol=\"\", attach_new_osymbols=True)\n\n    Replaces input and/or output labels using SymbolTables.\n\n    This operation destructively relabels the input and/or output labels of the\n    FST using user-specified symbol tables; omitted symbols are identity-mapped.\n\n    Args:\n       old_isymbols: The old SymbolTable for input labels, defaulting to the\n          FST's input symbol table.\n       new_isymbols: A SymbolTable used to relabel the input labels\n       unknown_isymbol: Input symbol to use to relabel OOVs (if empty,\n          OOVs raise an exception)\n       attach_new_isymbols: Should new_isymbols be made the FST's input symbol\n          table?\n       old_osymbols: The old SymbolTable for output labels, defaulting to the\n          FST's output symbol table.\n       new_osymbols: A SymbolTable used to relabel the output labels.\n       unknown_osymbol: Outnput symbol to use to relabel OOVs (if empty,\n          OOVs raise an exception)\n       attach_new_isymbols: Should new_osymbols be made the FST's output symbol\n          table?\n\n    Returns:\n      self.\n\n    Raises:\n      FstArgError: No SymbolTable specified.\n\n    See also: `decode`, `encode`, `project`, `relabel_pairs`.\n    ";
 static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_41relabel_tables(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_isymbols = 0;
   struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_isymbols = 0;
+  PyObject *__pyx_v_unknown_isymbol = 0;
   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;
+  PyObject *__pyx_v_unknown_osymbol = 0;
   bool __pyx_v_attach_new_osymbols;
   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_attach_new_isymbols,&__pyx_n_s_old_osymbols,&__pyx_n_s_new_osymbols,&__pyx_n_s_attach_new_osymbols,0};
-    PyObject* values[6] = {0,0,0,0,0,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":2235
+    /* "pywrapfst.pyx":2242
  * 
  *   def relabel_tables(self,
  *                      _SymbolTable old_isymbols=None,             # <<<<<<<<<<<<<<
- *                     _SymbolTable new_isymbols=None,
- *                     bool attach_new_isymbols=True,
+ *                      _SymbolTable new_isymbols=None,
+ *                      unknown_isymbol=b"",
  */
     values[0] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
 
-    /* "pywrapfst.pyx":2236
+    /* "pywrapfst.pyx":2243
  *   def relabel_tables(self,
  *                      _SymbolTable old_isymbols=None,
- *                     _SymbolTable new_isymbols=None,             # <<<<<<<<<<<<<<
- *                     bool attach_new_isymbols=True,
- *                     _SymbolTable old_osymbols=None,
+ *                      _SymbolTable new_isymbols=None,             # <<<<<<<<<<<<<<
+ *                      unknown_isymbol=b"",
+ *                      bool attach_new_isymbols=True,
  */
     values[1] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
+    values[2] = ((PyObject *)__pyx_kp_b_);
 
-    /* "pywrapfst.pyx":2238
- *                     _SymbolTable new_isymbols=None,
- *                     bool attach_new_isymbols=True,
- *                     _SymbolTable old_osymbols=None,             # <<<<<<<<<<<<<<
- *                     _SymbolTable new_osymbols=None,
- *                     bool attach_new_osymbols=True):
+    /* "pywrapfst.pyx":2246
+ *                      unknown_isymbol=b"",
+ *                      bool attach_new_isymbols=True,
+ *                      _SymbolTable old_osymbols=None,             # <<<<<<<<<<<<<<
+ *                      _SymbolTable new_osymbols=None,
+ *                      unknown_osymbol=b"",
  */
-    values[3] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
+    values[4] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
 
-    /* "pywrapfst.pyx":2239
- *                     bool attach_new_isymbols=True,
- *                     _SymbolTable old_osymbols=None,
- *                     _SymbolTable new_osymbols=None,             # <<<<<<<<<<<<<<
- *                     bool attach_new_osymbols=True):
- *     """
+    /* "pywrapfst.pyx":2247
+ *                      bool attach_new_isymbols=True,
+ *                      _SymbolTable old_osymbols=None,
+ *                      _SymbolTable new_osymbols=None,             # <<<<<<<<<<<<<<
+ *                      unknown_osymbol=b"",
+ *                      bool attach_new_osymbols=True):
  */
-    values[4] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
+    values[5] = (PyObject *)((struct __pyx_obj_9pywrapfst__SymbolTable *)Py_None);
+    values[6] = ((PyObject *)__pyx_kp_b_);
     if (unlikely(__pyx_kwds)) {
       Py_ssize_t kw_args;
       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
       switch (pos_args) {
+        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
@@ -25873,30 +25932,42 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_41relabel_tables(PyObject *__
         }
         case  2:
         if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attach_new_isymbols);
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unknown_isymbol);
           if (value) { values[2] = value; kw_args--; }
         }
         case  3:
         if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old_osymbols);
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attach_new_isymbols);
           if (value) { values[3] = value; kw_args--; }
         }
         case  4:
         if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new_osymbols);
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_old_osymbols);
           if (value) { values[4] = value; kw_args--; }
         }
         case  5:
         if (kw_args > 0) {
-          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attach_new_osymbols);
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_new_osymbols);
           if (value) { values[5] = value; kw_args--; }
         }
+        case  6:
+        if (kw_args > 0) {
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_unknown_osymbol);
+          if (value) { values[6] = value; kw_args--; }
+        }
+        case  7:
+        if (kw_args > 0) {
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_attach_new_osymbols);
+          if (value) { values[7] = value; kw_args--; }
+        }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "relabel_tables") < 0)) __PYX_ERR(0, 2234, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "relabel_tables") < 0)) __PYX_ERR(0, 2241, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
@@ -25909,29 +25980,31 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_41relabel_tables(PyObject *__
     }
     __pyx_v_old_isymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[0]);
     __pyx_v_new_isymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[1]);
-    if (values[2]) {
-      __pyx_v_attach_new_isymbols = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_attach_new_isymbols == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2237, __pyx_L3_error)
+    __pyx_v_unknown_isymbol = values[2];
+    if (values[3]) {
+      __pyx_v_attach_new_isymbols = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_attach_new_isymbols == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2245, __pyx_L3_error)
     } else {
 
-      /* "pywrapfst.pyx":2237
- *                      _SymbolTable old_isymbols=None,
- *                     _SymbolTable new_isymbols=None,
- *                     bool attach_new_isymbols=True,             # <<<<<<<<<<<<<<
- *                     _SymbolTable old_osymbols=None,
- *                     _SymbolTable new_osymbols=None,
+      /* "pywrapfst.pyx":2245
+ *                      _SymbolTable new_isymbols=None,
+ *                      unknown_isymbol=b"",
+ *                      bool attach_new_isymbols=True,             # <<<<<<<<<<<<<<
+ *                      _SymbolTable old_osymbols=None,
+ *                      _SymbolTable new_osymbols=None,
  */
       __pyx_v_attach_new_isymbols = ((bool)1);
     }
-    __pyx_v_old_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[3]);
-    __pyx_v_new_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[4]);
-    if (values[5]) {
-      __pyx_v_attach_new_osymbols = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_attach_new_osymbols == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2240, __pyx_L3_error)
+    __pyx_v_old_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[4]);
+    __pyx_v_new_osymbols = ((struct __pyx_obj_9pywrapfst__SymbolTable *)values[5]);
+    __pyx_v_unknown_osymbol = values[6];
+    if (values[7]) {
+      __pyx_v_attach_new_osymbols = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_attach_new_osymbols == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2249, __pyx_L3_error)
     } else {
 
-      /* "pywrapfst.pyx":2240
- *                     _SymbolTable old_osymbols=None,
- *                     _SymbolTable new_osymbols=None,
- *                     bool attach_new_osymbols=True):             # <<<<<<<<<<<<<<
+      /* "pywrapfst.pyx":2249
+ *                      _SymbolTable new_osymbols=None,
+ *                      unknown_osymbol=b"",
+ *                      bool attach_new_osymbols=True):             # <<<<<<<<<<<<<<
  *     """
  *     relabel_tables(self, old_isymbols=None, new_isymbols=None,
  */
@@ -25940,24 +26013,24 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_41relabel_tables(PyObject *__
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("relabel_tables", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2234, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("relabel_tables", 0, 0, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2241, __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, 2235, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_isymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "new_isymbols", 0))) __PYX_ERR(0, 2236, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "old_osymbols", 0))) __PYX_ERR(0, 2238, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "new_osymbols", 0))) __PYX_ERR(0, 2239, __pyx_L1_error)
-  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_40relabel_tables(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_old_isymbols, __pyx_v_new_isymbols, __pyx_v_attach_new_isymbols, __pyx_v_old_osymbols, __pyx_v_new_osymbols, __pyx_v_attach_new_osymbols);
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old_isymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "old_isymbols", 0))) __PYX_ERR(0, 2242, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_isymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "new_isymbols", 0))) __PYX_ERR(0, 2243, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "old_osymbols", 0))) __PYX_ERR(0, 2246, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_osymbols), __pyx_ptype_9pywrapfst__SymbolTable, 1, "new_osymbols", 0))) __PYX_ERR(0, 2247, __pyx_L1_error)
+  __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_40relabel_tables(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_old_isymbols, __pyx_v_new_isymbols, __pyx_v_unknown_isymbol, __pyx_v_attach_new_isymbols, __pyx_v_old_osymbols, __pyx_v_new_osymbols, __pyx_v_unknown_osymbol, __pyx_v_attach_new_osymbols);
 
-  /* "pywrapfst.pyx":2234
+  /* "pywrapfst.pyx":2241
  *     self._check_mutating_imethod()
  * 
  *   def relabel_tables(self,             # <<<<<<<<<<<<<<
  *                      _SymbolTable old_isymbols=None,
- *                     _SymbolTable new_isymbols=None,
+ *                      _SymbolTable new_isymbols=None,
  */
 
   /* function exit code */
@@ -25969,43 +26042,45 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_41relabel_tables(PyObject *__
   return __pyx_r;
 }
 
-static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_40relabel_tables(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_isymbols, bool __pyx_v_attach_new_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_osymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_osymbols, bool __pyx_v_attach_new_osymbols) {
+static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_40relabel_tables(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_isymbols, PyObject *__pyx_v_unknown_isymbol, bool __pyx_v_attach_new_isymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_old_osymbols, struct __pyx_obj_9pywrapfst__SymbolTable *__pyx_v_new_osymbols, PyObject *__pyx_v_unknown_osymbol, bool __pyx_v_attach_new_osymbols) {
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
   struct __pyx_opt_args_9pywrapfst_11_MutableFst__relabel_tables __pyx_t_1;
   __Pyx_RefNannySetupContext("relabel_tables", 0);
 
-  /* "pywrapfst.pyx":2271
+  /* "pywrapfst.pyx":2285
  *     See also: `decode`, `encode`, `project`, `relabel_pairs`.
  *     """
- *     self._relabel_tables(old_isymbols, new_isymbols, attach_new_isymbols,             # <<<<<<<<<<<<<<
- *                          old_osymbols, new_osymbols, attach_new_osymbols)
- *     return self
+ *     self._relabel_tables(old_isymbols, new_isymbols,             # <<<<<<<<<<<<<<
+ *                          unknown_isymbol, attach_new_isymbols,
+ *                          old_osymbols, new_osymbols,
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_relabel_tables");
-    __PYX_ERR(0, 2271, __pyx_L1_error)
+    __PYX_ERR(0, 2285, __pyx_L1_error)
   }
 
-  /* "pywrapfst.pyx":2272
- *     """
- *     self._relabel_tables(old_isymbols, new_isymbols, attach_new_isymbols,
- *                          old_osymbols, new_osymbols, attach_new_osymbols)             # <<<<<<<<<<<<<<
+  /* "pywrapfst.pyx":2288
+ *                          unknown_isymbol, attach_new_isymbols,
+ *                          old_osymbols, new_osymbols,
+ *                          unknown_osymbol, attach_new_osymbols)             # <<<<<<<<<<<<<<
  *     return self
  * 
  */
-  __pyx_t_1.__pyx_n = 6;
+  __pyx_t_1.__pyx_n = 8;
   __pyx_t_1.old_isymbols = __pyx_v_old_isymbols;
   __pyx_t_1.new_isymbols = __pyx_v_new_isymbols;
+  __pyx_t_1.unknown_isymbol = __pyx_v_unknown_isymbol;
   __pyx_t_1.attach_new_isymbols = __pyx_v_attach_new_isymbols;
   __pyx_t_1.old_osymbols = __pyx_v_old_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, 2271, __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, 2285, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2273
- *     self._relabel_tables(old_isymbols, new_isymbols, attach_new_isymbols,
- *                          old_osymbols, new_osymbols, attach_new_osymbols)
+  /* "pywrapfst.pyx":2289
+ *                          old_osymbols, new_osymbols,
+ *                          unknown_osymbol, attach_new_osymbols)
  *     return self             # <<<<<<<<<<<<<<
  * 
  *   cdef void _reserve_arcs(self, int64 state, size_t n) except *:
@@ -26015,12 +26090,12 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_40relabel_tables(struct __pyx
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2234
+  /* "pywrapfst.pyx":2241
  *     self._check_mutating_imethod()
  * 
  *   def relabel_tables(self,             # <<<<<<<<<<<<<<
  *                      _SymbolTable old_isymbols=None,
- *                     _SymbolTable new_isymbols=None,
+ *                      _SymbolTable new_isymbols=None,
  */
 
   /* function exit code */
@@ -26033,7 +26108,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_40relabel_tables(struct __pyx
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2275
+/* "pywrapfst.pyx":2291
  *     return self
  * 
  *   cdef void _reserve_arcs(self, int64 state, size_t n) except *:             # <<<<<<<<<<<<<<
@@ -26048,7 +26123,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__reserve_arcs(struct __pyx_obj_9pyw
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("_reserve_arcs", 0);
 
-  /* "pywrapfst.pyx":2276
+  /* "pywrapfst.pyx":2292
  * 
  *   cdef void _reserve_arcs(self, int64 state, size_t n) except *:
  *     if not self._mfst.get().ReserveArcs(state, n):             # <<<<<<<<<<<<<<
@@ -26057,28 +26132,28 @@ static void __pyx_f_9pywrapfst_11_MutableFst__reserve_arcs(struct __pyx_obj_9pyw
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 2276, __pyx_L1_error)
+    __PYX_ERR(0, 2292, __pyx_L1_error)
   }
   __pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->ReserveArcs(__pyx_v_state, __pyx_v_n) != 0)) != 0);
   if (__pyx_t_1) {
 
-    /* "pywrapfst.pyx":2277
+    /* "pywrapfst.pyx":2293
  *   cdef void _reserve_arcs(self, int64 state, size_t n) except *:
  *     if not self._mfst.get().ReserveArcs(state, n):
  *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
  *     self._check_mutating_imethod()
  * 
  */
-    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2277, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2293, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2277, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2293, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __PYX_ERR(0, 2277, __pyx_L1_error)
+    __PYX_ERR(0, 2293, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":2276
+    /* "pywrapfst.pyx":2292
  * 
  *   cdef void _reserve_arcs(self, int64 state, size_t n) except *:
  *     if not self._mfst.get().ReserveArcs(state, n):             # <<<<<<<<<<<<<<
@@ -26087,7 +26162,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__reserve_arcs(struct __pyx_obj_9pyw
  */
   }
 
-  /* "pywrapfst.pyx":2278
+  /* "pywrapfst.pyx":2294
  *     if not self._mfst.get().ReserveArcs(state, n):
  *       raise FstIndexError("State index out of range")
  *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
@@ -26096,11 +26171,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__reserve_arcs(struct __pyx_obj_9pyw
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
-    __PYX_ERR(0, 2278, __pyx_L1_error)
+    __PYX_ERR(0, 2294, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2278, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2294, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2275
+  /* "pywrapfst.pyx":2291
  *     return self
  * 
  *   cdef void _reserve_arcs(self, int64 state, size_t n) except *:             # <<<<<<<<<<<<<<
@@ -26118,7 +26193,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__reserve_arcs(struct __pyx_obj_9pyw
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":2280
+/* "pywrapfst.pyx":2296
  *     self._check_mutating_imethod()
  * 
  *   def reserve_arcs(self, int64 state, size_t n):             # <<<<<<<<<<<<<<
@@ -26155,11 +26230,11 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_43reserve_arcs(PyObject *__py
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("reserve_arcs", 1, 2, 2, 1); __PYX_ERR(0, 2280, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("reserve_arcs", 1, 2, 2, 1); __PYX_ERR(0, 2296, __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, 2280, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reserve_arcs") < 0)) __PYX_ERR(0, 2296, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -26167,12 +26242,12 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_43reserve_arcs(PyObject *__py
       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
     }
-    __pyx_v_state = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2280, __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, 2280, __pyx_L3_error)
+    __pyx_v_state = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2296, __pyx_L3_error)
+    __pyx_v_n = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_n == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2296, __pyx_L3_error)
   }
   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, 2280, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("reserve_arcs", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2296, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("pywrapfst._MutableFst.reserve_arcs", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -26190,7 +26265,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_42reserve_arcs(struct __pyx_o
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("reserve_arcs", 0);
 
-  /* "pywrapfst.pyx":2298
+  /* "pywrapfst.pyx":2314
  *     See also: `reserve_states`.
  *     """
  *     self._reserve_arcs(state, n)             # <<<<<<<<<<<<<<
@@ -26199,11 +26274,11 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_42reserve_arcs(struct __pyx_o
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_reserve_arcs");
-    __PYX_ERR(0, 2298, __pyx_L1_error)
+    __PYX_ERR(0, 2314, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_reserve_arcs(__pyx_v_self, __pyx_v_state, __pyx_v_n); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2298, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_reserve_arcs(__pyx_v_self, __pyx_v_state, __pyx_v_n); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2314, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2299
+  /* "pywrapfst.pyx":2315
  *     """
  *     self._reserve_arcs(state, n)
  *     return self             # <<<<<<<<<<<<<<
@@ -26215,7 +26290,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_42reserve_arcs(struct __pyx_o
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2280
+  /* "pywrapfst.pyx":2296
  *     self._check_mutating_imethod()
  * 
  *   def reserve_arcs(self, int64 state, size_t n):             # <<<<<<<<<<<<<<
@@ -26233,7 +26308,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_42reserve_arcs(struct __pyx_o
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2301
+/* "pywrapfst.pyx":2317
  *     return self
  * 
  *   cdef void _reserve_states(self, int64 n) except *:             # <<<<<<<<<<<<<<
@@ -26245,7 +26320,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__reserve_states(struct __pyx_obj_9p
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_reserve_states", 0);
 
-  /* "pywrapfst.pyx":2302
+  /* "pywrapfst.pyx":2318
  * 
  *   cdef void _reserve_states(self, int64 n) except *:
  *     self._mfst.get().ReserveStates(n)             # <<<<<<<<<<<<<<
@@ -26254,11 +26329,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__reserve_states(struct __pyx_obj_9p
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 2302, __pyx_L1_error)
+    __PYX_ERR(0, 2318, __pyx_L1_error)
   }
   __pyx_v_self->_mfst.get()->ReserveStates(__pyx_v_n);
 
-  /* "pywrapfst.pyx":2303
+  /* "pywrapfst.pyx":2319
  *   cdef void _reserve_states(self, int64 n) except *:
  *     self._mfst.get().ReserveStates(n)
  *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
@@ -26267,11 +26342,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__reserve_states(struct __pyx_obj_9p
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
-    __PYX_ERR(0, 2303, __pyx_L1_error)
+    __PYX_ERR(0, 2319, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2303, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2319, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2301
+  /* "pywrapfst.pyx":2317
  *     return self
  * 
  *   cdef void _reserve_states(self, int64 n) except *:             # <<<<<<<<<<<<<<
@@ -26287,7 +26362,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__reserve_states(struct __pyx_obj_9p
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":2305
+/* "pywrapfst.pyx":2321
  *     self._check_mutating_imethod()
  * 
  *   def reserve_states(self, int64 n):             # <<<<<<<<<<<<<<
@@ -26304,7 +26379,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_45reserve_states(PyObject *__
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("reserve_states (wrapper)", 0);
   assert(__pyx_arg_n); {
-    __pyx_v_n = __Pyx_PyInt_As_int64_t(__pyx_arg_n); if (unlikely((__pyx_v_n == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2305, __pyx_L3_error)
+    __pyx_v_n = __Pyx_PyInt_As_int64_t(__pyx_arg_n); if (unlikely((__pyx_v_n == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2321, __pyx_L3_error)
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L3_error:;
@@ -26324,7 +26399,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_44reserve_states(struct __pyx
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("reserve_states", 0);
 
-  /* "pywrapfst.pyx":2319
+  /* "pywrapfst.pyx":2335
  *     See also: `reserve_arcs`.
  *     """
  *     self._reserve_states(n)             # <<<<<<<<<<<<<<
@@ -26333,11 +26408,11 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_44reserve_states(struct __pyx
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_reserve_states");
-    __PYX_ERR(0, 2319, __pyx_L1_error)
+    __PYX_ERR(0, 2335, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_reserve_states(__pyx_v_self, __pyx_v_n); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2319, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_reserve_states(__pyx_v_self, __pyx_v_n); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2335, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2320
+  /* "pywrapfst.pyx":2336
  *     """
  *     self._reserve_states(n)
  *     return self             # <<<<<<<<<<<<<<
@@ -26349,7 +26424,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_44reserve_states(struct __pyx
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2305
+  /* "pywrapfst.pyx":2321
  *     self._check_mutating_imethod()
  * 
  *   def reserve_states(self, int64 n):             # <<<<<<<<<<<<<<
@@ -26367,7 +26442,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_44reserve_states(struct __pyx
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2322
+/* "pywrapfst.pyx":2338
  *     return self
  * 
  *   cdef void _reweight(self, potentials, bool to_final=False) except *:             # <<<<<<<<<<<<<<
@@ -26394,7 +26469,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__reweight(struct __pyx_obj_9pywrapf
     }
   }
 
-  /* "pywrapfst.pyx":2324
+  /* "pywrapfst.pyx":2340
  *   cdef void _reweight(self, potentials, bool to_final=False) except *:
  *     cdef unique_ptr[vector[fst.WeightClass]] _potentials
  *     _potentials.reset(new vector[fst.WeightClass]())             # <<<<<<<<<<<<<<
@@ -26405,11 +26480,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__reweight(struct __pyx_obj_9pywrapf
     __pyx_t_1 = new std::vector<fst::script::WeightClass> ();
   } catch(...) {
     __Pyx_CppExn2PyErr();
-    __PYX_ERR(0, 2324, __pyx_L1_error)
+    __PYX_ERR(0, 2340, __pyx_L1_error)
   }
   __pyx_v__potentials.reset(__pyx_t_1);
 
-  /* "pywrapfst.pyx":2325
+  /* "pywrapfst.pyx":2341
  *     cdef unique_ptr[vector[fst.WeightClass]] _potentials
  *     _potentials.reset(new vector[fst.WeightClass]())
  *     cdef string weight_type = self.weight_type()             # <<<<<<<<<<<<<<
@@ -26418,11 +26493,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__reweight(struct __pyx_obj_9pywrapf
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "weight_type");
-    __PYX_ERR(0, 2325, __pyx_L1_error)
+    __PYX_ERR(0, 2341, __pyx_L1_error)
   }
   __pyx_v_weight_type = ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), 0);
 
-  /* "pywrapfst.pyx":2326
+  /* "pywrapfst.pyx":2342
  *     _potentials.reset(new vector[fst.WeightClass]())
  *     cdef string weight_type = self.weight_type()
  *     for weight in potentials:             # <<<<<<<<<<<<<<
@@ -26433,26 +26508,26 @@ static void __pyx_f_9pywrapfst_11_MutableFst__reweight(struct __pyx_obj_9pywrapf
     __pyx_t_2 = __pyx_v_potentials; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
     __pyx_t_4 = NULL;
   } else {
-    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_potentials); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2326, __pyx_L1_error)
+    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_potentials); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2342, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2326, __pyx_L1_error)
+    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2342, __pyx_L1_error)
   }
   for (;;) {
     if (likely(!__pyx_t_4)) {
       if (likely(PyList_CheckExact(__pyx_t_2))) {
         if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2326, __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, 2342, __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, 2326, __pyx_L1_error)
+        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2342, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         #endif
       } else {
         if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2326, __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, 2342, __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, 2326, __pyx_L1_error)
+        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2342, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         #endif
       }
@@ -26462,7 +26537,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__reweight(struct __pyx_obj_9pywrapf
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
           if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else __PYX_ERR(0, 2326, __pyx_L1_error)
+          else __PYX_ERR(0, 2342, __pyx_L1_error)
         }
         break;
       }
@@ -26471,7 +26546,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__reweight(struct __pyx_obj_9pywrapf
     __Pyx_XDECREF_SET(__pyx_v_weight, __pyx_t_5);
     __pyx_t_5 = 0;
 
-    /* "pywrapfst.pyx":2327
+    /* "pywrapfst.pyx":2343
  *     cdef string weight_type = self.weight_type()
  *     for weight in potentials:
  *         _potentials.get().push_back(_get_WeightClass_or_One(self.weight_type(),             # <<<<<<<<<<<<<<
@@ -26480,19 +26555,19 @@ static void __pyx_f_9pywrapfst_11_MutableFst__reweight(struct __pyx_obj_9pywrapf
  */
     if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "weight_type");
-      __PYX_ERR(0, 2327, __pyx_L1_error)
+      __PYX_ERR(0, 2343, __pyx_L1_error)
     }
 
-    /* "pywrapfst.pyx":2328
+    /* "pywrapfst.pyx":2344
  *     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, 2327, __pyx_L1_error)
+    __pyx_t_6 = __pyx_f_9pywrapfst__get_WeightClass_or_One(((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2343, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":2327
+    /* "pywrapfst.pyx":2343
  *     cdef string weight_type = self.weight_type()
  *     for weight in potentials:
  *         _potentials.get().push_back(_get_WeightClass_or_One(self.weight_type(),             # <<<<<<<<<<<<<<
@@ -26503,10 +26578,10 @@ static void __pyx_f_9pywrapfst_11_MutableFst__reweight(struct __pyx_obj_9pywrapf
       __pyx_v__potentials.get()->push_back(__pyx_t_6);
     } catch(...) {
       __Pyx_CppExn2PyErr();
-      __PYX_ERR(0, 2327, __pyx_L1_error)
+      __PYX_ERR(0, 2343, __pyx_L1_error)
     }
 
-    /* "pywrapfst.pyx":2326
+    /* "pywrapfst.pyx":2342
  *     _potentials.reset(new vector[fst.WeightClass]())
  *     cdef string weight_type = self.weight_type()
  *     for weight in potentials:             # <<<<<<<<<<<<<<
@@ -26516,7 +26591,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__reweight(struct __pyx_obj_9pywrapf
   }
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2329
+  /* "pywrapfst.pyx":2345
  *         _potentials.get().push_back(_get_WeightClass_or_One(self.weight_type(),
  *                                                             weight))
  *     fst.Reweight(self._mfst.get(), deref(_potentials),             # <<<<<<<<<<<<<<
@@ -26525,10 +26600,10 @@ static void __pyx_f_9pywrapfst_11_MutableFst__reweight(struct __pyx_obj_9pywrapf
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 2329, __pyx_L1_error)
+    __PYX_ERR(0, 2345, __pyx_L1_error)
   }
 
-  /* "pywrapfst.pyx":2330
+  /* "pywrapfst.pyx":2346
  *                                                             weight))
  *     fst.Reweight(self._mfst.get(), deref(_potentials),
  *                  fst.GetReweightType(to_final))             # <<<<<<<<<<<<<<
@@ -26537,7 +26612,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__reweight(struct __pyx_obj_9pywrapf
  */
   fst::script::Reweight(__pyx_v_self->_mfst.get(), (*__pyx_v__potentials), fst::script::GetReweightType(__pyx_v_to_final));
 
-  /* "pywrapfst.pyx":2331
+  /* "pywrapfst.pyx":2347
  *     fst.Reweight(self._mfst.get(), deref(_potentials),
  *                  fst.GetReweightType(to_final))
  *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
@@ -26546,11 +26621,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__reweight(struct __pyx_obj_9pywrapf
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
-    __PYX_ERR(0, 2331, __pyx_L1_error)
+    __PYX_ERR(0, 2347, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2331, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2347, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2322
+  /* "pywrapfst.pyx":2338
  *     return self
  * 
  *   cdef void _reweight(self, potentials, bool to_final=False) except *:             # <<<<<<<<<<<<<<
@@ -26569,7 +26644,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__reweight(struct __pyx_obj_9pywrapf
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":2333
+/* "pywrapfst.pyx":2349
  *     self._check_mutating_imethod()
  * 
  *   def reweight(self, potentials, bool to_final=False):             # <<<<<<<<<<<<<<
@@ -26610,7 +26685,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_47reweight(PyObject *__pyx_v_
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reweight") < 0)) __PYX_ERR(0, 2333, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reweight") < 0)) __PYX_ERR(0, 2349, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -26622,14 +26697,14 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_47reweight(PyObject *__pyx_v_
     }
     __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, 2333, __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, 2349, __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, 2333, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("reweight", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2349, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("pywrapfst._MutableFst.reweight", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -26648,7 +26723,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_46reweight(struct __pyx_obj_9
   struct __pyx_opt_args_9pywrapfst_11_MutableFst__reweight __pyx_t_1;
   __Pyx_RefNannySetupContext("reweight", 0);
 
-  /* "pywrapfst.pyx":2355
+  /* "pywrapfst.pyx":2371
  *       self.
  *     """
  *     self._reweight(potentials, to_final)             # <<<<<<<<<<<<<<
@@ -26657,13 +26732,13 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_46reweight(struct __pyx_obj_9
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_reweight");
-    __PYX_ERR(0, 2355, __pyx_L1_error)
+    __PYX_ERR(0, 2371, __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, 2355, __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, 2371, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2356
+  /* "pywrapfst.pyx":2372
  *     """
  *     self._reweight(potentials, to_final)
  *     return self             # <<<<<<<<<<<<<<
@@ -26675,7 +26750,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_46reweight(struct __pyx_obj_9
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2333
+  /* "pywrapfst.pyx":2349
  *     self._check_mutating_imethod()
  * 
  *   def reweight(self, potentials, bool to_final=False):             # <<<<<<<<<<<<<<
@@ -26693,7 +26768,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_46reweight(struct __pyx_obj_9
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2358
+/* "pywrapfst.pyx":2374
  *     return self
  * 
  *   cdef void _rmepsilon(self,             # <<<<<<<<<<<<<<
@@ -26703,7 +26778,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_46reweight(struct __pyx_obj_9
 
 static void __pyx_f_9pywrapfst_11_MutableFst__rmepsilon(struct __pyx_obj_9pywrapfst__MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_11_MutableFst__rmepsilon *__pyx_optional_args) {
 
-  /* "pywrapfst.pyx":2359
+  /* "pywrapfst.pyx":2375
  * 
  *   cdef void _rmepsilon(self,
  *                        bool connect=True,             # <<<<<<<<<<<<<<
@@ -26714,7 +26789,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__rmepsilon(struct __pyx_obj_9pywrap
   float __pyx_v_delta = __pyx_k__22;
   __pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__23;
 
-  /* "pywrapfst.pyx":2362
+  /* "pywrapfst.pyx":2378
  *                        float delta=fst.kDelta,
  *                        int64 nstate=fst.kNoStateId,
  *                        weight=None) except *:             # <<<<<<<<<<<<<<
@@ -26741,7 +26816,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__rmepsilon(struct __pyx_obj_9pywrap
     }
   }
 
-  /* "pywrapfst.pyx":2364
+  /* "pywrapfst.pyx":2380
  *                        weight=None) except *:
  *     # Threshold is set to semiring Zero (no pruning) if weight unspecified.
  *     cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(),             # <<<<<<<<<<<<<<
@@ -26750,20 +26825,20 @@ static void __pyx_f_9pywrapfst_11_MutableFst__rmepsilon(struct __pyx_obj_9pywrap
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "weight_type");
-    __PYX_ERR(0, 2364, __pyx_L1_error)
+    __PYX_ERR(0, 2380, __pyx_L1_error)
   }
 
-  /* "pywrapfst.pyx":2365
+  /* "pywrapfst.pyx":2381
  *     # Threshold is set to semiring Zero (no pruning) if weight unspecified.
  *     cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(),
  *                                                        weight)             # <<<<<<<<<<<<<<
  *     fst.RmEpsilon(self._mfst.get(), connect, wc, nstate, delta)
  *     self._check_mutating_imethod()
  */
-  __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2364, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2380, __pyx_L1_error)
   __pyx_v_wc = __pyx_t_1;
 
-  /* "pywrapfst.pyx":2366
+  /* "pywrapfst.pyx":2382
  *     cdef fst.WeightClass wc = _get_WeightClass_or_Zero(self.weight_type(),
  *                                                        weight)
  *     fst.RmEpsilon(self._mfst.get(), connect, wc, nstate, delta)             # <<<<<<<<<<<<<<
@@ -26772,11 +26847,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__rmepsilon(struct __pyx_obj_9pywrap
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 2366, __pyx_L1_error)
+    __PYX_ERR(0, 2382, __pyx_L1_error)
   }
   fst::script::RmEpsilon(__pyx_v_self->_mfst.get(), __pyx_v_connect, __pyx_v_wc, __pyx_v_nstate, __pyx_v_delta);
 
-  /* "pywrapfst.pyx":2367
+  /* "pywrapfst.pyx":2383
  *                                                        weight)
  *     fst.RmEpsilon(self._mfst.get(), connect, wc, nstate, delta)
  *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
@@ -26785,11 +26860,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__rmepsilon(struct __pyx_obj_9pywrap
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
-    __PYX_ERR(0, 2367, __pyx_L1_error)
+    __PYX_ERR(0, 2383, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2367, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2383, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2358
+  /* "pywrapfst.pyx":2374
  *     return self
  * 
  *   cdef void _rmepsilon(self,             # <<<<<<<<<<<<<<
@@ -26805,7 +26880,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__rmepsilon(struct __pyx_obj_9pywrap
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":2369
+/* "pywrapfst.pyx":2385
  *     self._check_mutating_imethod()
  * 
  *   def rmepsilon(self,             # <<<<<<<<<<<<<<
@@ -26828,7 +26903,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_49rmepsilon(PyObject *__pyx_v
     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_connect,&__pyx_n_s_delta,&__pyx_n_s_nstate,&__pyx_n_s_weight,0};
     PyObject* values[4] = {0,0,0,0};
 
-    /* "pywrapfst.pyx":2373
+    /* "pywrapfst.pyx":2389
  *                 float delta=fst.kDelta,
  *                 int64 nstate=fst.kNoStateId,
  *                 weight=None):             # <<<<<<<<<<<<<<
@@ -26871,7 +26946,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_49rmepsilon(PyObject *__pyx_v
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rmepsilon") < 0)) __PYX_ERR(0, 2369, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rmepsilon") < 0)) __PYX_ERR(0, 2385, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -26884,10 +26959,10 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_49rmepsilon(PyObject *__pyx_v
       }
     }
     if (values[0]) {
-      __pyx_v_connect = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2370, __pyx_L3_error)
+      __pyx_v_connect = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2386, __pyx_L3_error)
     } else {
 
-      /* "pywrapfst.pyx":2370
+      /* "pywrapfst.pyx":2386
  * 
  *   def rmepsilon(self,
  *                 bool connect=True,             # <<<<<<<<<<<<<<
@@ -26897,12 +26972,12 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_49rmepsilon(PyObject *__pyx_v
       __pyx_v_connect = ((bool)1);
     }
     if (values[1]) {
-      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2371, __pyx_L3_error)
+      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2387, __pyx_L3_error)
     } else {
       __pyx_v_delta = __pyx_k__24;
     }
     if (values[2]) {
-      __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2372, __pyx_L3_error)
+      __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2388, __pyx_L3_error)
     } else {
       __pyx_v_nstate = __pyx_k__25;
     }
@@ -26910,7 +26985,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_49rmepsilon(PyObject *__pyx_v
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("rmepsilon", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2369, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("rmepsilon", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2385, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("pywrapfst._MutableFst.rmepsilon", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -26918,7 +26993,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_49rmepsilon(PyObject *__pyx_v
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_48rmepsilon(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), __pyx_v_connect, __pyx_v_delta, __pyx_v_nstate, __pyx_v_weight);
 
-  /* "pywrapfst.pyx":2369
+  /* "pywrapfst.pyx":2385
  *     self._check_mutating_imethod()
  * 
  *   def rmepsilon(self,             # <<<<<<<<<<<<<<
@@ -26937,7 +27012,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_48rmepsilon(struct __pyx_obj_
   struct __pyx_opt_args_9pywrapfst_11_MutableFst__rmepsilon __pyx_t_1;
   __Pyx_RefNannySetupContext("rmepsilon", 0);
 
-  /* "pywrapfst.pyx":2395
+  /* "pywrapfst.pyx":2411
  *         reverse (and which may be more efficient).
  *     """
  *     self._rmepsilon(connect, delta, nstate, weight)             # <<<<<<<<<<<<<<
@@ -26946,16 +27021,16 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_48rmepsilon(struct __pyx_obj_
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_rmepsilon");
-    __PYX_ERR(0, 2395, __pyx_L1_error)
+    __PYX_ERR(0, 2411, __pyx_L1_error)
   }
   __pyx_t_1.__pyx_n = 4;
   __pyx_t_1.connect = __pyx_v_connect;
   __pyx_t_1.delta = __pyx_v_delta;
   __pyx_t_1.nstate = __pyx_v_nstate;
   __pyx_t_1.weight = __pyx_v_weight;
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_rmepsilon(__pyx_v_self, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2395, __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, 2411, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2396
+  /* "pywrapfst.pyx":2412
  *     """
  *     self._rmepsilon(connect, delta, nstate, weight)
  *     return self             # <<<<<<<<<<<<<<
@@ -26967,7 +27042,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_48rmepsilon(struct __pyx_obj_
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2369
+  /* "pywrapfst.pyx":2385
  *     self._check_mutating_imethod()
  * 
  *   def rmepsilon(self,             # <<<<<<<<<<<<<<
@@ -26985,7 +27060,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_48rmepsilon(struct __pyx_obj_
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2398
+/* "pywrapfst.pyx":2414
  *     return self
  * 
  *   cdef void _set_final(self, int64 state, weight=None) except *:             # <<<<<<<<<<<<<<
@@ -27008,7 +27083,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_final(struct __pyx_obj_9pywrap
     }
   }
 
-  /* "pywrapfst.pyx":2399
+  /* "pywrapfst.pyx":2415
  * 
  *   cdef void _set_final(self, int64 state, weight=None) except *:
  *     if not self._mfst.get().ValidStateId(state):             # <<<<<<<<<<<<<<
@@ -27017,28 +27092,28 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_final(struct __pyx_obj_9pywrap
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 2399, __pyx_L1_error)
+    __PYX_ERR(0, 2415, __pyx_L1_error)
   }
   __pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->ValidStateId(__pyx_v_state) != 0)) != 0);
   if (__pyx_t_1) {
 
-    /* "pywrapfst.pyx":2400
+    /* "pywrapfst.pyx":2416
  *   cdef void _set_final(self, int64 state, weight=None) except *:
  *     if not self._mfst.get().ValidStateId(state):
  *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
  *     cdef fst.WeightClass wc = _get_WeightClass_or_One(self.weight_type(),
  *                                                       weight)
  */
-    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2400, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2416, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2400, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2416, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __PYX_ERR(0, 2400, __pyx_L1_error)
+    __PYX_ERR(0, 2416, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":2399
+    /* "pywrapfst.pyx":2415
  * 
  *   cdef void _set_final(self, int64 state, weight=None) except *:
  *     if not self._mfst.get().ValidStateId(state):             # <<<<<<<<<<<<<<
@@ -27047,7 +27122,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_final(struct __pyx_obj_9pywrap
  */
   }
 
-  /* "pywrapfst.pyx":2401
+  /* "pywrapfst.pyx":2417
  *     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(),             # <<<<<<<<<<<<<<
@@ -27056,72 +27131,72 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_final(struct __pyx_obj_9pywrap
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "weight_type");
-    __PYX_ERR(0, 2401, __pyx_L1_error)
+    __PYX_ERR(0, 2417, __pyx_L1_error)
   }
 
-  /* "pywrapfst.pyx":2402
+  /* "pywrapfst.pyx":2418
  *       raise FstIndexError("State index out of range")
  *     cdef fst.WeightClass wc = _get_WeightClass_or_One(self.weight_type(),
  *                                                       weight)             # <<<<<<<<<<<<<<
  *     if not self._mfst.get().SetFinal(state, wc):
- *       raise FstOpError("incompatible or invalid weight")
+ *       raise FstOpError("Incompatible or invalid weight")
  */
-  __pyx_t_4 = __pyx_f_9pywrapfst__get_WeightClass_or_One(((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2401, __pyx_L1_error)
+  __pyx_t_4 = __pyx_f_9pywrapfst__get_WeightClass_or_One(((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.weight_type(((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_self), 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2417, __pyx_L1_error)
   __pyx_v_wc = __pyx_t_4;
 
-  /* "pywrapfst.pyx":2403
+  /* "pywrapfst.pyx":2419
  *     cdef fst.WeightClass wc = _get_WeightClass_or_One(self.weight_type(),
  *                                                       weight)
  *     if not self._mfst.get().SetFinal(state, wc):             # <<<<<<<<<<<<<<
- *       raise FstOpError("incompatible or invalid weight")
+ *       raise FstOpError("Incompatible or invalid weight")
  *     self._check_mutating_imethod()
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 2403, __pyx_L1_error)
+    __PYX_ERR(0, 2419, __pyx_L1_error)
   }
   __pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->SetFinal(__pyx_v_state, __pyx_v_wc) != 0)) != 0);
   if (__pyx_t_1) {
 
-    /* "pywrapfst.pyx":2404
+    /* "pywrapfst.pyx":2420
  *                                                       weight)
  *     if not self._mfst.get().SetFinal(state, wc):
- *       raise FstOpError("incompatible or invalid weight")             # <<<<<<<<<<<<<<
+ *       raise FstOpError("Incompatible or invalid weight")             # <<<<<<<<<<<<<<
  *     self._check_mutating_imethod()
  * 
  */
-    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2404, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2420, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2404, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2420, __pyx_L1_error)
     __Pyx_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, 2404, __pyx_L1_error)
+    __PYX_ERR(0, 2420, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":2403
+    /* "pywrapfst.pyx":2419
  *     cdef fst.WeightClass wc = _get_WeightClass_or_One(self.weight_type(),
  *                                                       weight)
  *     if not self._mfst.get().SetFinal(state, wc):             # <<<<<<<<<<<<<<
- *       raise FstOpError("incompatible or invalid weight")
+ *       raise FstOpError("Incompatible or invalid weight")
  *     self._check_mutating_imethod()
  */
   }
 
-  /* "pywrapfst.pyx":2405
+  /* "pywrapfst.pyx":2421
  *     if not self._mfst.get().SetFinal(state, wc):
- *       raise FstOpError("incompatible or invalid weight")
+ *       raise FstOpError("Incompatible or invalid weight")
  *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
  * 
  *   def set_final(self, int64 state, weight=None):
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
-    __PYX_ERR(0, 2405, __pyx_L1_error)
+    __PYX_ERR(0, 2421, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2405, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2421, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2398
+  /* "pywrapfst.pyx":2414
  *     return self
  * 
  *   cdef void _set_final(self, int64 state, weight=None) except *:             # <<<<<<<<<<<<<<
@@ -27139,7 +27214,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_final(struct __pyx_obj_9pywrap
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":2407
+/* "pywrapfst.pyx":2423
  *     self._check_mutating_imethod()
  * 
  *   def set_final(self, int64 state, weight=None):             # <<<<<<<<<<<<<<
@@ -27149,7 +27224,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_final(struct __pyx_obj_9pywrap
 
 /* Python wrapper */
 static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_51set_final(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9pywrapfst_11_MutableFst_50set_final[] = "\n    set_final(self, state, weight)\n\n    Sets a state to be final with a fixed cost.\n\n    Args:\n      state: The integer index of a state.\n      weight: A Weight or weight string indicating the desired final weight; if\n          omitted, it is set to semiring One.\n\n    Raises:\n      FstIndexError: State index out of range.\n      FstOpError: incompatible or invalid weight.\n\n    See also: `set_start`.\n    ";
+static char __pyx_doc_9pywrapfst_11_MutableFst_50set_final[] = "\n    set_final(self, state, weight)\n\n    Sets a state to be final with a fixed cost.\n\n    Args:\n      state: The integer index of a state.\n      weight: A Weight or weight string indicating the desired final weight; if\n          omitted, it is set to semiring One.\n\n    Raises:\n      FstIndexError: State index out of range.\n      FstOpError: Incompatible or invalid weight.\n\n    See also: `set_start`.\n    ";
 static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_51set_final(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   __pyx_t_10basictypes_int64 __pyx_v_state;
   PyObject *__pyx_v_weight = 0;
@@ -27181,7 +27256,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_51set_final(PyObject *__pyx_v
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_final") < 0)) __PYX_ERR(0, 2407, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_final") < 0)) __PYX_ERR(0, 2423, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -27191,12 +27266,12 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_51set_final(PyObject *__pyx_v
         default: goto __pyx_L5_argtuple_error;
       }
     }
-    __pyx_v_state = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2407, __pyx_L3_error)
+    __pyx_v_state = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2423, __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, 2407, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("set_final", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2423, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("pywrapfst._MutableFst.set_final", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -27215,7 +27290,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_50set_final(struct __pyx_obj_
   struct __pyx_opt_args_9pywrapfst_11_MutableFst__set_final __pyx_t_1;
   __Pyx_RefNannySetupContext("set_final", 0);
 
-  /* "pywrapfst.pyx":2424
+  /* "pywrapfst.pyx":2440
  *     See also: `set_start`.
  *     """
  *     self._set_final(state, weight)             # <<<<<<<<<<<<<<
@@ -27224,13 +27299,13 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_50set_final(struct __pyx_obj_
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_set_final");
-    __PYX_ERR(0, 2424, __pyx_L1_error)
+    __PYX_ERR(0, 2440, __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, 2424, __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, 2440, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2425
+  /* "pywrapfst.pyx":2441
  *     """
  *     self._set_final(state, weight)
  *     return self             # <<<<<<<<<<<<<<
@@ -27242,7 +27317,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_50set_final(struct __pyx_obj_
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2407
+  /* "pywrapfst.pyx":2423
  *     self._check_mutating_imethod()
  * 
  *   def set_final(self, int64 state, weight=None):             # <<<<<<<<<<<<<<
@@ -27260,7 +27335,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_50set_final(struct __pyx_obj_
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2427
+/* "pywrapfst.pyx":2443
  *     return self
  * 
  *   cdef void _set_properties(self, uint64 props, uint64 mask) except *:             # <<<<<<<<<<<<<<
@@ -27272,7 +27347,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_properties(struct __pyx_obj_9p
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_set_properties", 0);
 
-  /* "pywrapfst.pyx":2428
+  /* "pywrapfst.pyx":2444
  * 
  *   cdef void _set_properties(self, uint64 props, uint64 mask) except *:
  *     self._mfst.get().SetProperties(props, mask)             # <<<<<<<<<<<<<<
@@ -27281,11 +27356,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_properties(struct __pyx_obj_9p
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 2428, __pyx_L1_error)
+    __PYX_ERR(0, 2444, __pyx_L1_error)
   }
   __pyx_v_self->_mfst.get()->SetProperties(__pyx_v_props, __pyx_v_mask);
 
-  /* "pywrapfst.pyx":2427
+  /* "pywrapfst.pyx":2443
  *     return self
  * 
  *   cdef void _set_properties(self, uint64 props, uint64 mask) except *:             # <<<<<<<<<<<<<<
@@ -27301,7 +27376,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_properties(struct __pyx_obj_9p
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":2430
+/* "pywrapfst.pyx":2446
  *     self._mfst.get().SetProperties(props, mask)
  * 
  *   def set_properties(self, uint64 props, uint64 mask):             # <<<<<<<<<<<<<<
@@ -27338,11 +27413,11 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_53set_properties(PyObject *__
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("set_properties", 1, 2, 2, 1); __PYX_ERR(0, 2430, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("set_properties", 1, 2, 2, 1); __PYX_ERR(0, 2446, __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, 2430, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_properties") < 0)) __PYX_ERR(0, 2446, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -27350,12 +27425,12 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_53set_properties(PyObject *__
       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
     }
-    __pyx_v_props = __Pyx_PyInt_As_uint64_t(values[0]); if (unlikely((__pyx_v_props == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2430, __pyx_L3_error)
-    __pyx_v_mask = __Pyx_PyInt_As_uint64_t(values[1]); if (unlikely((__pyx_v_mask == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2430, __pyx_L3_error)
+    __pyx_v_props = __Pyx_PyInt_As_uint64_t(values[0]); if (unlikely((__pyx_v_props == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2446, __pyx_L3_error)
+    __pyx_v_mask = __Pyx_PyInt_As_uint64_t(values[1]); if (unlikely((__pyx_v_mask == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2446, __pyx_L3_error)
   }
   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, 2430, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("set_properties", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2446, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("pywrapfst._MutableFst.set_properties", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -27373,7 +27448,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_52set_properties(struct __pyx
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("set_properties", 0);
 
-  /* "pywrapfst.pyx":2444
+  /* "pywrapfst.pyx":2460
  *       self.
  *     """
  *     self._set_properties(props, mask)             # <<<<<<<<<<<<<<
@@ -27382,11 +27457,11 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_52set_properties(struct __pyx
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_set_properties");
-    __PYX_ERR(0, 2444, __pyx_L1_error)
+    __PYX_ERR(0, 2460, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_properties(__pyx_v_self, __pyx_v_props, __pyx_v_mask); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2444, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_properties(__pyx_v_self, __pyx_v_props, __pyx_v_mask); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2460, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2445
+  /* "pywrapfst.pyx":2461
  *     """
  *     self._set_properties(props, mask)
  *     return self             # <<<<<<<<<<<<<<
@@ -27398,7 +27473,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_52set_properties(struct __pyx
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2430
+  /* "pywrapfst.pyx":2446
  *     self._mfst.get().SetProperties(props, mask)
  * 
  *   def set_properties(self, uint64 props, uint64 mask):             # <<<<<<<<<<<<<<
@@ -27416,7 +27491,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_52set_properties(struct __pyx
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2447
+/* "pywrapfst.pyx":2463
  *     return self
  * 
  *   cdef void _set_start(self, int64 state) except *:             # <<<<<<<<<<<<<<
@@ -27431,7 +27506,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_start(struct __pyx_obj_9pywrap
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("_set_start", 0);
 
-  /* "pywrapfst.pyx":2448
+  /* "pywrapfst.pyx":2464
  * 
  *   cdef void _set_start(self, int64 state) except *:
  *     if not self._mfst.get().SetStart(state):             # <<<<<<<<<<<<<<
@@ -27440,28 +27515,28 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_start(struct __pyx_obj_9pywrap
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 2448, __pyx_L1_error)
+    __PYX_ERR(0, 2464, __pyx_L1_error)
   }
   __pyx_t_1 = ((!(__pyx_v_self->_mfst.get()->SetStart(__pyx_v_state) != 0)) != 0);
   if (__pyx_t_1) {
 
-    /* "pywrapfst.pyx":2449
+    /* "pywrapfst.pyx":2465
  *   cdef void _set_start(self, int64 state) except *:
  *     if not self._mfst.get().SetStart(state):
  *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
  *     self._check_mutating_imethod()
  * 
  */
-    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2449, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2465, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2449, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2465, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __PYX_ERR(0, 2449, __pyx_L1_error)
+    __PYX_ERR(0, 2465, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":2448
+    /* "pywrapfst.pyx":2464
  * 
  *   cdef void _set_start(self, int64 state) except *:
  *     if not self._mfst.get().SetStart(state):             # <<<<<<<<<<<<<<
@@ -27470,7 +27545,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_start(struct __pyx_obj_9pywrap
  */
   }
 
-  /* "pywrapfst.pyx":2450
+  /* "pywrapfst.pyx":2466
  *     if not self._mfst.get().SetStart(state):
  *       raise FstIndexError("State index out of range")
  *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
@@ -27479,11 +27554,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_start(struct __pyx_obj_9pywrap
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
-    __PYX_ERR(0, 2450, __pyx_L1_error)
+    __PYX_ERR(0, 2466, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2450, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2466, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2447
+  /* "pywrapfst.pyx":2463
  *     return self
  * 
  *   cdef void _set_start(self, int64 state) except *:             # <<<<<<<<<<<<<<
@@ -27501,7 +27576,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_start(struct __pyx_obj_9pywrap
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":2452
+/* "pywrapfst.pyx":2468
  *     self._check_mutating_imethod()
  * 
  *   def set_start(self, int64 state):             # <<<<<<<<<<<<<<
@@ -27518,7 +27593,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_55set_start(PyObject *__pyx_v
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("set_start (wrapper)", 0);
   assert(__pyx_arg_state); {
-    __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2452, __pyx_L3_error)
+    __pyx_v_state = __Pyx_PyInt_As_int64_t(__pyx_arg_state); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2468, __pyx_L3_error)
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L3_error:;
@@ -27538,7 +27613,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_54set_start(struct __pyx_obj_
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("set_start", 0);
 
-  /* "pywrapfst.pyx":2469
+  /* "pywrapfst.pyx":2485
  *     See also: `set_final`.
  *     """
  *     self._set_start(state)             # <<<<<<<<<<<<<<
@@ -27547,11 +27622,11 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_54set_start(struct __pyx_obj_
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_set_start");
-    __PYX_ERR(0, 2469, __pyx_L1_error)
+    __PYX_ERR(0, 2485, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_start(__pyx_v_self, __pyx_v_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2469, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_start(__pyx_v_self, __pyx_v_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2485, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2470
+  /* "pywrapfst.pyx":2486
  *     """
  *     self._set_start(state)
  *     return self             # <<<<<<<<<<<<<<
@@ -27563,7 +27638,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_54set_start(struct __pyx_obj_
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2452
+  /* "pywrapfst.pyx":2468
  *     self._check_mutating_imethod()
  * 
  *   def set_start(self, int64 state):             # <<<<<<<<<<<<<<
@@ -27581,7 +27656,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_54set_start(struct __pyx_obj_
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2472
+/* "pywrapfst.pyx":2488
  *     return self
  * 
  *   cdef void _set_input_symbols(self, _SymbolTable syms) except *:             # <<<<<<<<<<<<<<
@@ -27595,7 +27670,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_input_symbols(struct __pyx_obj
   int __pyx_t_2;
   __Pyx_RefNannySetupContext("_set_input_symbols", 0);
 
-  /* "pywrapfst.pyx":2473
+  /* "pywrapfst.pyx":2489
  * 
  *   cdef void _set_input_symbols(self, _SymbolTable syms) except *:
  *     if syms is None:             # <<<<<<<<<<<<<<
@@ -27606,7 +27681,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_input_symbols(struct __pyx_obj
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "pywrapfst.pyx":2474
+    /* "pywrapfst.pyx":2490
  *   cdef void _set_input_symbols(self, _SymbolTable syms) except *:
  *     if syms is None:
  *       self._mfst.get().SetInputSymbols(NULL)             # <<<<<<<<<<<<<<
@@ -27615,11 +27690,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_input_symbols(struct __pyx_obj
  */
     if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-      __PYX_ERR(0, 2474, __pyx_L1_error)
+      __PYX_ERR(0, 2490, __pyx_L1_error)
     }
     __pyx_v_self->_mfst.get()->SetInputSymbols(NULL);
 
-    /* "pywrapfst.pyx":2475
+    /* "pywrapfst.pyx":2491
  *     if syms is None:
  *       self._mfst.get().SetInputSymbols(NULL)
  *       return             # <<<<<<<<<<<<<<
@@ -27628,7 +27703,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_input_symbols(struct __pyx_obj
  */
     goto __pyx_L0;
 
-    /* "pywrapfst.pyx":2473
+    /* "pywrapfst.pyx":2489
  * 
  *   cdef void _set_input_symbols(self, _SymbolTable syms) except *:
  *     if syms is None:             # <<<<<<<<<<<<<<
@@ -27637,7 +27712,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_input_symbols(struct __pyx_obj
  */
   }
 
-  /* "pywrapfst.pyx":2476
+  /* "pywrapfst.pyx":2492
  *       self._mfst.get().SetInputSymbols(NULL)
  *       return
  *     self._mfst.get().SetInputSymbols(syms._table)             # <<<<<<<<<<<<<<
@@ -27646,15 +27721,15 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_input_symbols(struct __pyx_obj
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 2476, __pyx_L1_error)
+    __PYX_ERR(0, 2492, __pyx_L1_error)
   }
   if (unlikely(((PyObject *)__pyx_v_syms) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
-    __PYX_ERR(0, 2476, __pyx_L1_error)
+    __PYX_ERR(0, 2492, __pyx_L1_error)
   }
   __pyx_v_self->_mfst.get()->SetInputSymbols(__pyx_v_syms->_table);
 
-  /* "pywrapfst.pyx":2477
+  /* "pywrapfst.pyx":2493
  *       return
  *     self._mfst.get().SetInputSymbols(syms._table)
  *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
@@ -27663,11 +27738,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_input_symbols(struct __pyx_obj
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
-    __PYX_ERR(0, 2477, __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, 2477, __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":2472
+  /* "pywrapfst.pyx":2488
  *     return self
  * 
  *   cdef void _set_input_symbols(self, _SymbolTable syms) except *:             # <<<<<<<<<<<<<<
@@ -27683,7 +27758,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_input_symbols(struct __pyx_obj
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":2479
+/* "pywrapfst.pyx":2495
  *     self._check_mutating_imethod()
  * 
  *   def set_input_symbols(self, _SymbolTable syms):             # <<<<<<<<<<<<<<
@@ -27698,7 +27773,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_57set_input_symbols(PyObject
   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, 2479, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 2495, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_56set_input_symbols(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_syms));
 
   /* function exit code */
@@ -27715,7 +27790,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_56set_input_symbols(struct __
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("set_input_symbols", 0);
 
-  /* "pywrapfst.pyx":2495
+  /* "pywrapfst.pyx":2511
  *     See also: `set_output_symbols`.
  *     """
  *     self._set_input_symbols(syms)             # <<<<<<<<<<<<<<
@@ -27724,11 +27799,11 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_56set_input_symbols(struct __
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_set_input_symbols");
-    __PYX_ERR(0, 2495, __pyx_L1_error)
+    __PYX_ERR(0, 2511, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_input_symbols(__pyx_v_self, __pyx_v_syms); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2495, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_input_symbols(__pyx_v_self, __pyx_v_syms); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2511, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2496
+  /* "pywrapfst.pyx":2512
  *     """
  *     self._set_input_symbols(syms)
  *     return self             # <<<<<<<<<<<<<<
@@ -27740,7 +27815,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_56set_input_symbols(struct __
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2479
+  /* "pywrapfst.pyx":2495
  *     self._check_mutating_imethod()
  * 
  *   def set_input_symbols(self, _SymbolTable syms):             # <<<<<<<<<<<<<<
@@ -27758,7 +27833,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_56set_input_symbols(struct __
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2498
+/* "pywrapfst.pyx":2514
  *     return self
  * 
  *   cdef void _set_output_symbols(self, _SymbolTable syms) except *:             # <<<<<<<<<<<<<<
@@ -27772,7 +27847,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_output_symbols(struct __pyx_ob
   int __pyx_t_2;
   __Pyx_RefNannySetupContext("_set_output_symbols", 0);
 
-  /* "pywrapfst.pyx":2499
+  /* "pywrapfst.pyx":2515
  * 
  *   cdef void _set_output_symbols(self, _SymbolTable syms) except *:
  *     if syms is None:             # <<<<<<<<<<<<<<
@@ -27783,7 +27858,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_output_symbols(struct __pyx_ob
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "pywrapfst.pyx":2500
+    /* "pywrapfst.pyx":2516
  *   cdef void _set_output_symbols(self, _SymbolTable syms) except *:
  *     if syms is None:
  *       self._mfst.get().SetOutputSymbols(NULL)             # <<<<<<<<<<<<<<
@@ -27792,11 +27867,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_output_symbols(struct __pyx_ob
  */
     if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-      __PYX_ERR(0, 2500, __pyx_L1_error)
+      __PYX_ERR(0, 2516, __pyx_L1_error)
     }
     __pyx_v_self->_mfst.get()->SetOutputSymbols(NULL);
 
-    /* "pywrapfst.pyx":2501
+    /* "pywrapfst.pyx":2517
  *     if syms is None:
  *       self._mfst.get().SetOutputSymbols(NULL)
  *       return             # <<<<<<<<<<<<<<
@@ -27805,7 +27880,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_output_symbols(struct __pyx_ob
  */
     goto __pyx_L0;
 
-    /* "pywrapfst.pyx":2499
+    /* "pywrapfst.pyx":2515
  * 
  *   cdef void _set_output_symbols(self, _SymbolTable syms) except *:
  *     if syms is None:             # <<<<<<<<<<<<<<
@@ -27814,7 +27889,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_output_symbols(struct __pyx_ob
  */
   }
 
-  /* "pywrapfst.pyx":2502
+  /* "pywrapfst.pyx":2518
  *       self._mfst.get().SetOutputSymbols(NULL)
  *       return
  *     self._mfst.get().SetOutputSymbols(syms._table)             # <<<<<<<<<<<<<<
@@ -27823,15 +27898,15 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_output_symbols(struct __pyx_ob
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 2502, __pyx_L1_error)
+    __PYX_ERR(0, 2518, __pyx_L1_error)
   }
   if (unlikely(((PyObject *)__pyx_v_syms) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
-    __PYX_ERR(0, 2502, __pyx_L1_error)
+    __PYX_ERR(0, 2518, __pyx_L1_error)
   }
   __pyx_v_self->_mfst.get()->SetOutputSymbols(__pyx_v_syms->_table);
 
-  /* "pywrapfst.pyx":2503
+  /* "pywrapfst.pyx":2519
  *       return
  *     self._mfst.get().SetOutputSymbols(syms._table)
  *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
@@ -27840,11 +27915,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_output_symbols(struct __pyx_ob
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
-    __PYX_ERR(0, 2503, __pyx_L1_error)
+    __PYX_ERR(0, 2519, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2503, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2519, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2498
+  /* "pywrapfst.pyx":2514
  *     return self
  * 
  *   cdef void _set_output_symbols(self, _SymbolTable syms) except *:             # <<<<<<<<<<<<<<
@@ -27860,7 +27935,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__set_output_symbols(struct __pyx_ob
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":2505
+/* "pywrapfst.pyx":2521
  *     self._check_mutating_imethod()
  * 
  *   def set_output_symbols(self, _SymbolTable syms):             # <<<<<<<<<<<<<<
@@ -27875,7 +27950,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_59set_output_symbols(PyObject
   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, 2505, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_syms), __pyx_ptype_9pywrapfst__SymbolTable, 1, "syms", 0))) __PYX_ERR(0, 2521, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_58set_output_symbols(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst__SymbolTable *)__pyx_v_syms));
 
   /* function exit code */
@@ -27892,7 +27967,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_58set_output_symbols(struct _
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("set_output_symbols", 0);
 
-  /* "pywrapfst.pyx":2521
+  /* "pywrapfst.pyx":2537
  *     See also: `set_input_symbols`.
  *     """
  *     self._set_output_symbols(syms)             # <<<<<<<<<<<<<<
@@ -27901,11 +27976,11 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_58set_output_symbols(struct _
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_set_output_symbols");
-    __PYX_ERR(0, 2521, __pyx_L1_error)
+    __PYX_ERR(0, 2537, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_output_symbols(__pyx_v_self, __pyx_v_syms); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2521, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_output_symbols(__pyx_v_self, __pyx_v_syms); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2537, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2522
+  /* "pywrapfst.pyx":2538
  *     """
  *     self._set_output_symbols(syms)
  *     return self             # <<<<<<<<<<<<<<
@@ -27917,7 +27992,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_58set_output_symbols(struct _
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2505
+  /* "pywrapfst.pyx":2521
  *     self._check_mutating_imethod()
  * 
  *   def set_output_symbols(self, _SymbolTable syms):             # <<<<<<<<<<<<<<
@@ -27935,7 +28010,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_58set_output_symbols(struct _
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2524
+/* "pywrapfst.pyx":2540
  *     return self
  * 
  *   cdef void _topsort(self) except *:             # <<<<<<<<<<<<<<
@@ -27950,7 +28025,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__topsort(struct __pyx_obj_9pywrapfs
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("_topsort", 0);
 
-  /* "pywrapfst.pyx":2526
+  /* "pywrapfst.pyx":2542
  *   cdef void _topsort(self) except *:
  *     # TopSort returns False if the FST is cyclic, and thus can't be TopSorted.
  *     if not fst.TopSort(self._mfst.get()):             # <<<<<<<<<<<<<<
@@ -27959,29 +28034,29 @@ static void __pyx_f_9pywrapfst_11_MutableFst__topsort(struct __pyx_obj_9pywrapfs
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 2526, __pyx_L1_error)
+    __PYX_ERR(0, 2542, __pyx_L1_error)
   }
   __pyx_t_1 = ((!(fst::script::TopSort(__pyx_v_self->_mfst.get()) != 0)) != 0);
   if (__pyx_t_1) {
 
-    /* "pywrapfst.pyx":2527
+    /* "pywrapfst.pyx":2543
  *     # TopSort returns False if the FST is cyclic, and thus can't be TopSorted.
  *     if not fst.TopSort(self._mfst.get()):
  *       logging.warning("Cannot topsort cyclic FST.")             # <<<<<<<<<<<<<<
  *     self._check_mutating_imethod()
  * 
  */
-    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2527, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2543, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_warning); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2527, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_warning); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2543, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2527, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2543, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-    /* "pywrapfst.pyx":2526
+    /* "pywrapfst.pyx":2542
  *   cdef void _topsort(self) except *:
  *     # TopSort returns False if the FST is cyclic, and thus can't be TopSorted.
  *     if not fst.TopSort(self._mfst.get()):             # <<<<<<<<<<<<<<
@@ -27990,7 +28065,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__topsort(struct __pyx_obj_9pywrapfs
  */
   }
 
-  /* "pywrapfst.pyx":2528
+  /* "pywrapfst.pyx":2544
  *     if not fst.TopSort(self._mfst.get()):
  *       logging.warning("Cannot topsort cyclic FST.")
  *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
@@ -27999,11 +28074,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__topsort(struct __pyx_obj_9pywrapfs
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
-    __PYX_ERR(0, 2528, __pyx_L1_error)
+    __PYX_ERR(0, 2544, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2528, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2544, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2524
+  /* "pywrapfst.pyx":2540
  *     return self
  * 
  *   cdef void _topsort(self) except *:             # <<<<<<<<<<<<<<
@@ -28021,7 +28096,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__topsort(struct __pyx_obj_9pywrapfs
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":2530
+/* "pywrapfst.pyx":2546
  *     self._check_mutating_imethod()
  * 
  *   def topsort(self):             # <<<<<<<<<<<<<<
@@ -28048,7 +28123,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_60topsort(struct __pyx_obj_9p
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("topsort", 0);
 
-  /* "pywrapfst.pyx":2545
+  /* "pywrapfst.pyx":2561
  *     See also: `arcsort`.
  *     """
  *     self._topsort()             # <<<<<<<<<<<<<<
@@ -28057,11 +28132,11 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_60topsort(struct __pyx_obj_9p
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_topsort");
-    __PYX_ERR(0, 2545, __pyx_L1_error)
+    __PYX_ERR(0, 2561, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_topsort(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2545, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_topsort(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2561, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2546
+  /* "pywrapfst.pyx":2562
  *     """
  *     self._topsort()
  *     return self             # <<<<<<<<<<<<<<
@@ -28073,7 +28148,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_60topsort(struct __pyx_obj_9p
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2530
+  /* "pywrapfst.pyx":2546
  *     self._check_mutating_imethod()
  * 
  *   def topsort(self):             # <<<<<<<<<<<<<<
@@ -28091,7 +28166,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_60topsort(struct __pyx_obj_9p
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2548
+/* "pywrapfst.pyx":2564
  *     return self
  * 
  *   cdef void _union(self, _Fst ifst) except *:             # <<<<<<<<<<<<<<
@@ -28103,7 +28178,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__union(struct __pyx_obj_9pywrapfst_
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_union", 0);
 
-  /* "pywrapfst.pyx":2549
+  /* "pywrapfst.pyx":2565
  * 
  *   cdef void _union(self, _Fst ifst) except *:
  *     fst.Union(self._mfst.get(), deref(ifst._fst))             # <<<<<<<<<<<<<<
@@ -28112,15 +28187,15 @@ static void __pyx_f_9pywrapfst_11_MutableFst__union(struct __pyx_obj_9pywrapfst_
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 2549, __pyx_L1_error)
+    __PYX_ERR(0, 2565, __pyx_L1_error)
   }
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 2549, __pyx_L1_error)
+    __PYX_ERR(0, 2565, __pyx_L1_error)
   }
   fst::script::Union(__pyx_v_self->_mfst.get(), (*__pyx_v_ifst->_fst));
 
-  /* "pywrapfst.pyx":2550
+  /* "pywrapfst.pyx":2566
  *   cdef void _union(self, _Fst ifst) except *:
  *     fst.Union(self._mfst.get(), deref(ifst._fst))
  *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
@@ -28129,11 +28204,11 @@ static void __pyx_f_9pywrapfst_11_MutableFst__union(struct __pyx_obj_9pywrapfst_
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_check_mutating_imethod");
-    __PYX_ERR(0, 2550, __pyx_L1_error)
+    __PYX_ERR(0, 2566, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_check_mutating_imethod(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 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, 2566, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2548
+  /* "pywrapfst.pyx":2564
  *     return self
  * 
  *   cdef void _union(self, _Fst ifst) except *:             # <<<<<<<<<<<<<<
@@ -28149,7 +28224,7 @@ static void __pyx_f_9pywrapfst_11_MutableFst__union(struct __pyx_obj_9pywrapfst_
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":2552
+/* "pywrapfst.pyx":2568
  *     self._check_mutating_imethod()
  * 
  *   def union(self, _Fst ifst):             # <<<<<<<<<<<<<<
@@ -28164,7 +28239,7 @@ static PyObject *__pyx_pw_9pywrapfst_11_MutableFst_63union(PyObject *__pyx_v_sel
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("union (wrapper)", 0);
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 2552, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 2568, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_11_MutableFst_62union(((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_ifst));
 
   /* function exit code */
@@ -28181,7 +28256,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_62union(struct __pyx_obj_9pyw
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("union", 0);
 
-  /* "pywrapfst.pyx":2568
+  /* "pywrapfst.pyx":2584
  *       self.
  *     """
  *     self._union(ifst)             # <<<<<<<<<<<<<<
@@ -28190,11 +28265,11 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_62union(struct __pyx_obj_9pyw
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_union");
-    __PYX_ERR(0, 2568, __pyx_L1_error)
+    __PYX_ERR(0, 2584, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_union(__pyx_v_self, __pyx_v_ifst); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2568, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst__MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_union(__pyx_v_self, __pyx_v_ifst); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2584, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2569
+  /* "pywrapfst.pyx":2585
  *     """
  *     self._union(ifst)
  *     return self             # <<<<<<<<<<<<<<
@@ -28206,7 +28281,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_62union(struct __pyx_obj_9pyw
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2552
+  /* "pywrapfst.pyx":2568
  *     self._check_mutating_imethod()
  * 
  *   def union(self, _Fst ifst):             # <<<<<<<<<<<<<<
@@ -28224,7 +28299,7 @@ static PyObject *__pyx_pf_9pywrapfst_11_MutableFst_62union(struct __pyx_obj_9pyw
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2594
+/* "pywrapfst.pyx":2610
  * 
  * 
  * cdef _Fst _init_Fst(FstClass_ptr tfst):             # <<<<<<<<<<<<<<
@@ -28241,7 +28316,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__init_Fst(__pyx_t_9p
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("_init_Fst", 0);
 
-  /* "pywrapfst.pyx":2595
+  /* "pywrapfst.pyx":2611
  * 
  * cdef _Fst _init_Fst(FstClass_ptr tfst):
  *   if tfst.Properties(fst.kError, True):             # <<<<<<<<<<<<<<
@@ -28251,23 +28326,23 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__init_Fst(__pyx_t_9p
   __pyx_t_1 = (__pyx_v_tfst->Properties(fst::kError, 1) != 0);
   if (__pyx_t_1) {
 
-    /* "pywrapfst.pyx":2596
+    /* "pywrapfst.pyx":2612
  * cdef _Fst _init_Fst(FstClass_ptr tfst):
  *   if tfst.Properties(fst.kError, True):
  *     raise FstOpError("Operation failed")             # <<<<<<<<<<<<<<
  *   cdef _Fst ofst = _Fst.__new__(_Fst)
  *   ofst._fst.reset(<FstClass_ptr> tfst)
  */
-    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2596, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2612, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2596, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2612, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __PYX_ERR(0, 2596, __pyx_L1_error)
+    __PYX_ERR(0, 2612, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":2595
+    /* "pywrapfst.pyx":2611
  * 
  * cdef _Fst _init_Fst(FstClass_ptr tfst):
  *   if tfst.Properties(fst.kError, True):             # <<<<<<<<<<<<<<
@@ -28276,20 +28351,20 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__init_Fst(__pyx_t_9p
  */
   }
 
-  /* "pywrapfst.pyx":2597
+  /* "pywrapfst.pyx":2613
  *   if tfst.Properties(fst.kError, True):
  *     raise FstOpError("Operation failed")
  *   cdef _Fst ofst = _Fst.__new__(_Fst)             # <<<<<<<<<<<<<<
  *   ofst._fst.reset(<FstClass_ptr> tfst)
  *   return ofst
  */
-  __pyx_t_3 = __pyx_tp_new_9pywrapfst__Fst(((PyTypeObject *)__pyx_ptype_9pywrapfst__Fst), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2597, __pyx_L1_error)
+  __pyx_t_3 = __pyx_tp_new_9pywrapfst__Fst(((PyTypeObject *)__pyx_ptype_9pywrapfst__Fst), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2613, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_9pywrapfst__Fst)))) __PYX_ERR(0, 2597, __pyx_L1_error)
+  if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_9pywrapfst__Fst)))) __PYX_ERR(0, 2613, __pyx_L1_error)
   __pyx_v_ofst = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "pywrapfst.pyx":2598
+  /* "pywrapfst.pyx":2614
  *     raise FstOpError("Operation failed")
  *   cdef _Fst ofst = _Fst.__new__(_Fst)
  *   ofst._fst.reset(<FstClass_ptr> tfst)             # <<<<<<<<<<<<<<
@@ -28298,11 +28373,11 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__init_Fst(__pyx_t_9p
  */
   if (unlikely(((PyObject *)__pyx_v_ofst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 2598, __pyx_L1_error)
+    __PYX_ERR(0, 2614, __pyx_L1_error)
   }
   __pyx_v_ofst->_fst.reset(((__pyx_t_9pywrapfst_FstClass_ptr)__pyx_v_tfst));
 
-  /* "pywrapfst.pyx":2599
+  /* "pywrapfst.pyx":2615
  *   cdef _Fst ofst = _Fst.__new__(_Fst)
  *   ofst._fst.reset(<FstClass_ptr> tfst)
  *   return ofst             # <<<<<<<<<<<<<<
@@ -28314,7 +28389,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__init_Fst(__pyx_t_9p
   __pyx_r = __pyx_v_ofst;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2594
+  /* "pywrapfst.pyx":2610
  * 
  * 
  * cdef _Fst _init_Fst(FstClass_ptr tfst):             # <<<<<<<<<<<<<<
@@ -28335,7 +28410,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__init_Fst(__pyx_t_9p
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2602
+/* "pywrapfst.pyx":2618
  * 
  * 
  * cdef _MutableFst _init_MutableFst(MutableFstClass_ptr tfst):             # <<<<<<<<<<<<<<
@@ -28352,7 +28427,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst__init_Mutable
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("_init_MutableFst", 0);
 
-  /* "pywrapfst.pyx":2603
+  /* "pywrapfst.pyx":2619
  * 
  * cdef _MutableFst _init_MutableFst(MutableFstClass_ptr tfst):
  *   if tfst.Properties(fst.kError, True):             # <<<<<<<<<<<<<<
@@ -28362,23 +28437,23 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst__init_Mutable
   __pyx_t_1 = (__pyx_v_tfst->Properties(fst::kError, 1) != 0);
   if (__pyx_t_1) {
 
-    /* "pywrapfst.pyx":2604
+    /* "pywrapfst.pyx":2620
  * cdef _MutableFst _init_MutableFst(MutableFstClass_ptr tfst):
  *   if tfst.Properties(fst.kError, True):
  *     raise FstOpError("Operation failed")             # <<<<<<<<<<<<<<
  *   cdef _MutableFst ofst = _MutableFst.__new__(_MutableFst)
  *   ofst._fst.reset(<MutableFstClass_ptr> tfst)
  */
-    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2604, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2620, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2604, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2620, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __PYX_ERR(0, 2604, __pyx_L1_error)
+    __PYX_ERR(0, 2620, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":2603
+    /* "pywrapfst.pyx":2619
  * 
  * cdef _MutableFst _init_MutableFst(MutableFstClass_ptr tfst):
  *   if tfst.Properties(fst.kError, True):             # <<<<<<<<<<<<<<
@@ -28387,20 +28462,20 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst__init_Mutable
  */
   }
 
-  /* "pywrapfst.pyx":2605
+  /* "pywrapfst.pyx":2621
  *   if tfst.Properties(fst.kError, True):
  *     raise FstOpError("Operation failed")
  *   cdef _MutableFst ofst = _MutableFst.__new__(_MutableFst)             # <<<<<<<<<<<<<<
  *   ofst._fst.reset(<MutableFstClass_ptr> tfst)
  *   # Makes a copy of it as the derived type! Cool.
  */
-  __pyx_t_3 = __pyx_tp_new_9pywrapfst__MutableFst(((PyTypeObject *)__pyx_ptype_9pywrapfst__MutableFst), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2605, __pyx_L1_error)
+  __pyx_t_3 = __pyx_tp_new_9pywrapfst__MutableFst(((PyTypeObject *)__pyx_ptype_9pywrapfst__MutableFst), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2621, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_9pywrapfst__MutableFst)))) __PYX_ERR(0, 2605, __pyx_L1_error)
+  if (!(likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_9pywrapfst__MutableFst)))) __PYX_ERR(0, 2621, __pyx_L1_error)
   __pyx_v_ofst = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "pywrapfst.pyx":2606
+  /* "pywrapfst.pyx":2622
  *     raise FstOpError("Operation failed")
  *   cdef _MutableFst ofst = _MutableFst.__new__(_MutableFst)
  *   ofst._fst.reset(<MutableFstClass_ptr> tfst)             # <<<<<<<<<<<<<<
@@ -28409,11 +28484,11 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst__init_Mutable
  */
   if (unlikely(((PyObject *)__pyx_v_ofst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 2606, __pyx_L1_error)
+    __PYX_ERR(0, 2622, __pyx_L1_error)
   }
   __pyx_v_ofst->__pyx_base._fst.reset(((__pyx_t_9pywrapfst_MutableFstClass_ptr)__pyx_v_tfst));
 
-  /* "pywrapfst.pyx":2608
+  /* "pywrapfst.pyx":2624
  *   ofst._fst.reset(<MutableFstClass_ptr> tfst)
  *   # Makes a copy of it as the derived type! Cool.
  *   ofst._mfst = static_pointer_cast[fst.MutableFstClass, fst.FstClass](ofst._fst)             # <<<<<<<<<<<<<<
@@ -28422,15 +28497,15 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst__init_Mutable
  */
   if (unlikely(((PyObject *)__pyx_v_ofst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 2608, __pyx_L1_error)
+    __PYX_ERR(0, 2624, __pyx_L1_error)
   }
   if (unlikely(((PyObject *)__pyx_v_ofst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 2608, __pyx_L1_error)
+    __PYX_ERR(0, 2624, __pyx_L1_error)
   }
   __pyx_v_ofst->_mfst = std::static_pointer_cast<fst::script::MutableFstClass,fst::script::FstClass>(__pyx_v_ofst->__pyx_base._fst);
 
-  /* "pywrapfst.pyx":2609
+  /* "pywrapfst.pyx":2625
  *   # Makes a copy of it as the derived type! Cool.
  *   ofst._mfst = static_pointer_cast[fst.MutableFstClass, fst.FstClass](ofst._fst)
  *   return ofst             # <<<<<<<<<<<<<<
@@ -28442,7 +28517,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst__init_Mutable
   __pyx_r = __pyx_v_ofst;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2602
+  /* "pywrapfst.pyx":2618
  * 
  * 
  * cdef _MutableFst _init_MutableFst(MutableFstClass_ptr tfst):             # <<<<<<<<<<<<<<
@@ -28463,7 +28538,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst__init_Mutable
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2612
+/* "pywrapfst.pyx":2628
  * 
  * 
  * cdef _Fst _init_XFst(FstClass_ptr tfst):             # <<<<<<<<<<<<<<
@@ -28478,7 +28553,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__init_XFst(__pyx_t_9
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("_init_XFst", 0);
 
-  /* "pywrapfst.pyx":2613
+  /* "pywrapfst.pyx":2629
  * 
  * cdef _Fst _init_XFst(FstClass_ptr tfst):
  *   if tfst.Properties(fst.kMutable, True):             # <<<<<<<<<<<<<<
@@ -28488,7 +28563,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__init_XFst(__pyx_t_9
   __pyx_t_1 = (__pyx_v_tfst->Properties(fst::kMutable, 1) != 0);
   if (__pyx_t_1) {
 
-    /* "pywrapfst.pyx":2614
+    /* "pywrapfst.pyx":2630
  * cdef _Fst _init_XFst(FstClass_ptr tfst):
  *   if tfst.Properties(fst.kMutable, True):
  *     return _init_MutableFst(static_cast[MutableFstClass_ptr](tfst))             # <<<<<<<<<<<<<<
@@ -28496,13 +28571,13 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__init_XFst(__pyx_t_9
  *     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, 2614, __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, 2630, __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":2613
+    /* "pywrapfst.pyx":2629
  * 
  * cdef _Fst _init_XFst(FstClass_ptr tfst):
  *   if tfst.Properties(fst.kMutable, True):             # <<<<<<<<<<<<<<
@@ -28511,7 +28586,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__init_XFst(__pyx_t_9
  */
   }
 
-  /* "pywrapfst.pyx":2616
+  /* "pywrapfst.pyx":2632
  *     return _init_MutableFst(static_cast[MutableFstClass_ptr](tfst))
  *   else:
  *     return _init_Fst(tfst)             # <<<<<<<<<<<<<<
@@ -28520,14 +28595,14 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__init_XFst(__pyx_t_9
  */
   /*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, 2616, __pyx_L1_error)
+    __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_Fst(__pyx_v_tfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2632, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_2);
     __pyx_t_2 = 0;
     goto __pyx_L0;
   }
 
-  /* "pywrapfst.pyx":2612
+  /* "pywrapfst.pyx":2628
  * 
  * 
  * cdef _Fst _init_XFst(FstClass_ptr tfst):             # <<<<<<<<<<<<<<
@@ -28546,7 +28621,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__init_XFst(__pyx_t_9
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2619
+/* "pywrapfst.pyx":2635
  * 
  * 
  * cdef _MutableFst _create_Fst(arc_type=b"standard"):             # <<<<<<<<<<<<<<
@@ -28574,16 +28649,16 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst__create_Fst(s
     }
   }
 
-  /* "pywrapfst.pyx":2621
+  /* "pywrapfst.pyx":2637
  * cdef _MutableFst _create_Fst(arc_type=b"standard"):
  *   cdef fst.VectorFstClass *tfst = new fst.VectorFstClass(
  *       <string> tostring(arc_type))             # <<<<<<<<<<<<<<
  *   if tfst == NULL:
  *     raise FstOpError("Unknown arc type: {!r}".format(arc_type))
  */
-  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2621, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2637, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2620
+  /* "pywrapfst.pyx":2636
  * 
  * cdef _MutableFst _create_Fst(arc_type=b"standard"):
  *   cdef fst.VectorFstClass *tfst = new fst.VectorFstClass(             # <<<<<<<<<<<<<<
@@ -28592,7 +28667,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst__create_Fst(s
  */
   __pyx_v_tfst = new fst::script::VectorFstClass(((std::string)__pyx_t_1));
 
-  /* "pywrapfst.pyx":2622
+  /* "pywrapfst.pyx":2638
  *   cdef fst.VectorFstClass *tfst = new fst.VectorFstClass(
  *       <string> tostring(arc_type))
  *   if tfst == NULL:             # <<<<<<<<<<<<<<
@@ -28602,16 +28677,16 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst__create_Fst(s
   __pyx_t_2 = ((__pyx_v_tfst == NULL) != 0);
   if (__pyx_t_2) {
 
-    /* "pywrapfst.pyx":2623
+    /* "pywrapfst.pyx":2639
  *       <string> tostring(arc_type))
  *   if tfst == NULL:
  *     raise FstOpError("Unknown arc type: {!r}".format(arc_type))             # <<<<<<<<<<<<<<
  *   return _init_MutableFst(tfst)
  * 
  */
-    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2623, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2639, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_arc_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2623, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_arc_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2639, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __pyx_t_7 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
@@ -28624,13 +28699,13 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst__create_Fst(s
       }
     }
     if (!__pyx_t_7) {
-      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_arc_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2623, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_arc_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2639, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
     } else {
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_6)) {
         PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_arc_type};
-        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2623, __pyx_L1_error)
+        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2639, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
         __Pyx_GOTREF(__pyx_t_5);
       } else
@@ -28638,19 +28713,19 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst__create_Fst(s
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
         PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_arc_type};
-        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2623, __pyx_L1_error)
+        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2639, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
         __Pyx_GOTREF(__pyx_t_5);
       } else
       #endif
       {
-        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2623, __pyx_L1_error)
+        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2639, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
         __Pyx_INCREF(__pyx_v_arc_type);
         __Pyx_GIVEREF(__pyx_v_arc_type);
         PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_arc_type);
-        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2623, __pyx_L1_error)
+        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2639, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       }
@@ -28667,14 +28742,14 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst__create_Fst(s
       }
     }
     if (!__pyx_t_6) {
-      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2623, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2639, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_GOTREF(__pyx_t_3);
     } else {
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_4)) {
         PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
-        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2623, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2639, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -28683,20 +28758,20 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst__create_Fst(s
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
         PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
-        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2623, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2639, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       } else
       #endif
       {
-        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2623, __pyx_L1_error)
+        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2639, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
         __Pyx_GIVEREF(__pyx_t_5);
         PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
         __pyx_t_5 = 0;
-        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2623, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2639, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       }
@@ -28704,9 +28779,9 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst__create_Fst(s
     __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, 2623, __pyx_L1_error)
+    __PYX_ERR(0, 2639, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":2622
+    /* "pywrapfst.pyx":2638
  *   cdef fst.VectorFstClass *tfst = new fst.VectorFstClass(
  *       <string> tostring(arc_type))
  *   if tfst == NULL:             # <<<<<<<<<<<<<<
@@ -28715,7 +28790,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst__create_Fst(s
  */
   }
 
-  /* "pywrapfst.pyx":2624
+  /* "pywrapfst.pyx":2640
  *   if tfst == NULL:
  *     raise FstOpError("Unknown arc type: {!r}".format(arc_type))
  *   return _init_MutableFst(tfst)             # <<<<<<<<<<<<<<
@@ -28723,13 +28798,13 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst__create_Fst(s
  * 
  */
   __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2624, __pyx_L1_error)
+  __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2640, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_3);
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2619
+  /* "pywrapfst.pyx":2635
  * 
  * 
  * cdef _MutableFst _create_Fst(arc_type=b"standard"):             # <<<<<<<<<<<<<<
@@ -28753,7 +28828,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst__create_Fst(s
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2627
+/* "pywrapfst.pyx":2643
  * 
  * 
  * cdef _Fst _read_Fst(filename, fst_type=None):             # <<<<<<<<<<<<<<
@@ -28782,17 +28857,17 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__read_Fst(PyObject *
     }
   }
 
-  /* "pywrapfst.pyx":2628
+  /* "pywrapfst.pyx":2644
  * 
  * cdef _Fst _read_Fst(filename, fst_type=None):
  *   cdef fst.FstClass *tfst = fst.FstClass.Read(tostring(filename))             # <<<<<<<<<<<<<<
  *   if tfst == NULL:
  *     raise FstIOError("Read failed: {!r}".format(filename))
  */
-  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2628, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2644, __pyx_L1_error)
   __pyx_v_tfst = fst::script::FstClass::Read(__pyx_t_1);
 
-  /* "pywrapfst.pyx":2629
+  /* "pywrapfst.pyx":2645
  * cdef _Fst _read_Fst(filename, fst_type=None):
  *   cdef fst.FstClass *tfst = fst.FstClass.Read(tostring(filename))
  *   if tfst == NULL:             # <<<<<<<<<<<<<<
@@ -28802,16 +28877,16 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__read_Fst(PyObject *
   __pyx_t_2 = ((__pyx_v_tfst == NULL) != 0);
   if (__pyx_t_2) {
 
-    /* "pywrapfst.pyx":2630
+    /* "pywrapfst.pyx":2646
  *   cdef fst.FstClass *tfst = fst.FstClass.Read(tostring(filename))
  *   if tfst == NULL:
  *     raise FstIOError("Read failed: {!r}".format(filename))             # <<<<<<<<<<<<<<
  *   # Converts if requested.
  *   cdef string fst_type_string
  */
-    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2630, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2646, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2630, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2646, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __pyx_t_7 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
@@ -28824,13 +28899,13 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__read_Fst(PyObject *
       }
     }
     if (!__pyx_t_7) {
-      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_filename); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2630, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_filename); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2646, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
     } else {
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_6)) {
         PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_filename};
-        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2630, __pyx_L1_error)
+        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2646, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
         __Pyx_GOTREF(__pyx_t_5);
       } else
@@ -28838,19 +28913,19 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__read_Fst(PyObject *
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
         PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_filename};
-        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2630, __pyx_L1_error)
+        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2646, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
         __Pyx_GOTREF(__pyx_t_5);
       } else
       #endif
       {
-        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2630, __pyx_L1_error)
+        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2646, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
         __Pyx_INCREF(__pyx_v_filename);
         __Pyx_GIVEREF(__pyx_v_filename);
         PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_filename);
-        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2630, __pyx_L1_error)
+        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2646, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       }
@@ -28867,14 +28942,14 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__read_Fst(PyObject *
       }
     }
     if (!__pyx_t_6) {
-      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2630, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2646, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_GOTREF(__pyx_t_3);
     } else {
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_4)) {
         PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
-        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2630, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2646, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -28883,20 +28958,20 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__read_Fst(PyObject *
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
         PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
-        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2630, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2646, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       } else
       #endif
       {
-        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2630, __pyx_L1_error)
+        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2646, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
         __Pyx_GIVEREF(__pyx_t_5);
         PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
         __pyx_t_5 = 0;
-        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2630, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2646, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       }
@@ -28904,9 +28979,9 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__read_Fst(PyObject *
     __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, 2630, __pyx_L1_error)
+    __PYX_ERR(0, 2646, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":2629
+    /* "pywrapfst.pyx":2645
  * cdef _Fst _read_Fst(filename, fst_type=None):
  *   cdef fst.FstClass *tfst = fst.FstClass.Read(tostring(filename))
  *   if tfst == NULL:             # <<<<<<<<<<<<<<
@@ -28915,27 +28990,27 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__read_Fst(PyObject *
  */
   }
 
-  /* "pywrapfst.pyx":2633
+  /* "pywrapfst.pyx":2649
  *   # Converts if requested.
  *   cdef string fst_type_string
  *   if fst_type:             # <<<<<<<<<<<<<<
  *     fst_type_string = tostring(fst_type)
  *     if fst_type_string != tfst.FstType():
  */
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_fst_type); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2633, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_fst_type); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2649, __pyx_L1_error)
   if (__pyx_t_2) {
 
-    /* "pywrapfst.pyx":2634
+    /* "pywrapfst.pyx":2650
  *   cdef string fst_type_string
  *   if fst_type:
  *     fst_type_string = tostring(fst_type)             # <<<<<<<<<<<<<<
  *     if fst_type_string != tfst.FstType():
  *       tfst = fst.Convert(deref(tfst), fst_type_string)
  */
-    __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_fst_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2634, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_fst_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2650, __pyx_L1_error)
     __pyx_v_fst_type_string = __pyx_t_1;
 
-    /* "pywrapfst.pyx":2635
+    /* "pywrapfst.pyx":2651
  *   if fst_type:
  *     fst_type_string = tostring(fst_type)
  *     if fst_type_string != tfst.FstType():             # <<<<<<<<<<<<<<
@@ -28945,7 +29020,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__read_Fst(PyObject *
     __pyx_t_2 = ((__pyx_v_fst_type_string != __pyx_v_tfst->FstType()) != 0);
     if (__pyx_t_2) {
 
-      /* "pywrapfst.pyx":2636
+      /* "pywrapfst.pyx":2652
  *     fst_type_string = tostring(fst_type)
  *     if fst_type_string != tfst.FstType():
  *       tfst = fst.Convert(deref(tfst), fst_type_string)             # <<<<<<<<<<<<<<
@@ -28954,7 +29029,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__read_Fst(PyObject *
  */
       __pyx_v_tfst = fst::script::Convert((*__pyx_v_tfst), __pyx_v_fst_type_string);
 
-      /* "pywrapfst.pyx":2637
+      /* "pywrapfst.pyx":2653
  *     if fst_type_string != tfst.FstType():
  *       tfst = fst.Convert(deref(tfst), fst_type_string)
  *       if tfst == NULL:             # <<<<<<<<<<<<<<
@@ -28964,16 +29039,16 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__read_Fst(PyObject *
       __pyx_t_2 = ((__pyx_v_tfst == NULL) != 0);
       if (__pyx_t_2) {
 
-        /* "pywrapfst.pyx":2638
+        /* "pywrapfst.pyx":2654
  *       tfst = fst.Convert(deref(tfst), fst_type_string)
  *       if tfst == NULL:
  *         raise FstOpError("Conversion to {!r} failed.".format(fst_type))             # <<<<<<<<<<<<<<
  *   return _init_XFst(tfst)
  * 
  */
-        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2638, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2654, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
-        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Conversion_to_r_failed, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2638, __pyx_L1_error)
+        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Conversion_to_r_failed, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2654, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         __pyx_t_6 = NULL;
         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
@@ -28986,13 +29061,13 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__read_Fst(PyObject *
           }
         }
         if (!__pyx_t_6) {
-          __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_fst_type); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2638, __pyx_L1_error)
+          __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_fst_type); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2654, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_8);
         } else {
           #if CYTHON_FAST_PYCALL
           if (PyFunction_Check(__pyx_t_5)) {
             PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_fst_type};
-            __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2638, __pyx_L1_error)
+            __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2654, __pyx_L1_error)
             __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
             __Pyx_GOTREF(__pyx_t_8);
           } else
@@ -29000,19 +29075,19 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__read_Fst(PyObject *
           #if CYTHON_FAST_PYCCALL
           if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
             PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_fst_type};
-            __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2638, __pyx_L1_error)
+            __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2654, __pyx_L1_error)
             __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
             __Pyx_GOTREF(__pyx_t_8);
           } else
           #endif
           {
-            __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2638, __pyx_L1_error)
+            __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2654, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_7);
             __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
             __Pyx_INCREF(__pyx_v_fst_type);
             __Pyx_GIVEREF(__pyx_v_fst_type);
             PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_fst_type);
-            __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2638, __pyx_L1_error)
+            __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2654, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_8);
             __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
           }
@@ -29029,14 +29104,14 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__read_Fst(PyObject *
           }
         }
         if (!__pyx_t_5) {
-          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2638, __pyx_L1_error)
+          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2654, __pyx_L1_error)
           __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
           __Pyx_GOTREF(__pyx_t_3);
         } else {
           #if CYTHON_FAST_PYCALL
           if (PyFunction_Check(__pyx_t_4)) {
             PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_8};
-            __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2638, __pyx_L1_error)
+            __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2654, __pyx_L1_error)
             __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
             __Pyx_GOTREF(__pyx_t_3);
             __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -29045,20 +29120,20 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__read_Fst(PyObject *
           #if CYTHON_FAST_PYCCALL
           if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
             PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_8};
-            __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2638, __pyx_L1_error)
+            __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2654, __pyx_L1_error)
             __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
             __Pyx_GOTREF(__pyx_t_3);
             __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
           } else
           #endif
           {
-            __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2638, __pyx_L1_error)
+            __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2654, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_7);
             __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
             __Pyx_GIVEREF(__pyx_t_8);
             PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_8);
             __pyx_t_8 = 0;
-            __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2638, __pyx_L1_error)
+            __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2654, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_3);
             __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
           }
@@ -29066,9 +29141,9 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__read_Fst(PyObject *
         __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, 2638, __pyx_L1_error)
+        __PYX_ERR(0, 2654, __pyx_L1_error)
 
-        /* "pywrapfst.pyx":2637
+        /* "pywrapfst.pyx":2653
  *     if fst_type_string != tfst.FstType():
  *       tfst = fst.Convert(deref(tfst), fst_type_string)
  *       if tfst == NULL:             # <<<<<<<<<<<<<<
@@ -29077,7 +29152,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__read_Fst(PyObject *
  */
       }
 
-      /* "pywrapfst.pyx":2635
+      /* "pywrapfst.pyx":2651
  *   if fst_type:
  *     fst_type_string = tostring(fst_type)
  *     if fst_type_string != tfst.FstType():             # <<<<<<<<<<<<<<
@@ -29086,7 +29161,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__read_Fst(PyObject *
  */
     }
 
-    /* "pywrapfst.pyx":2633
+    /* "pywrapfst.pyx":2649
  *   # Converts if requested.
  *   cdef string fst_type_string
  *   if fst_type:             # <<<<<<<<<<<<<<
@@ -29095,7 +29170,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__read_Fst(PyObject *
  */
   }
 
-  /* "pywrapfst.pyx":2639
+  /* "pywrapfst.pyx":2655
  *       if tfst == NULL:
  *         raise FstOpError("Conversion to {!r} failed.".format(fst_type))
  *   return _init_XFst(tfst)             # <<<<<<<<<<<<<<
@@ -29103,13 +29178,13 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__read_Fst(PyObject *
  * cdef _Fst _deserialize_Fst(fst_string, fst_type=None):
  */
   __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2639, __pyx_L1_error)
+  __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2655, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_3);
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2627
+  /* "pywrapfst.pyx":2643
  * 
  * 
  * cdef _Fst _read_Fst(filename, fst_type=None):             # <<<<<<<<<<<<<<
@@ -29133,7 +29208,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__read_Fst(PyObject *
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2641
+/* "pywrapfst.pyx":2657
  *   return _init_XFst(tfst)
  * 
  * cdef _Fst _deserialize_Fst(fst_string, fst_type=None):             # <<<<<<<<<<<<<<
@@ -29163,17 +29238,17 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__deserialize_Fst(PyO
     }
   }
 
-  /* "pywrapfst.pyx":2642
+  /* "pywrapfst.pyx":2658
  * 
  * cdef _Fst _deserialize_Fst(fst_string, fst_type=None):
  *   ofst = fst.FstClass.ReadFromString(fst_string)             # <<<<<<<<<<<<<<
  *   if fst_type is not None:
  *     fst_type_string = tostring(fst_type)
  */
-  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_fst_string); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2642, __pyx_L1_error)
+  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_v_fst_string); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2658, __pyx_L1_error)
   __pyx_v_ofst = fst::script::FstClass::ReadFromString(__pyx_t_1);
 
-  /* "pywrapfst.pyx":2643
+  /* "pywrapfst.pyx":2659
  * cdef _Fst _deserialize_Fst(fst_string, fst_type=None):
  *   ofst = fst.FstClass.ReadFromString(fst_string)
  *   if fst_type is not None:             # <<<<<<<<<<<<<<
@@ -29184,17 +29259,17 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__deserialize_Fst(PyO
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
 
-    /* "pywrapfst.pyx":2644
+    /* "pywrapfst.pyx":2660
  *   ofst = fst.FstClass.ReadFromString(fst_string)
  *   if fst_type is not None:
  *     fst_type_string = tostring(fst_type)             # <<<<<<<<<<<<<<
  *     if fst_type_string != ofst.FstType():
  *       ofst = fst.Convert(deref(ofst), fst_type_string)
  */
-    __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_fst_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2644, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_fst_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2660, __pyx_L1_error)
     __pyx_v_fst_type_string = __pyx_t_1;
 
-    /* "pywrapfst.pyx":2645
+    /* "pywrapfst.pyx":2661
  *   if fst_type is not None:
  *     fst_type_string = tostring(fst_type)
  *     if fst_type_string != ofst.FstType():             # <<<<<<<<<<<<<<
@@ -29204,7 +29279,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__deserialize_Fst(PyO
     __pyx_t_3 = ((__pyx_v_fst_type_string != __pyx_v_ofst->FstType()) != 0);
     if (__pyx_t_3) {
 
-      /* "pywrapfst.pyx":2646
+      /* "pywrapfst.pyx":2662
  *     fst_type_string = tostring(fst_type)
  *     if fst_type_string != ofst.FstType():
  *       ofst = fst.Convert(deref(ofst), fst_type_string)             # <<<<<<<<<<<<<<
@@ -29213,7 +29288,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__deserialize_Fst(PyO
  */
       __pyx_v_ofst = fst::script::Convert((*__pyx_v_ofst), __pyx_v_fst_type_string);
 
-      /* "pywrapfst.pyx":2647
+      /* "pywrapfst.pyx":2663
  *     if fst_type_string != ofst.FstType():
  *       ofst = fst.Convert(deref(ofst), fst_type_string)
  *       if ofst == NULL:             # <<<<<<<<<<<<<<
@@ -29223,16 +29298,16 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__deserialize_Fst(PyO
       __pyx_t_3 = ((__pyx_v_ofst == NULL) != 0);
       if (__pyx_t_3) {
 
-        /* "pywrapfst.pyx":2648
+        /* "pywrapfst.pyx":2664
  *       ofst = fst.Convert(deref(ofst), fst_type_string)
  *       if ofst == NULL:
  *         raise FstOpError("Conversion to {!r} failed.".format(fst_type))             # <<<<<<<<<<<<<<
  *   return _init_XFst(ofst)
  * 
  */
-        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2648, __pyx_L1_error)
+        __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2664, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
-        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Conversion_to_r_failed, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2648, __pyx_L1_error)
+        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Conversion_to_r_failed, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2664, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_7);
         __pyx_t_8 = NULL;
         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
@@ -29245,13 +29320,13 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__deserialize_Fst(PyO
           }
         }
         if (!__pyx_t_8) {
-          __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_fst_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2648, __pyx_L1_error)
+          __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_fst_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2664, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_6);
         } else {
           #if CYTHON_FAST_PYCALL
           if (PyFunction_Check(__pyx_t_7)) {
             PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_fst_type};
-            __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2648, __pyx_L1_error)
+            __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2664, __pyx_L1_error)
             __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
             __Pyx_GOTREF(__pyx_t_6);
           } else
@@ -29259,19 +29334,19 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__deserialize_Fst(PyO
           #if CYTHON_FAST_PYCCALL
           if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
             PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_fst_type};
-            __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2648, __pyx_L1_error)
+            __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2664, __pyx_L1_error)
             __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
             __Pyx_GOTREF(__pyx_t_6);
           } else
           #endif
           {
-            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2648, __pyx_L1_error)
+            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2664, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_9);
             __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
             __Pyx_INCREF(__pyx_v_fst_type);
             __Pyx_GIVEREF(__pyx_v_fst_type);
             PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_fst_type);
-            __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2648, __pyx_L1_error)
+            __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2664, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_6);
             __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
           }
@@ -29288,14 +29363,14 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__deserialize_Fst(PyO
           }
         }
         if (!__pyx_t_7) {
-          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2648, __pyx_L1_error)
+          __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2664, __pyx_L1_error)
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
           __Pyx_GOTREF(__pyx_t_4);
         } else {
           #if CYTHON_FAST_PYCALL
           if (PyFunction_Check(__pyx_t_5)) {
             PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
-            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2648, __pyx_L1_error)
+            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2664, __pyx_L1_error)
             __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
             __Pyx_GOTREF(__pyx_t_4);
             __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
@@ -29304,20 +29379,20 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__deserialize_Fst(PyO
           #if CYTHON_FAST_PYCCALL
           if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
             PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
-            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2648, __pyx_L1_error)
+            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2664, __pyx_L1_error)
             __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
             __Pyx_GOTREF(__pyx_t_4);
             __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
           } else
           #endif
           {
-            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2648, __pyx_L1_error)
+            __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2664, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_9);
             __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
             __Pyx_GIVEREF(__pyx_t_6);
             PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
             __pyx_t_6 = 0;
-            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2648, __pyx_L1_error)
+            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2664, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_4);
             __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
           }
@@ -29325,9 +29400,9 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__deserialize_Fst(PyO
         __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, 2648, __pyx_L1_error)
+        __PYX_ERR(0, 2664, __pyx_L1_error)
 
-        /* "pywrapfst.pyx":2647
+        /* "pywrapfst.pyx":2663
  *     if fst_type_string != ofst.FstType():
  *       ofst = fst.Convert(deref(ofst), fst_type_string)
  *       if ofst == NULL:             # <<<<<<<<<<<<<<
@@ -29336,7 +29411,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__deserialize_Fst(PyO
  */
       }
 
-      /* "pywrapfst.pyx":2645
+      /* "pywrapfst.pyx":2661
  *   if fst_type is not None:
  *     fst_type_string = tostring(fst_type)
  *     if fst_type_string != ofst.FstType():             # <<<<<<<<<<<<<<
@@ -29345,7 +29420,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__deserialize_Fst(PyO
  */
     }
 
-    /* "pywrapfst.pyx":2643
+    /* "pywrapfst.pyx":2659
  * cdef _Fst _deserialize_Fst(fst_string, fst_type=None):
  *   ofst = fst.FstClass.ReadFromString(fst_string)
  *   if fst_type is not None:             # <<<<<<<<<<<<<<
@@ -29354,7 +29429,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__deserialize_Fst(PyO
  */
   }
 
-  /* "pywrapfst.pyx":2649
+  /* "pywrapfst.pyx":2665
  *       if ofst == NULL:
  *         raise FstOpError("Conversion to {!r} failed.".format(fst_type))
  *   return _init_XFst(ofst)             # <<<<<<<<<<<<<<
@@ -29362,13 +29437,13 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__deserialize_Fst(PyO
  * class Fst(object):
  */
   __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_ofst)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2649, __pyx_L1_error)
+  __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_ofst)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2665, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_4);
   __pyx_t_4 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2641
+  /* "pywrapfst.pyx":2657
  *   return _init_XFst(tfst)
  * 
  * cdef _Fst _deserialize_Fst(fst_string, fst_type=None):             # <<<<<<<<<<<<<<
@@ -29392,7 +29467,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__deserialize_Fst(PyO
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2668
+/* "pywrapfst.pyx":2684
  *    """
  * 
  *    def __new__(cls, arc_type=b"standard"):             # <<<<<<<<<<<<<<
@@ -29434,7 +29509,7 @@ static PyObject *__pyx_pw_9pywrapfst_3Fst_1__new__(PyObject *__pyx_self, PyObjec
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) __PYX_ERR(0, 2668, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__new__") < 0)) __PYX_ERR(0, 2684, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -29449,7 +29524,7 @@ static PyObject *__pyx_pw_9pywrapfst_3Fst_1__new__(PyObject *__pyx_self, PyObjec
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__new__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2668, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__new__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2684, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("pywrapfst.Fst.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -29469,7 +29544,7 @@ static PyObject *__pyx_pf_9pywrapfst_3Fst___new__(CYTHON_UNUSED PyObject *__pyx_
   struct __pyx_opt_args_9pywrapfst__create_Fst __pyx_t_2;
   __Pyx_RefNannySetupContext("__new__", 0);
 
-  /* "pywrapfst.pyx":2669
+  /* "pywrapfst.pyx":2685
  * 
  *    def __new__(cls, arc_type=b"standard"):
  *     return _create_Fst(arc_type)             # <<<<<<<<<<<<<<
@@ -29479,13 +29554,13 @@ static PyObject *__pyx_pf_9pywrapfst_3Fst___new__(CYTHON_UNUSED PyObject *__pyx_
   __Pyx_XDECREF(__pyx_r);
   __pyx_t_2.__pyx_n = 1;
   __pyx_t_2.arc_type = __pyx_v_arc_type;
-  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__create_Fst(&__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2669, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__create_Fst(&__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2685, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2668
+  /* "pywrapfst.pyx":2684
  *    """
  * 
  *    def __new__(cls, arc_type=b"standard"):             # <<<<<<<<<<<<<<
@@ -29504,7 +29579,7 @@ static PyObject *__pyx_pf_9pywrapfst_3Fst___new__(CYTHON_UNUSED PyObject *__pyx_
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2672
+/* "pywrapfst.pyx":2688
  * 
  *    @staticmethod
  *    def read(filename, fst_type=None):             # <<<<<<<<<<<<<<
@@ -29547,7 +29622,7 @@ static PyObject *__pyx_pw_9pywrapfst_3Fst_3read(PyObject *__pyx_self, PyObject *
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read") < 0)) __PYX_ERR(0, 2672, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read") < 0)) __PYX_ERR(0, 2688, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -29562,7 +29637,7 @@ static PyObject *__pyx_pw_9pywrapfst_3Fst_3read(PyObject *__pyx_self, PyObject *
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("read", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2672, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("read", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2688, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("pywrapfst.Fst.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -29582,7 +29657,7 @@ static PyObject *__pyx_pf_9pywrapfst_3Fst_2read(CYTHON_UNUSED PyObject *__pyx_se
   struct __pyx_opt_args_9pywrapfst__read_Fst __pyx_t_2;
   __Pyx_RefNannySetupContext("read", 0);
 
-  /* "pywrapfst.pyx":2690
+  /* "pywrapfst.pyx":2706
  *        FstOpError: Read-time conversion failed.
  *      """
  *      return _read_Fst(filename, fst_type)             # <<<<<<<<<<<<<<
@@ -29592,13 +29667,13 @@ static PyObject *__pyx_pf_9pywrapfst_3Fst_2read(CYTHON_UNUSED PyObject *__pyx_se
   __Pyx_XDECREF(__pyx_r);
   __pyx_t_2.__pyx_n = 1;
   __pyx_t_2.fst_type = __pyx_v_fst_type;
-  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read_Fst(__pyx_v_filename, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2690, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read_Fst(__pyx_v_filename, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2706, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2672
+  /* "pywrapfst.pyx":2688
  * 
  *    @staticmethod
  *    def read(filename, fst_type=None):             # <<<<<<<<<<<<<<
@@ -29617,7 +29692,7 @@ static PyObject *__pyx_pf_9pywrapfst_3Fst_2read(CYTHON_UNUSED PyObject *__pyx_se
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2693
+/* "pywrapfst.pyx":2709
  * 
  *    @staticmethod
  *    def read_from_string(fst_string, fst_type=None):             # <<<<<<<<<<<<<<
@@ -29660,7 +29735,7 @@ static PyObject *__pyx_pw_9pywrapfst_3Fst_5read_from_string(PyObject *__pyx_self
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_from_string") < 0)) __PYX_ERR(0, 2693, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_from_string") < 0)) __PYX_ERR(0, 2709, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -29675,7 +29750,7 @@ static PyObject *__pyx_pw_9pywrapfst_3Fst_5read_from_string(PyObject *__pyx_self
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("read_from_string", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2693, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("read_from_string", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2709, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("pywrapfst.Fst.read_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -29695,7 +29770,7 @@ static PyObject *__pyx_pf_9pywrapfst_3Fst_4read_from_string(CYTHON_UNUSED PyObje
   struct __pyx_opt_args_9pywrapfst__deserialize_Fst __pyx_t_2;
   __Pyx_RefNannySetupContext("read_from_string", 0);
 
-  /* "pywrapfst.pyx":2711
+  /* "pywrapfst.pyx":2727
  *        FstOpError: Read-time conversion failed.
  *      """
  *      return _deserialize_Fst(fst_string, fst_type)             # <<<<<<<<<<<<<<
@@ -29705,13 +29780,13 @@ static PyObject *__pyx_pf_9pywrapfst_3Fst_4read_from_string(CYTHON_UNUSED PyObje
   __Pyx_XDECREF(__pyx_r);
   __pyx_t_2.__pyx_n = 1;
   __pyx_t_2.fst_type = __pyx_v_fst_type;
-  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__deserialize_Fst(__pyx_v_fst_string, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2711, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__deserialize_Fst(__pyx_v_fst_string, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2727, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2693
+  /* "pywrapfst.pyx":2709
  * 
  *    @staticmethod
  *    def read_from_string(fst_string, fst_type=None):             # <<<<<<<<<<<<<<
@@ -29730,7 +29805,7 @@ static PyObject *__pyx_pf_9pywrapfst_3Fst_4read_from_string(CYTHON_UNUSED PyObje
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2795
+/* "pywrapfst.pyx":2811
  *   """
  * 
  *   def __repr__(self):             # <<<<<<<<<<<<<<
@@ -29761,7 +29836,7 @@ static PyObject *__pyx_pf_9pywrapfst_3Arc___repr__(struct __pyx_obj_9pywrapfst_A
   PyObject *__pyx_t_5 = NULL;
   __Pyx_RefNannySetupContext("__repr__", 0);
 
-  /* "pywrapfst.pyx":2796
+  /* "pywrapfst.pyx":2812
  * 
  *   def __repr__(self):
  *     return "<Arc at 0x{:x}>".format(id(self))             # <<<<<<<<<<<<<<
@@ -29769,14 +29844,14 @@ static PyObject *__pyx_pf_9pywrapfst_3Arc___repr__(struct __pyx_obj_9pywrapfst_A
  *   def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Arc_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2796, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Arc_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2812, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2796, __pyx_L1_error)
+  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2812, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2796, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2812, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_t_3 = NULL;
@@ -29790,14 +29865,14 @@ static PyObject *__pyx_pf_9pywrapfst_3Arc___repr__(struct __pyx_obj_9pywrapfst_A
     }
   }
   if (!__pyx_t_3) {
-    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2796, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2812, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else {
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_2)) {
       PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
-      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2796, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2812, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -29806,20 +29881,20 @@ static PyObject *__pyx_pf_9pywrapfst_3Arc___repr__(struct __pyx_obj_9pywrapfst_A
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
       PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
-      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2796, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2812, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     } else
     #endif
     {
-      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2796, __pyx_L1_error)
+      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2812, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
       __Pyx_GIVEREF(__pyx_t_4);
       PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
       __pyx_t_4 = 0;
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2796, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2812, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     }
@@ -29829,7 +29904,7 @@ static PyObject *__pyx_pf_9pywrapfst_3Arc___repr__(struct __pyx_obj_9pywrapfst_A
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2795
+  /* "pywrapfst.pyx":2811
  *   """
  * 
  *   def __repr__(self):             # <<<<<<<<<<<<<<
@@ -29852,7 +29927,7 @@ static PyObject *__pyx_pf_9pywrapfst_3Arc___repr__(struct __pyx_obj_9pywrapfst_A
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2798
+/* "pywrapfst.pyx":2814
  *     return "<Arc at 0x{:x}>".format(id(self))
  * 
  *   def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate):             # <<<<<<<<<<<<<<
@@ -29892,21 +29967,21 @@ static int __pyx_pw_9pywrapfst_3Arc_3__init__(PyObject *__pyx_v_self, PyObject *
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_olabel)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 2798, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 2814, __pyx_L3_error)
         }
         case  2:
         if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_weight)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 2798, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 2814, __pyx_L3_error)
         }
         case  3:
         if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nextstate)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 2798, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 2814, __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, 2798, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2814, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
       goto __pyx_L5_argtuple_error;
@@ -29916,14 +29991,14 @@ static int __pyx_pw_9pywrapfst_3Arc_3__init__(PyObject *__pyx_v_self, PyObject *
       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
       values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
     }
-    __pyx_v_ilabel = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_ilabel == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2798, __pyx_L3_error)
-    __pyx_v_olabel = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_olabel == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2798, __pyx_L3_error)
+    __pyx_v_ilabel = __Pyx_PyInt_As_int64_t(values[0]); if (unlikely((__pyx_v_ilabel == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2814, __pyx_L3_error)
+    __pyx_v_olabel = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_olabel == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2814, __pyx_L3_error)
     __pyx_v_weight = values[2];
-    __pyx_v_nextstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nextstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2798, __pyx_L3_error)
+    __pyx_v_nextstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nextstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2814, __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, 2798, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2814, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("pywrapfst.Arc.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -29944,18 +30019,18 @@ static int __pyx_pf_9pywrapfst_3Arc_2__init__(struct __pyx_obj_9pywrapfst_Arc *_
   fst::script::WeightClass __pyx_t_2;
   __Pyx_RefNannySetupContext("__init__", 0);
 
-  /* "pywrapfst.pyx":2799
+  /* "pywrapfst.pyx":2815
  * 
  *   def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate):
  *     cdef fst.WeightClass wc = _get_WeightClass_or_One(b"tropical", weight)             # <<<<<<<<<<<<<<
  *     self._arc.reset(new fst.ArcClass(ilabel, olabel, wc, nextstate))
  * 
  */
-  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_tropical); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2799, __pyx_L1_error)
-  __pyx_t_2 = __pyx_f_9pywrapfst__get_WeightClass_or_One(__pyx_t_1, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2799, __pyx_L1_error)
+  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_tropical); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2815, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_9pywrapfst__get_WeightClass_or_One(__pyx_t_1, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2815, __pyx_L1_error)
   __pyx_v_wc = __pyx_t_2;
 
-  /* "pywrapfst.pyx":2800
+  /* "pywrapfst.pyx":2816
  *   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))             # <<<<<<<<<<<<<<
@@ -29964,11 +30039,11 @@ static int __pyx_pf_9pywrapfst_3Arc_2__init__(struct __pyx_obj_9pywrapfst_Arc *_
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_arc");
-    __PYX_ERR(0, 2800, __pyx_L1_error)
+    __PYX_ERR(0, 2816, __pyx_L1_error)
   }
   __pyx_v_self->_arc.reset(new fst::script::ArcClass(__pyx_v_ilabel, __pyx_v_olabel, __pyx_v_wc, __pyx_v_nextstate));
 
-  /* "pywrapfst.pyx":2798
+  /* "pywrapfst.pyx":2814
  *     return "<Arc at 0x{:x}>".format(id(self))
  * 
  *   def __init__(self, int64 ilabel, int64 olabel, weight, int64 nextstate):             # <<<<<<<<<<<<<<
@@ -29987,7 +30062,7 @@ static int __pyx_pf_9pywrapfst_3Arc_2__init__(struct __pyx_obj_9pywrapfst_Arc *_
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2802
+/* "pywrapfst.pyx":2818
  *     self._arc.reset(new fst.ArcClass(ilabel, olabel, wc, nextstate))
  * 
  *   cpdef Arc copy(self):             # <<<<<<<<<<<<<<
@@ -30009,7 +30084,7 @@ static struct __pyx_obj_9pywrapfst_Arc *__pyx_f_9pywrapfst_3Arc_copy(struct __py
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2802, __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, 2818, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_3Arc_5copy)) {
       __Pyx_XDECREF(((PyObject *)__pyx_r));
@@ -30025,14 +30100,14 @@ static struct __pyx_obj_9pywrapfst_Arc *__pyx_f_9pywrapfst_3Arc_copy(struct __py
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2802, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2818, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2802, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2818, __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, 2802, __pyx_L1_error)
+      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst_Arc))))) __PYX_ERR(0, 2818, __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;
@@ -30041,7 +30116,7 @@ static struct __pyx_obj_9pywrapfst_Arc *__pyx_f_9pywrapfst_3Arc_copy(struct __py
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":2803
+  /* "pywrapfst.pyx":2819
  * 
  *   cpdef Arc copy(self):
  *     return Arc(self.ilabel, self.olabel, self.weight, self.nextstate)             # <<<<<<<<<<<<<<
@@ -30049,15 +30124,15 @@ static struct __pyx_obj_9pywrapfst_Arc *__pyx_f_9pywrapfst_3Arc_copy(struct __py
  *   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, 2803, __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, 2819, __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, 2803, __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, 2819, __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, 2803, __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, 2819, __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, 2803, __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, 2819, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2803, __pyx_L1_error)
+  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2819, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_GIVEREF(__pyx_t_1);
   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
@@ -30071,14 +30146,14 @@ static struct __pyx_obj_9pywrapfst_Arc *__pyx_f_9pywrapfst_3Arc_copy(struct __py
   __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, 2803, __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, 2819, __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":2802
+  /* "pywrapfst.pyx":2818
  *     self._arc.reset(new fst.ArcClass(ilabel, olabel, wc, nextstate))
  * 
  *   cpdef Arc copy(self):             # <<<<<<<<<<<<<<
@@ -30120,7 +30195,7 @@ static PyObject *__pyx_pf_9pywrapfst_3Arc_4copy(struct __pyx_obj_9pywrapfst_Arc
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("copy", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_3Arc_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2802, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_3Arc_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2818, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -30137,7 +30212,7 @@ static PyObject *__pyx_pf_9pywrapfst_3Arc_4copy(struct __pyx_obj_9pywrapfst_Arc
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2807
+/* "pywrapfst.pyx":2823
  *   property ilabel:
  * 
  *     def __get__(self):             # <<<<<<<<<<<<<<
@@ -30164,7 +30239,7 @@ static PyObject *__pyx_pf_9pywrapfst_3Arc_6ilabel___get__(struct __pyx_obj_9pywr
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "pywrapfst.pyx":2808
+  /* "pywrapfst.pyx":2824
  * 
  *     def __get__(self):
  *       return deref(self._arc).ilabel             # <<<<<<<<<<<<<<
@@ -30174,15 +30249,15 @@ static PyObject *__pyx_pf_9pywrapfst_3Arc_6ilabel___get__(struct __pyx_obj_9pywr
   __Pyx_XDECREF(__pyx_r);
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_arc");
-    __PYX_ERR(0, 2808, __pyx_L1_error)
+    __PYX_ERR(0, 2824, __pyx_L1_error)
   }
-  __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).ilabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2808, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).ilabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2824, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2807
+  /* "pywrapfst.pyx":2823
  *   property ilabel:
  * 
  *     def __get__(self):             # <<<<<<<<<<<<<<
@@ -30201,7 +30276,7 @@ static PyObject *__pyx_pf_9pywrapfst_3Arc_6ilabel___get__(struct __pyx_obj_9pywr
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2810
+/* "pywrapfst.pyx":2826
  *       return deref(self._arc).ilabel
  * 
  *     def __set__(self, int64 value):             # <<<<<<<<<<<<<<
@@ -30217,7 +30292,7 @@ static int __pyx_pw_9pywrapfst_3Arc_6ilabel_3__set__(PyObject *__pyx_v_self, PyO
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
   assert(__pyx_arg_value); {
-    __pyx_v_value = __Pyx_PyInt_As_int64_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2810, __pyx_L3_error)
+    __pyx_v_value = __Pyx_PyInt_As_int64_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2826, __pyx_L3_error)
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L3_error:;
@@ -30237,7 +30312,7 @@ static int __pyx_pf_9pywrapfst_3Arc_6ilabel_2__set__(struct __pyx_obj_9pywrapfst
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__set__", 0);
 
-  /* "pywrapfst.pyx":2811
+  /* "pywrapfst.pyx":2827
  * 
  *     def __set__(self, int64 value):
  *       deref(self._arc).ilabel = value             # <<<<<<<<<<<<<<
@@ -30246,11 +30321,11 @@ static int __pyx_pf_9pywrapfst_3Arc_6ilabel_2__set__(struct __pyx_obj_9pywrapfst
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_arc");
-    __PYX_ERR(0, 2811, __pyx_L1_error)
+    __PYX_ERR(0, 2827, __pyx_L1_error)
   }
   (*__pyx_v_self->_arc).ilabel = __pyx_v_value;
 
-  /* "pywrapfst.pyx":2810
+  /* "pywrapfst.pyx":2826
  *       return deref(self._arc).ilabel
  * 
  *     def __set__(self, int64 value):             # <<<<<<<<<<<<<<
@@ -30269,7 +30344,7 @@ static int __pyx_pf_9pywrapfst_3Arc_6ilabel_2__set__(struct __pyx_obj_9pywrapfst
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2815
+/* "pywrapfst.pyx":2831
  *   property olabel:
  * 
  *     def __get__(self):             # <<<<<<<<<<<<<<
@@ -30296,7 +30371,7 @@ static PyObject *__pyx_pf_9pywrapfst_3Arc_6olabel___get__(struct __pyx_obj_9pywr
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "pywrapfst.pyx":2816
+  /* "pywrapfst.pyx":2832
  * 
  *     def __get__(self):
  *       return deref(self._arc).olabel             # <<<<<<<<<<<<<<
@@ -30306,15 +30381,15 @@ static PyObject *__pyx_pf_9pywrapfst_3Arc_6olabel___get__(struct __pyx_obj_9pywr
   __Pyx_XDECREF(__pyx_r);
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_arc");
-    __PYX_ERR(0, 2816, __pyx_L1_error)
+    __PYX_ERR(0, 2832, __pyx_L1_error)
   }
-  __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).olabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2816, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).olabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2832, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2815
+  /* "pywrapfst.pyx":2831
  *   property olabel:
  * 
  *     def __get__(self):             # <<<<<<<<<<<<<<
@@ -30333,7 +30408,7 @@ static PyObject *__pyx_pf_9pywrapfst_3Arc_6olabel___get__(struct __pyx_obj_9pywr
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2818
+/* "pywrapfst.pyx":2834
  *       return deref(self._arc).olabel
  * 
  *     def __set__(self, int64 value):             # <<<<<<<<<<<<<<
@@ -30349,7 +30424,7 @@ static int __pyx_pw_9pywrapfst_3Arc_6olabel_3__set__(PyObject *__pyx_v_self, PyO
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
   assert(__pyx_arg_value); {
-    __pyx_v_value = __Pyx_PyInt_As_int64_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2818, __pyx_L3_error)
+    __pyx_v_value = __Pyx_PyInt_As_int64_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2834, __pyx_L3_error)
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L3_error:;
@@ -30369,7 +30444,7 @@ static int __pyx_pf_9pywrapfst_3Arc_6olabel_2__set__(struct __pyx_obj_9pywrapfst
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__set__", 0);
 
-  /* "pywrapfst.pyx":2819
+  /* "pywrapfst.pyx":2835
  * 
  *     def __set__(self, int64 value):
  *       deref(self._arc).olabel = value             # <<<<<<<<<<<<<<
@@ -30378,11 +30453,11 @@ static int __pyx_pf_9pywrapfst_3Arc_6olabel_2__set__(struct __pyx_obj_9pywrapfst
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_arc");
-    __PYX_ERR(0, 2819, __pyx_L1_error)
+    __PYX_ERR(0, 2835, __pyx_L1_error)
   }
   (*__pyx_v_self->_arc).olabel = __pyx_v_value;
 
-  /* "pywrapfst.pyx":2818
+  /* "pywrapfst.pyx":2834
  *       return deref(self._arc).olabel
  * 
  *     def __set__(self, int64 value):             # <<<<<<<<<<<<<<
@@ -30401,7 +30476,7 @@ static int __pyx_pf_9pywrapfst_3Arc_6olabel_2__set__(struct __pyx_obj_9pywrapfst
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2823
+/* "pywrapfst.pyx":2839
  *   property weight:
  * 
  *     def __get__(self):             # <<<<<<<<<<<<<<
@@ -30429,20 +30504,20 @@ static PyObject *__pyx_pf_9pywrapfst_3Arc_6weight___get__(struct __pyx_obj_9pywr
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "pywrapfst.pyx":2824
+  /* "pywrapfst.pyx":2840
  * 
  *     def __get__(self):
  *       cdef Weight weight = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
  *       weight._weight.reset(new fst.WeightClass(deref(self._arc).weight))
  *       return weight
  */
-  __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2824, __pyx_L1_error)
+  __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2840, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 2824, __pyx_L1_error)
+  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 2840, __pyx_L1_error)
   __pyx_v_weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "pywrapfst.pyx":2825
+  /* "pywrapfst.pyx":2841
  *     def __get__(self):
  *       cdef Weight weight = Weight.__new__(Weight)
  *       weight._weight.reset(new fst.WeightClass(deref(self._arc).weight))             # <<<<<<<<<<<<<<
@@ -30451,15 +30526,15 @@ static PyObject *__pyx_pf_9pywrapfst_3Arc_6weight___get__(struct __pyx_obj_9pywr
  */
   if (unlikely(((PyObject *)__pyx_v_weight) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
-    __PYX_ERR(0, 2825, __pyx_L1_error)
+    __PYX_ERR(0, 2841, __pyx_L1_error)
   }
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_arc");
-    __PYX_ERR(0, 2825, __pyx_L1_error)
+    __PYX_ERR(0, 2841, __pyx_L1_error)
   }
   __pyx_v_weight->_weight.reset(new fst::script::WeightClass((*__pyx_v_self->_arc).weight));
 
-  /* "pywrapfst.pyx":2826
+  /* "pywrapfst.pyx":2842
  *       cdef Weight weight = Weight.__new__(Weight)
  *       weight._weight.reset(new fst.WeightClass(deref(self._arc).weight))
  *       return weight             # <<<<<<<<<<<<<<
@@ -30471,7 +30546,7 @@ static PyObject *__pyx_pf_9pywrapfst_3Arc_6weight___get__(struct __pyx_obj_9pywr
   __pyx_r = ((PyObject *)__pyx_v_weight);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2823
+  /* "pywrapfst.pyx":2839
  *   property weight:
  * 
  *     def __get__(self):             # <<<<<<<<<<<<<<
@@ -30491,7 +30566,7 @@ static PyObject *__pyx_pf_9pywrapfst_3Arc_6weight___get__(struct __pyx_obj_9pywr
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2828
+/* "pywrapfst.pyx":2844
  *       return weight
  * 
  *     def __set__(self, weight):             # <<<<<<<<<<<<<<
@@ -30519,22 +30594,22 @@ static int __pyx_pf_9pywrapfst_3Arc_6weight_2__set__(struct __pyx_obj_9pywrapfst
   fst::script::WeightClass __pyx_t_2;
   __Pyx_RefNannySetupContext("__set__", 0);
 
-  /* "pywrapfst.pyx":2829
+  /* "pywrapfst.pyx":2845
  * 
  *     def __set__(self, weight):
  *       deref(self._arc).weight = _get_WeightClass_or_One(b"tropical", weight)             # <<<<<<<<<<<<<<
  * 
  *   property nextstate:
  */
-  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_tropical); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2829, __pyx_L1_error)
-  __pyx_t_2 = __pyx_f_9pywrapfst__get_WeightClass_or_One(__pyx_t_1, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2829, __pyx_L1_error)
+  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_tropical); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2845, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_9pywrapfst__get_WeightClass_or_One(__pyx_t_1, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2845, __pyx_L1_error)
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_arc");
-    __PYX_ERR(0, 2829, __pyx_L1_error)
+    __PYX_ERR(0, 2845, __pyx_L1_error)
   }
   (*__pyx_v_self->_arc).weight = __pyx_t_2;
 
-  /* "pywrapfst.pyx":2828
+  /* "pywrapfst.pyx":2844
  *       return weight
  * 
  *     def __set__(self, weight):             # <<<<<<<<<<<<<<
@@ -30553,7 +30628,7 @@ static int __pyx_pf_9pywrapfst_3Arc_6weight_2__set__(struct __pyx_obj_9pywrapfst
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2833
+/* "pywrapfst.pyx":2849
  *   property nextstate:
  * 
  *     def __get__(self):             # <<<<<<<<<<<<<<
@@ -30580,7 +30655,7 @@ static PyObject *__pyx_pf_9pywrapfst_3Arc_9nextstate___get__(struct __pyx_obj_9p
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("__get__", 0);
 
-  /* "pywrapfst.pyx":2834
+  /* "pywrapfst.pyx":2850
  * 
  *     def __get__(self):
  *       return deref(self._arc).nextstate             # <<<<<<<<<<<<<<
@@ -30590,15 +30665,15 @@ static PyObject *__pyx_pf_9pywrapfst_3Arc_9nextstate___get__(struct __pyx_obj_9p
   __Pyx_XDECREF(__pyx_r);
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_arc");
-    __PYX_ERR(0, 2834, __pyx_L1_error)
+    __PYX_ERR(0, 2850, __pyx_L1_error)
   }
-  __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).nextstate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2834, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyInt_From_int64_t((*__pyx_v_self->_arc).nextstate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2850, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2833
+  /* "pywrapfst.pyx":2849
  *   property nextstate:
  * 
  *     def __get__(self):             # <<<<<<<<<<<<<<
@@ -30617,7 +30692,7 @@ static PyObject *__pyx_pf_9pywrapfst_3Arc_9nextstate___get__(struct __pyx_obj_9p
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2836
+/* "pywrapfst.pyx":2852
  *       return deref(self._arc).nextstate
  * 
  *     def __set__(self, int64 value):             # <<<<<<<<<<<<<<
@@ -30633,7 +30708,7 @@ static int __pyx_pw_9pywrapfst_3Arc_9nextstate_3__set__(PyObject *__pyx_v_self,
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
   assert(__pyx_arg_value); {
-    __pyx_v_value = __Pyx_PyInt_As_int64_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2836, __pyx_L3_error)
+    __pyx_v_value = __Pyx_PyInt_As_int64_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2852, __pyx_L3_error)
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L3_error:;
@@ -30653,7 +30728,7 @@ static int __pyx_pf_9pywrapfst_3Arc_9nextstate_2__set__(struct __pyx_obj_9pywrap
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__set__", 0);
 
-  /* "pywrapfst.pyx":2837
+  /* "pywrapfst.pyx":2853
  * 
  *     def __set__(self, int64 value):
  *       deref(self._arc).nextstate = value             # <<<<<<<<<<<<<<
@@ -30662,11 +30737,11 @@ static int __pyx_pf_9pywrapfst_3Arc_9nextstate_2__set__(struct __pyx_obj_9pywrap
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_arc");
-    __PYX_ERR(0, 2837, __pyx_L1_error)
+    __PYX_ERR(0, 2853, __pyx_L1_error)
   }
   (*__pyx_v_self->_arc).nextstate = __pyx_v_value;
 
-  /* "pywrapfst.pyx":2836
+  /* "pywrapfst.pyx":2852
  *       return deref(self._arc).nextstate
  * 
  *     def __set__(self, int64 value):             # <<<<<<<<<<<<<<
@@ -30685,7 +30760,7 @@ static int __pyx_pf_9pywrapfst_3Arc_9nextstate_2__set__(struct __pyx_obj_9pywrap
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2840
+/* "pywrapfst.pyx":2856
  * 
  * 
  * cdef Arc _init_Arc(const fst.ArcClass &arc):             # <<<<<<<<<<<<<<
@@ -30703,20 +30778,20 @@ static struct __pyx_obj_9pywrapfst_Arc *__pyx_f_9pywrapfst__init_Arc(fst::script
   PyObject *__pyx_t_4 = NULL;
   __Pyx_RefNannySetupContext("_init_Arc", 0);
 
-  /* "pywrapfst.pyx":2841
+  /* "pywrapfst.pyx":2857
  * 
  * cdef Arc _init_Arc(const fst.ArcClass &arc):
  *   cdef Weight weight = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
  *   weight._weight.reset(new fst.WeightClass(arc.weight))
  *   return Arc(<int64> arc.ilabel, <int64> arc.olabel, weight,
  */
-  __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2841, __pyx_L1_error)
+  __pyx_t_1 = __pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2857, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 2841, __pyx_L1_error)
+  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_Weight)))) __PYX_ERR(0, 2857, __pyx_L1_error)
   __pyx_v_weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "pywrapfst.pyx":2842
+  /* "pywrapfst.pyx":2858
  * cdef Arc _init_Arc(const fst.ArcClass &arc):
  *   cdef Weight weight = Weight.__new__(Weight)
  *   weight._weight.reset(new fst.WeightClass(arc.weight))             # <<<<<<<<<<<<<<
@@ -30725,11 +30800,11 @@ static struct __pyx_obj_9pywrapfst_Arc *__pyx_f_9pywrapfst__init_Arc(fst::script
  */
   if (unlikely(((PyObject *)__pyx_v_weight) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_weight");
-    __PYX_ERR(0, 2842, __pyx_L1_error)
+    __PYX_ERR(0, 2858, __pyx_L1_error)
   }
   __pyx_v_weight->_weight.reset(new fst::script::WeightClass(__pyx_v_arc.weight));
 
-  /* "pywrapfst.pyx":2843
+  /* "pywrapfst.pyx":2859
  *   cdef Weight weight = Weight.__new__(Weight)
  *   weight._weight.reset(new fst.WeightClass(arc.weight))
  *   return Arc(<int64> arc.ilabel, <int64> arc.olabel, weight,             # <<<<<<<<<<<<<<
@@ -30737,29 +30812,29 @@ static struct __pyx_obj_9pywrapfst_Arc *__pyx_f_9pywrapfst__init_Arc(fst::script
  * 
  */
   __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __pyx_t_1 = __Pyx_PyInt_From_int64_t(((__pyx_t_10basictypes_int64)__pyx_v_arc.ilabel)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2843, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyInt_From_int64_t(((__pyx_t_10basictypes_int64)__pyx_v_arc.ilabel)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2859, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyInt_From_int64_t(((__pyx_t_10basictypes_int64)__pyx_v_arc.olabel)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2843, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_int64_t(((__pyx_t_10basictypes_int64)__pyx_v_arc.olabel)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2859, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
 
-  /* "pywrapfst.pyx":2844
+  /* "pywrapfst.pyx":2860
  *   weight._weight.reset(new fst.WeightClass(arc.weight))
  *   return Arc(<int64> arc.ilabel, <int64> arc.olabel, weight,
  *              <int64> arc.nextstate)             # <<<<<<<<<<<<<<
  * 
  * 
  */
-  __pyx_t_3 = __Pyx_PyInt_From_int64_t(((__pyx_t_10basictypes_int64)__pyx_v_arc.nextstate)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2844, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyInt_From_int64_t(((__pyx_t_10basictypes_int64)__pyx_v_arc.nextstate)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2860, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
 
-  /* "pywrapfst.pyx":2843
+  /* "pywrapfst.pyx":2859
  *   cdef Weight weight = Weight.__new__(Weight)
  *   weight._weight.reset(new fst.WeightClass(arc.weight))
  *   return Arc(<int64> arc.ilabel, <int64> arc.olabel, weight,             # <<<<<<<<<<<<<<
  *              <int64> arc.nextstate)
  * 
  */
-  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2843, __pyx_L1_error)
+  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2859, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_GIVEREF(__pyx_t_1);
   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
@@ -30773,14 +30848,14 @@ static struct __pyx_obj_9pywrapfst_Arc *__pyx_f_9pywrapfst__init_Arc(fst::script
   __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, 2843, __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, 2859, __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":2840
+  /* "pywrapfst.pyx":2856
  * 
  * 
  * cdef Arc _init_Arc(const fst.ArcClass &arc):             # <<<<<<<<<<<<<<
@@ -30803,7 +30878,7 @@ static struct __pyx_obj_9pywrapfst_Arc *__pyx_f_9pywrapfst__init_Arc(fst::script
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2857
+/* "pywrapfst.pyx":2873
  *   """
  * 
  *   def __repr__(self):             # <<<<<<<<<<<<<<
@@ -30834,7 +30909,7 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator___repr__(struct __pyx_obj_9py
   PyObject *__pyx_t_5 = NULL;
   __Pyx_RefNannySetupContext("__repr__", 0);
 
-  /* "pywrapfst.pyx":2858
+  /* "pywrapfst.pyx":2874
  * 
  *   def __repr__(self):
  *     return "<ArcIterator at 0x{:x}>".format(id(self))             # <<<<<<<<<<<<<<
@@ -30842,14 +30917,14 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator___repr__(struct __pyx_obj_9py
  *   def __init__(self, _Fst ifst, int64 state):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_ArcIterator_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2858, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_ArcIterator_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2874, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2858, __pyx_L1_error)
+  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2874, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2858, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2874, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_t_3 = NULL;
@@ -30863,14 +30938,14 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator___repr__(struct __pyx_obj_9py
     }
   }
   if (!__pyx_t_3) {
-    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2858, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2874, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else {
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_2)) {
       PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
-      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2858, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2874, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -30879,20 +30954,20 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator___repr__(struct __pyx_obj_9py
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
       PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
-      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2858, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2874, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     } else
     #endif
     {
-      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2858, __pyx_L1_error)
+      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2874, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
       __Pyx_GIVEREF(__pyx_t_4);
       PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
       __pyx_t_4 = 0;
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2858, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2874, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     }
@@ -30902,7 +30977,7 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator___repr__(struct __pyx_obj_9py
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2857
+  /* "pywrapfst.pyx":2873
  *   """
  * 
  *   def __repr__(self):             # <<<<<<<<<<<<<<
@@ -30925,7 +31000,7 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator___repr__(struct __pyx_obj_9py
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2860
+/* "pywrapfst.pyx":2876
  *     return "<ArcIterator at 0x{:x}>".format(id(self))
  * 
  *   def __init__(self, _Fst ifst, int64 state):             # <<<<<<<<<<<<<<
@@ -30961,11 +31036,11 @@ static int __pyx_pw_9pywrapfst_11ArcIterator_3__init__(PyObject *__pyx_v_self, P
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 2860, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 2876, __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, 2860, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2876, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -30974,17 +31049,17 @@ static int __pyx_pw_9pywrapfst_11ArcIterator_3__init__(PyObject *__pyx_v_self, P
       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
     }
     __pyx_v_ifst = ((struct __pyx_obj_9pywrapfst__Fst *)values[0]);
-    __pyx_v_state = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2860, __pyx_L3_error)
+    __pyx_v_state = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2876, __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, 2860, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2876, __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, 2860, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 2876, __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 */
@@ -31005,7 +31080,7 @@ static int __pyx_pf_9pywrapfst_11ArcIterator_2__init__(struct __pyx_obj_9pywrapf
   std::shared_ptr<fst::script::FstClass>  __pyx_t_4;
   __Pyx_RefNannySetupContext("__init__", 0);
 
-  /* "pywrapfst.pyx":2861
+  /* "pywrapfst.pyx":2877
  * 
  *   def __init__(self, _Fst ifst, int64 state):
  *     if not ifst._fst.get().ValidStateId(state):             # <<<<<<<<<<<<<<
@@ -31014,28 +31089,28 @@ static int __pyx_pf_9pywrapfst_11ArcIterator_2__init__(struct __pyx_obj_9pywrapf
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 2861, __pyx_L1_error)
+    __PYX_ERR(0, 2877, __pyx_L1_error)
   }
   __pyx_t_1 = ((!(__pyx_v_ifst->_fst.get()->ValidStateId(__pyx_v_state) != 0)) != 0);
   if (__pyx_t_1) {
 
-    /* "pywrapfst.pyx":2862
+    /* "pywrapfst.pyx":2878
  *   def __init__(self, _Fst ifst, int64 state):
  *     if not ifst._fst.get().ValidStateId(state):
  *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
  *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
  *     self._fst = ifst._fst
  */
-    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2862, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2878, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2862, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2878, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __PYX_ERR(0, 2862, __pyx_L1_error)
+    __PYX_ERR(0, 2878, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":2861
+    /* "pywrapfst.pyx":2877
  * 
  *   def __init__(self, _Fst ifst, int64 state):
  *     if not ifst._fst.get().ValidStateId(state):             # <<<<<<<<<<<<<<
@@ -31044,7 +31119,7 @@ static int __pyx_pf_9pywrapfst_11ArcIterator_2__init__(struct __pyx_obj_9pywrapf
  */
   }
 
-  /* "pywrapfst.pyx":2864
+  /* "pywrapfst.pyx":2880
  *       raise FstIndexError("State index out of range")
  *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
  *     self._fst = ifst._fst             # <<<<<<<<<<<<<<
@@ -31053,16 +31128,16 @@ static int __pyx_pf_9pywrapfst_11ArcIterator_2__init__(struct __pyx_obj_9pywrapf
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 2864, __pyx_L1_error)
+    __PYX_ERR(0, 2880, __pyx_L1_error)
   }
   __pyx_t_4 = __pyx_v_ifst->_fst;
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 2864, __pyx_L1_error)
+    __PYX_ERR(0, 2880, __pyx_L1_error)
   }
   __pyx_v_self->_fst = __pyx_t_4;
 
-  /* "pywrapfst.pyx":2865
+  /* "pywrapfst.pyx":2881
  *     # 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))             # <<<<<<<<<<<<<<
@@ -31071,15 +31146,15 @@ static int __pyx_pf_9pywrapfst_11ArcIterator_2__init__(struct __pyx_obj_9pywrapf
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_aiter");
-    __PYX_ERR(0, 2865, __pyx_L1_error)
+    __PYX_ERR(0, 2881, __pyx_L1_error)
   }
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 2865, __pyx_L1_error)
+    __PYX_ERR(0, 2881, __pyx_L1_error)
   }
   __pyx_v_self->_aiter.reset(new fst::script::ArcIteratorClass((*__pyx_v_self->_fst), __pyx_v_state));
 
-  /* "pywrapfst.pyx":2860
+  /* "pywrapfst.pyx":2876
  *     return "<ArcIterator at 0x{:x}>".format(id(self))
  * 
  *   def __init__(self, _Fst ifst, int64 state):             # <<<<<<<<<<<<<<
@@ -31100,7 +31175,7 @@ static int __pyx_pf_9pywrapfst_11ArcIterator_2__init__(struct __pyx_obj_9pywrapf
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2868
+/* "pywrapfst.pyx":2884
  * 
  *   # This just registers this class as a possible iterator.
  *   def __iter__(self):             # <<<<<<<<<<<<<<
@@ -31126,7 +31201,7 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_4__iter__(struct __pyx_obj_9p
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__iter__", 0);
 
-  /* "pywrapfst.pyx":2869
+  /* "pywrapfst.pyx":2885
  *   # This just registers this class as a possible iterator.
  *   def __iter__(self):
  *     return self             # <<<<<<<<<<<<<<
@@ -31138,7 +31213,7 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_4__iter__(struct __pyx_obj_9p
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2868
+  /* "pywrapfst.pyx":2884
  * 
  *   # This just registers this class as a possible iterator.
  *   def __iter__(self):             # <<<<<<<<<<<<<<
@@ -31153,7 +31228,7 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_4__iter__(struct __pyx_obj_9p
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2872
+/* "pywrapfst.pyx":2888
  * 
  *   # Magic method used to get a Pythonic API out of the C++ API.
  *   def __next__(self):             # <<<<<<<<<<<<<<
@@ -31182,7 +31257,7 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_6__next__(struct __pyx_obj_9p
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("__next__", 0);
 
-  /* "pywrapfst.pyx":2873
+  /* "pywrapfst.pyx":2889
  *   # Magic method used to get a Pythonic API out of the C++ API.
  *   def __next__(self):
  *     if self.done():             # <<<<<<<<<<<<<<
@@ -31191,12 +31266,12 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_6__next__(struct __pyx_obj_9p
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "done");
-    __PYX_ERR(0, 2873, __pyx_L1_error)
+    __PYX_ERR(0, 2889, __pyx_L1_error)
   }
   __pyx_t_1 = (((struct __pyx_vtabstruct_9pywrapfst_ArcIterator *)__pyx_v_self->__pyx_vtab)->done(__pyx_v_self, 0) != 0);
   if (__pyx_t_1) {
 
-    /* "pywrapfst.pyx":2874
+    /* "pywrapfst.pyx":2890
  *   def __next__(self):
  *     if self.done():
  *       raise StopIteration             # <<<<<<<<<<<<<<
@@ -31204,9 +31279,9 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_6__next__(struct __pyx_obj_9p
  *     self.next()
  */
     __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-    __PYX_ERR(0, 2874, __pyx_L1_error)
+    __PYX_ERR(0, 2890, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":2873
+    /* "pywrapfst.pyx":2889
  *   # Magic method used to get a Pythonic API out of the C++ API.
  *   def __next__(self):
  *     if self.done():             # <<<<<<<<<<<<<<
@@ -31215,7 +31290,7 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_6__next__(struct __pyx_obj_9p
  */
   }
 
-  /* "pywrapfst.pyx":2875
+  /* "pywrapfst.pyx":2891
  *     if self.done():
  *       raise StopIteration
  *     result = self.value()             # <<<<<<<<<<<<<<
@@ -31224,14 +31299,14 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_6__next__(struct __pyx_obj_9p
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "value");
-    __PYX_ERR(0, 2875, __pyx_L1_error)
+    __PYX_ERR(0, 2891, __pyx_L1_error)
   }
-  __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_ArcIterator *)__pyx_v_self->__pyx_vtab)->value(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2875, __pyx_L1_error)
+  __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_ArcIterator *)__pyx_v_self->__pyx_vtab)->value(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2891, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_v_result = __pyx_t_2;
   __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2876
+  /* "pywrapfst.pyx":2892
  *       raise StopIteration
  *     result = self.value()
  *     self.next()             # <<<<<<<<<<<<<<
@@ -31240,11 +31315,11 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_6__next__(struct __pyx_obj_9p
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "next");
-    __PYX_ERR(0, 2876, __pyx_L1_error)
+    __PYX_ERR(0, 2892, __pyx_L1_error)
   }
   ((struct __pyx_vtabstruct_9pywrapfst_ArcIterator *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0);
 
-  /* "pywrapfst.pyx":2877
+  /* "pywrapfst.pyx":2893
  *     result = self.value()
  *     self.next()
  *     return result             # <<<<<<<<<<<<<<
@@ -31256,7 +31331,7 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_6__next__(struct __pyx_obj_9p
   __pyx_r = __pyx_v_result;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2872
+  /* "pywrapfst.pyx":2888
  * 
  *   # Magic method used to get a Pythonic API out of the C++ API.
  *   def __next__(self):             # <<<<<<<<<<<<<<
@@ -31276,7 +31351,7 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_6__next__(struct __pyx_obj_9p
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2879
+/* "pywrapfst.pyx":2895
  *     return result
  * 
  *   cpdef bool done(self):             # <<<<<<<<<<<<<<
@@ -31298,7 +31373,7 @@ static bool __pyx_f_9pywrapfst_11ArcIterator_done(struct __pyx_obj_9pywrapfst_Ar
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2879, __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, 2895, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_9done)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -31313,14 +31388,14 @@ static bool __pyx_f_9pywrapfst_11ArcIterator_done(struct __pyx_obj_9pywrapfst_Ar
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2879, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2895, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2879, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2895, __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, 2879, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2895, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __pyx_r = __pyx_t_5;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -31329,7 +31404,7 @@ static bool __pyx_f_9pywrapfst_11ArcIterator_done(struct __pyx_obj_9pywrapfst_Ar
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":2891
+  /* "pywrapfst.pyx":2907
  *       True if the iterator is exhausted, False otherwise.
  *     """
  *     return self._aiter.get().Done()             # <<<<<<<<<<<<<<
@@ -31338,12 +31413,12 @@ static bool __pyx_f_9pywrapfst_11ArcIterator_done(struct __pyx_obj_9pywrapfst_Ar
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_aiter");
-    __PYX_ERR(0, 2891, __pyx_L1_error)
+    __PYX_ERR(0, 2907, __pyx_L1_error)
   }
   __pyx_r = __pyx_v_self->_aiter.get()->Done();
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2879
+  /* "pywrapfst.pyx":2895
  *     return result
  * 
  *   cpdef bool done(self):             # <<<<<<<<<<<<<<
@@ -31384,7 +31459,7 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_8done(struct __pyx_obj_9pywra
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("done", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_11ArcIterator_done(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2879, __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, 2895, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -31401,7 +31476,7 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_8done(struct __pyx_obj_9pywra
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2893
+/* "pywrapfst.pyx":2909
  *     return self._aiter.get().Done()
  * 
  *   cpdef uint32 flags(self):             # <<<<<<<<<<<<<<
@@ -31423,7 +31498,7 @@ static __pyx_t_10basictypes_uint32 __pyx_f_9pywrapfst_11ArcIterator_flags(struct
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2893, __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, 2909, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_11flags)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -31438,14 +31513,14 @@ static __pyx_t_10basictypes_uint32 __pyx_f_9pywrapfst_11ArcIterator_flags(struct
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2893, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2909, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2893, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2909, __pyx_L1_error)
       }
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_5 = __Pyx_PyInt_As_uint32_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2893, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyInt_As_uint32_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2909, __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;
@@ -31454,7 +31529,7 @@ static __pyx_t_10basictypes_uint32 __pyx_f_9pywrapfst_11ArcIterator_flags(struct
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":2905
+  /* "pywrapfst.pyx":2921
  *       The current iterator behavioral flags as an integer.
  *     """
  *     return self._aiter.get().Flags()             # <<<<<<<<<<<<<<
@@ -31463,12 +31538,12 @@ static __pyx_t_10basictypes_uint32 __pyx_f_9pywrapfst_11ArcIterator_flags(struct
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_aiter");
-    __PYX_ERR(0, 2905, __pyx_L1_error)
+    __PYX_ERR(0, 2921, __pyx_L1_error)
   }
   __pyx_r = __pyx_v_self->_aiter.get()->Flags();
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2893
+  /* "pywrapfst.pyx":2909
  *     return self._aiter.get().Done()
  * 
  *   cpdef uint32 flags(self):             # <<<<<<<<<<<<<<
@@ -31509,7 +31584,7 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_10flags(struct __pyx_obj_9pyw
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("flags", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_f_9pywrapfst_11ArcIterator_flags(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2893, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_f_9pywrapfst_11ArcIterator_flags(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2909, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -31526,7 +31601,7 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_10flags(struct __pyx_obj_9pyw
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2907
+/* "pywrapfst.pyx":2923
  *     return self._aiter.get().Flags()
  * 
  *   cpdef void next(self):             # <<<<<<<<<<<<<<
@@ -31546,7 +31621,7 @@ static void __pyx_f_9pywrapfst_11ArcIterator_next(struct __pyx_obj_9pywrapfst_Ar
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2907, __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, 2923, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_13next)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -31561,10 +31636,10 @@ static void __pyx_f_9pywrapfst_11ArcIterator_next(struct __pyx_obj_9pywrapfst_Ar
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2907, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2923, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2907, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2923, __pyx_L1_error)
       }
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -31575,7 +31650,7 @@ static void __pyx_f_9pywrapfst_11ArcIterator_next(struct __pyx_obj_9pywrapfst_Ar
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":2916
+  /* "pywrapfst.pyx":2932
  *     should use the Pythonic API.
  *     """
  *     self._aiter.get().Next()             # <<<<<<<<<<<<<<
@@ -31584,11 +31659,11 @@ static void __pyx_f_9pywrapfst_11ArcIterator_next(struct __pyx_obj_9pywrapfst_Ar
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_aiter");
-    __PYX_ERR(0, 2916, __pyx_L1_error)
+    __PYX_ERR(0, 2932, __pyx_L1_error)
   }
   __pyx_v_self->_aiter.get()->Next();
 
-  /* "pywrapfst.pyx":2907
+  /* "pywrapfst.pyx":2923
  *     return self._aiter.get().Flags()
  * 
  *   cpdef void next(self):             # <<<<<<<<<<<<<<
@@ -31628,7 +31703,7 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_12next(struct __pyx_obj_9pywr
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("next", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_11ArcIterator_next(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2907, __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, 2923, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -31645,7 +31720,7 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_12next(struct __pyx_obj_9pywr
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2918
+/* "pywrapfst.pyx":2934
  *     self._aiter.get().Next()
  * 
  *   cpdef size_t position(self):             # <<<<<<<<<<<<<<
@@ -31667,7 +31742,7 @@ static size_t __pyx_f_9pywrapfst_11ArcIterator_position(struct __pyx_obj_9pywrap
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_position); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2918, __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, 2934, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_15position)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -31682,14 +31757,14 @@ static size_t __pyx_f_9pywrapfst_11ArcIterator_position(struct __pyx_obj_9pywrap
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2918, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2934, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2918, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2934, __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, 2918, __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, 2934, __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;
@@ -31698,7 +31773,7 @@ static size_t __pyx_f_9pywrapfst_11ArcIterator_position(struct __pyx_obj_9pywrap
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":2930
+  /* "pywrapfst.pyx":2946
  *       The iterator's position, expressed as an integer.
  *     """
  *     return self._aiter.get().Position()             # <<<<<<<<<<<<<<
@@ -31707,12 +31782,12 @@ static size_t __pyx_f_9pywrapfst_11ArcIterator_position(struct __pyx_obj_9pywrap
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_aiter");
-    __PYX_ERR(0, 2930, __pyx_L1_error)
+    __PYX_ERR(0, 2946, __pyx_L1_error)
   }
   __pyx_r = __pyx_v_self->_aiter.get()->Position();
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2918
+  /* "pywrapfst.pyx":2934
  *     self._aiter.get().Next()
  * 
  *   cpdef size_t position(self):             # <<<<<<<<<<<<<<
@@ -31753,7 +31828,7 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_14position(struct __pyx_obj_9
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("position", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_9pywrapfst_11ArcIterator_position(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2918, __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, 2934, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -31770,7 +31845,7 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_14position(struct __pyx_obj_9
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2932
+/* "pywrapfst.pyx":2948
  *     return self._aiter.get().Position()
  * 
  *   cpdef void reset(self):             # <<<<<<<<<<<<<<
@@ -31790,7 +31865,7 @@ static void __pyx_f_9pywrapfst_11ArcIterator_reset(struct __pyx_obj_9pywrapfst_A
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2932, __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, 2948, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_17reset)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -31805,10 +31880,10 @@ static void __pyx_f_9pywrapfst_11ArcIterator_reset(struct __pyx_obj_9pywrapfst_A
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2932, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2948, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2932, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2948, __pyx_L1_error)
       }
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -31819,7 +31894,7 @@ static void __pyx_f_9pywrapfst_11ArcIterator_reset(struct __pyx_obj_9pywrapfst_A
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":2941
+  /* "pywrapfst.pyx":2957
  *     should use the Pythonic API.
  *     """
  *     self._aiter.get().Reset()             # <<<<<<<<<<<<<<
@@ -31828,11 +31903,11 @@ static void __pyx_f_9pywrapfst_11ArcIterator_reset(struct __pyx_obj_9pywrapfst_A
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_aiter");
-    __PYX_ERR(0, 2941, __pyx_L1_error)
+    __PYX_ERR(0, 2957, __pyx_L1_error)
   }
   __pyx_v_self->_aiter.get()->Reset();
 
-  /* "pywrapfst.pyx":2932
+  /* "pywrapfst.pyx":2948
  *     return self._aiter.get().Position()
  * 
  *   cpdef void reset(self):             # <<<<<<<<<<<<<<
@@ -31872,7 +31947,7 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_16reset(struct __pyx_obj_9pyw
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("reset", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_11ArcIterator_reset(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2932, __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, 2948, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -31889,7 +31964,7 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_16reset(struct __pyx_obj_9pyw
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2943
+/* "pywrapfst.pyx":2959
  *     self._aiter.get().Reset()
  * 
  *   cpdef void seek(self, size_t a):             # <<<<<<<<<<<<<<
@@ -31911,10 +31986,10 @@ static void __pyx_f_9pywrapfst_11ArcIterator_seek(struct __pyx_obj_9pywrapfst_Ar
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2943, __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, 2959, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_19seek)) {
-      __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2943, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2959, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_INCREF(__pyx_t_1);
       __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
@@ -31928,14 +32003,14 @@ static void __pyx_f_9pywrapfst_11ArcIterator_seek(struct __pyx_obj_9pywrapfst_Ar
         }
       }
       if (!__pyx_t_5) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2943, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2959, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         __Pyx_GOTREF(__pyx_t_2);
       } else {
         #if CYTHON_FAST_PYCALL
         if (PyFunction_Check(__pyx_t_4)) {
           PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
-          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2943, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2959, __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;
@@ -31944,20 +32019,20 @@ static void __pyx_f_9pywrapfst_11ArcIterator_seek(struct __pyx_obj_9pywrapfst_Ar
         #if CYTHON_FAST_PYCCALL
         if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
           PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
-          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2943, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2959, __pyx_L1_error)
           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
           __Pyx_GOTREF(__pyx_t_2);
           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         } else
         #endif
         {
-          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2943, __pyx_L1_error)
+          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2959, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_6);
           __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
           __Pyx_GIVEREF(__pyx_t_3);
           PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
           __pyx_t_3 = 0;
-          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2943, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2959, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_2);
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         }
@@ -31970,7 +32045,7 @@ static void __pyx_f_9pywrapfst_11ArcIterator_seek(struct __pyx_obj_9pywrapfst_Ar
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":2955
+  /* "pywrapfst.pyx":2971
  *       a: The position to seek to.
  *     """
  *     self._aiter.get().Seek(a)             # <<<<<<<<<<<<<<
@@ -31979,11 +32054,11 @@ static void __pyx_f_9pywrapfst_11ArcIterator_seek(struct __pyx_obj_9pywrapfst_Ar
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_aiter");
-    __PYX_ERR(0, 2955, __pyx_L1_error)
+    __PYX_ERR(0, 2971, __pyx_L1_error)
   }
   __pyx_v_self->_aiter.get()->Seek(__pyx_v_a);
 
-  /* "pywrapfst.pyx":2943
+  /* "pywrapfst.pyx":2959
  *     self._aiter.get().Reset()
  * 
  *   cpdef void seek(self, size_t a):             # <<<<<<<<<<<<<<
@@ -32014,7 +32089,7 @@ static PyObject *__pyx_pw_9pywrapfst_11ArcIterator_19seek(PyObject *__pyx_v_self
   __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, 2943, __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, 2959, __pyx_L3_error)
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L3_error:;
@@ -32035,7 +32110,7 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_18seek(struct __pyx_obj_9pywr
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("seek", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_11ArcIterator_seek(__pyx_v_self, __pyx_v_a, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2943, __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, 2959, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -32052,7 +32127,7 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_18seek(struct __pyx_obj_9pywr
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2957
+/* "pywrapfst.pyx":2973
  *     self._aiter.get().Seek(a)
  * 
  *   cpdef void set_flags(self, uint32 flags, uint32 mask):             # <<<<<<<<<<<<<<
@@ -32076,12 +32151,12 @@ static void __pyx_f_9pywrapfst_11ArcIterator_set_flags(struct __pyx_obj_9pywrapf
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2957, __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, 2973, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_21set_flags)) {
-      __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2957, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2973, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2957, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2973, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_INCREF(__pyx_t_1);
       __pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL;
@@ -32099,7 +32174,7 @@ static void __pyx_f_9pywrapfst_11ArcIterator_set_flags(struct __pyx_obj_9pywrapf
       #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, 2957, __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, 2973, __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;
@@ -32109,7 +32184,7 @@ static void __pyx_f_9pywrapfst_11ArcIterator_set_flags(struct __pyx_obj_9pywrapf
       #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, 2957, __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, 2973, __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;
@@ -32117,7 +32192,7 @@ static void __pyx_f_9pywrapfst_11ArcIterator_set_flags(struct __pyx_obj_9pywrapf
       } else
       #endif
       {
-        __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2957, __pyx_L1_error)
+        __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2973, __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;
@@ -32128,7 +32203,7 @@ static void __pyx_f_9pywrapfst_11ArcIterator_set_flags(struct __pyx_obj_9pywrapf
         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, 2957, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2973, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_2);
         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       }
@@ -32140,7 +32215,7 @@ static void __pyx_f_9pywrapfst_11ArcIterator_set_flags(struct __pyx_obj_9pywrapf
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":2970
+  /* "pywrapfst.pyx":2986
  *       mask: A mask to be applied to the `flags` argument before setting them.
  *     """
  *     self._aiter.get().SetFlags(flags, mask)             # <<<<<<<<<<<<<<
@@ -32149,11 +32224,11 @@ static void __pyx_f_9pywrapfst_11ArcIterator_set_flags(struct __pyx_obj_9pywrapf
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_aiter");
-    __PYX_ERR(0, 2970, __pyx_L1_error)
+    __PYX_ERR(0, 2986, __pyx_L1_error)
   }
   __pyx_v_self->_aiter.get()->SetFlags(__pyx_v_flags, __pyx_v_mask);
 
-  /* "pywrapfst.pyx":2957
+  /* "pywrapfst.pyx":2973
  *     self._aiter.get().Seek(a)
  * 
  *   cpdef void set_flags(self, uint32 flags, uint32 mask):             # <<<<<<<<<<<<<<
@@ -32205,11 +32280,11 @@ static PyObject *__pyx_pw_9pywrapfst_11ArcIterator_21set_flags(PyObject *__pyx_v
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, 1); __PYX_ERR(0, 2957, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, 1); __PYX_ERR(0, 2973, __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, 2957, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_flags") < 0)) __PYX_ERR(0, 2973, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -32217,12 +32292,12 @@ static PyObject *__pyx_pw_9pywrapfst_11ArcIterator_21set_flags(PyObject *__pyx_v
       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
     }
-    __pyx_v_flags = __Pyx_PyInt_As_uint32_t(values[0]); if (unlikely((__pyx_v_flags == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2957, __pyx_L3_error)
-    __pyx_v_mask = __Pyx_PyInt_As_uint32_t(values[1]); if (unlikely((__pyx_v_mask == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2957, __pyx_L3_error)
+    __pyx_v_flags = __Pyx_PyInt_As_uint32_t(values[0]); if (unlikely((__pyx_v_flags == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2973, __pyx_L3_error)
+    __pyx_v_mask = __Pyx_PyInt_As_uint32_t(values[1]); if (unlikely((__pyx_v_mask == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2973, __pyx_L3_error)
   }
   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, 2957, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2973, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("pywrapfst.ArcIterator.set_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -32241,7 +32316,7 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_20set_flags(struct __pyx_obj_
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("set_flags", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_11ArcIterator_set_flags(__pyx_v_self, __pyx_v_flags, __pyx_v_mask, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2957, __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, 2973, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -32258,7 +32333,7 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_20set_flags(struct __pyx_obj_
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2972
+/* "pywrapfst.pyx":2988
  *     self._aiter.get().SetFlags(flags, mask)
  * 
  *   cpdef object value(self):             # <<<<<<<<<<<<<<
@@ -32279,7 +32354,7 @@ static PyObject *__pyx_f_9pywrapfst_11ArcIterator_value(struct __pyx_obj_9pywrap
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2972, __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, 2988, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_11ArcIterator_23value)) {
       __Pyx_XDECREF(__pyx_r);
@@ -32295,10 +32370,10 @@ static PyObject *__pyx_f_9pywrapfst_11ArcIterator_value(struct __pyx_obj_9pywrap
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2972, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2988, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2972, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2988, __pyx_L1_error)
       }
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -32310,7 +32385,7 @@ static PyObject *__pyx_f_9pywrapfst_11ArcIterator_value(struct __pyx_obj_9pywrap
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":2981
+  /* "pywrapfst.pyx":2997
  *     should use the Pythonic API.
  *     """
  *     return _init_Arc(self._aiter.get().Value())             # <<<<<<<<<<<<<<
@@ -32320,15 +32395,15 @@ static PyObject *__pyx_f_9pywrapfst_11ArcIterator_value(struct __pyx_obj_9pywrap
   __Pyx_XDECREF(__pyx_r);
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_aiter");
-    __PYX_ERR(0, 2981, __pyx_L1_error)
+    __PYX_ERR(0, 2997, __pyx_L1_error)
   }
-  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_Arc(__pyx_v_self->_aiter.get()->Value())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2981, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_Arc(__pyx_v_self->_aiter.get()->Value())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2997, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2972
+  /* "pywrapfst.pyx":2988
  *     self._aiter.get().SetFlags(flags, mask)
  * 
  *   cpdef object value(self):             # <<<<<<<<<<<<<<
@@ -32370,7 +32445,7 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_22value(struct __pyx_obj_9pyw
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("value", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_9pywrapfst_11ArcIterator_value(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2972, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_9pywrapfst_11ArcIterator_value(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2988, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -32387,7 +32462,7 @@ static PyObject *__pyx_pf_9pywrapfst_11ArcIterator_22value(struct __pyx_obj_9pyw
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2995
+/* "pywrapfst.pyx":3011
  *   """
  * 
  *   def __repr__(self):             # <<<<<<<<<<<<<<
@@ -32418,7 +32493,7 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator___repr__(struct __pyx_
   PyObject *__pyx_t_5 = NULL;
   __Pyx_RefNannySetupContext("__repr__", 0);
 
-  /* "pywrapfst.pyx":2996
+  /* "pywrapfst.pyx":3012
  * 
  *   def __repr__(self):
  *     return "<MutableArcIterator at 0x{:x}>".format(id(self))             # <<<<<<<<<<<<<<
@@ -32426,14 +32501,14 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator___repr__(struct __pyx_
  *   def __init__(self, _MutableFst ifst, int64 state):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_MutableArcIterator_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2996, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_MutableArcIterator_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3012, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2996, __pyx_L1_error)
+  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3012, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2996, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3012, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_t_3 = NULL;
@@ -32447,14 +32522,14 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator___repr__(struct __pyx_
     }
   }
   if (!__pyx_t_3) {
-    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2996, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3012, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else {
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_2)) {
       PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
-      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2996, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3012, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -32463,20 +32538,20 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator___repr__(struct __pyx_
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
       PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
-      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2996, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3012, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     } else
     #endif
     {
-      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2996, __pyx_L1_error)
+      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3012, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
       __Pyx_GIVEREF(__pyx_t_4);
       PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
       __pyx_t_4 = 0;
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2996, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3012, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     }
@@ -32486,7 +32561,7 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator___repr__(struct __pyx_
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":2995
+  /* "pywrapfst.pyx":3011
  *   """
  * 
  *   def __repr__(self):             # <<<<<<<<<<<<<<
@@ -32509,7 +32584,7 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator___repr__(struct __pyx_
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":2998
+/* "pywrapfst.pyx":3014
  *     return "<MutableArcIterator at 0x{:x}>".format(id(self))
  * 
  *   def __init__(self, _MutableFst ifst, int64 state):             # <<<<<<<<<<<<<<
@@ -32545,11 +32620,11 @@ static int __pyx_pw_9pywrapfst_18MutableArcIterator_3__init__(PyObject *__pyx_v_
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_state)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 2998, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 3014, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2998, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3014, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -32558,17 +32633,17 @@ static int __pyx_pw_9pywrapfst_18MutableArcIterator_3__init__(PyObject *__pyx_v_
       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
     }
     __pyx_v_ifst = ((struct __pyx_obj_9pywrapfst__MutableFst *)values[0]);
-    __pyx_v_state = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2998, __pyx_L3_error)
+    __pyx_v_state = __Pyx_PyInt_As_int64_t(values[1]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3014, __pyx_L3_error)
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2998, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3014, __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, 2998, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__MutableFst, 1, "ifst", 0))) __PYX_ERR(0, 3014, __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 */
@@ -32589,7 +32664,7 @@ static int __pyx_pf_9pywrapfst_18MutableArcIterator_2__init__(struct __pyx_obj_9
   std::shared_ptr<fst::script::MutableFstClass>  __pyx_t_4;
   __Pyx_RefNannySetupContext("__init__", 0);
 
-  /* "pywrapfst.pyx":2999
+  /* "pywrapfst.pyx":3015
  * 
  *   def __init__(self, _MutableFst ifst, int64 state):
  *     if not ifst._fst.get().ValidStateId(state):             # <<<<<<<<<<<<<<
@@ -32598,28 +32673,28 @@ static int __pyx_pf_9pywrapfst_18MutableArcIterator_2__init__(struct __pyx_obj_9
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 2999, __pyx_L1_error)
+    __PYX_ERR(0, 3015, __pyx_L1_error)
   }
   __pyx_t_1 = ((!(__pyx_v_ifst->__pyx_base._fst.get()->ValidStateId(__pyx_v_state) != 0)) != 0);
   if (__pyx_t_1) {
 
-    /* "pywrapfst.pyx":3000
+    /* "pywrapfst.pyx":3016
  *   def __init__(self, _MutableFst ifst, int64 state):
  *     if not ifst._fst.get().ValidStateId(state):
  *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
  *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
  *     self._mfst = ifst._mfst
  */
-    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3000, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIndexError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3016, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3000, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3016, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __PYX_ERR(0, 3000, __pyx_L1_error)
+    __PYX_ERR(0, 3016, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":2999
+    /* "pywrapfst.pyx":3015
  * 
  *   def __init__(self, _MutableFst ifst, int64 state):
  *     if not ifst._fst.get().ValidStateId(state):             # <<<<<<<<<<<<<<
@@ -32628,7 +32703,7 @@ static int __pyx_pf_9pywrapfst_18MutableArcIterator_2__init__(struct __pyx_obj_9
  */
   }
 
-  /* "pywrapfst.pyx":3002
+  /* "pywrapfst.pyx":3018
  *       raise FstIndexError("State index out of range")
  *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
  *     self._mfst = ifst._mfst             # <<<<<<<<<<<<<<
@@ -32637,16 +32712,16 @@ static int __pyx_pf_9pywrapfst_18MutableArcIterator_2__init__(struct __pyx_obj_9
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 3002, __pyx_L1_error)
+    __PYX_ERR(0, 3018, __pyx_L1_error)
   }
   __pyx_t_4 = __pyx_v_ifst->_mfst;
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 3002, __pyx_L1_error)
+    __PYX_ERR(0, 3018, __pyx_L1_error)
   }
   __pyx_v_self->_mfst = __pyx_t_4;
 
-  /* "pywrapfst.pyx":3003
+  /* "pywrapfst.pyx":3019
  *     # 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))             # <<<<<<<<<<<<<<
@@ -32655,15 +32730,15 @@ static int __pyx_pf_9pywrapfst_18MutableArcIterator_2__init__(struct __pyx_obj_9
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_aiter");
-    __PYX_ERR(0, 3003, __pyx_L1_error)
+    __PYX_ERR(0, 3019, __pyx_L1_error)
   }
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_mfst");
-    __PYX_ERR(0, 3003, __pyx_L1_error)
+    __PYX_ERR(0, 3019, __pyx_L1_error)
   }
   __pyx_v_self->_aiter.reset(new fst::script::MutableArcIteratorClass(__pyx_v_ifst->_mfst.get(), __pyx_v_state));
 
-  /* "pywrapfst.pyx":2998
+  /* "pywrapfst.pyx":3014
  *     return "<MutableArcIterator at 0x{:x}>".format(id(self))
  * 
  *   def __init__(self, _MutableFst ifst, int64 state):             # <<<<<<<<<<<<<<
@@ -32684,7 +32759,7 @@ static int __pyx_pf_9pywrapfst_18MutableArcIterator_2__init__(struct __pyx_obj_9
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3006
+/* "pywrapfst.pyx":3022
  * 
  *   # This just registers this class as a possible iterator.
  *   def __iter__(self):             # <<<<<<<<<<<<<<
@@ -32710,7 +32785,7 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_4__iter__(struct __pyx
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__iter__", 0);
 
-  /* "pywrapfst.pyx":3007
+  /* "pywrapfst.pyx":3023
  *   # This just registers this class as a possible iterator.
  *   def __iter__(self):
  *     return self             # <<<<<<<<<<<<<<
@@ -32722,7 +32797,7 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_4__iter__(struct __pyx
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3006
+  /* "pywrapfst.pyx":3022
  * 
  *   # This just registers this class as a possible iterator.
  *   def __iter__(self):             # <<<<<<<<<<<<<<
@@ -32737,7 +32812,7 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_4__iter__(struct __pyx
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3010
+/* "pywrapfst.pyx":3026
  * 
  *   # Magic method used to get a Pythonic API out of the C++ API.
  *   def __next__(self):             # <<<<<<<<<<<<<<
@@ -32766,7 +32841,7 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_6__next__(struct __pyx
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("__next__", 0);
 
-  /* "pywrapfst.pyx":3011
+  /* "pywrapfst.pyx":3027
  *   # Magic method used to get a Pythonic API out of the C++ API.
  *   def __next__(self):
  *     if self.done():             # <<<<<<<<<<<<<<
@@ -32775,12 +32850,12 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_6__next__(struct __pyx
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "done");
-    __PYX_ERR(0, 3011, __pyx_L1_error)
+    __PYX_ERR(0, 3027, __pyx_L1_error)
   }
   __pyx_t_1 = (((struct __pyx_vtabstruct_9pywrapfst_MutableArcIterator *)__pyx_v_self->__pyx_vtab)->done(__pyx_v_self, 0) != 0);
   if (__pyx_t_1) {
 
-    /* "pywrapfst.pyx":3012
+    /* "pywrapfst.pyx":3028
  *   def __next__(self):
  *     if self.done():
  *       raise StopIteration             # <<<<<<<<<<<<<<
@@ -32788,9 +32863,9 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_6__next__(struct __pyx
  *     self.next()
  */
     __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-    __PYX_ERR(0, 3012, __pyx_L1_error)
+    __PYX_ERR(0, 3028, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":3011
+    /* "pywrapfst.pyx":3027
  *   # Magic method used to get a Pythonic API out of the C++ API.
  *   def __next__(self):
  *     if self.done():             # <<<<<<<<<<<<<<
@@ -32799,7 +32874,7 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_6__next__(struct __pyx
  */
   }
 
-  /* "pywrapfst.pyx":3013
+  /* "pywrapfst.pyx":3029
  *     if self.done():
  *       raise StopIteration
  *     result = self.value()             # <<<<<<<<<<<<<<
@@ -32808,14 +32883,14 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_6__next__(struct __pyx
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "value");
-    __PYX_ERR(0, 3013, __pyx_L1_error)
+    __PYX_ERR(0, 3029, __pyx_L1_error)
   }
-  __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_MutableArcIterator *)__pyx_v_self->__pyx_vtab)->value(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3013, __pyx_L1_error)
+  __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_MutableArcIterator *)__pyx_v_self->__pyx_vtab)->value(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3029, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_v_result = __pyx_t_2;
   __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":3014
+  /* "pywrapfst.pyx":3030
  *       raise StopIteration
  *     result = self.value()
  *     self.next()             # <<<<<<<<<<<<<<
@@ -32824,11 +32899,11 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_6__next__(struct __pyx
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "next");
-    __PYX_ERR(0, 3014, __pyx_L1_error)
+    __PYX_ERR(0, 3030, __pyx_L1_error)
   }
   ((struct __pyx_vtabstruct_9pywrapfst_MutableArcIterator *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0);
 
-  /* "pywrapfst.pyx":3015
+  /* "pywrapfst.pyx":3031
  *     result = self.value()
  *     self.next()
  *     return result             # <<<<<<<<<<<<<<
@@ -32840,7 +32915,7 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_6__next__(struct __pyx
   __pyx_r = __pyx_v_result;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3010
+  /* "pywrapfst.pyx":3026
  * 
  *   # Magic method used to get a Pythonic API out of the C++ API.
  *   def __next__(self):             # <<<<<<<<<<<<<<
@@ -32860,7 +32935,7 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_6__next__(struct __pyx
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3017
+/* "pywrapfst.pyx":3033
  *     return result
  * 
  *   cpdef bool done(self):             # <<<<<<<<<<<<<<
@@ -32882,7 +32957,7 @@ static bool __pyx_f_9pywrapfst_18MutableArcIterator_done(struct __pyx_obj_9pywra
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3017, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3033, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_9done)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -32897,14 +32972,14 @@ static bool __pyx_f_9pywrapfst_18MutableArcIterator_done(struct __pyx_obj_9pywra
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3017, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3033, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3017, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3033, __pyx_L1_error)
       }
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3017, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3033, __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;
@@ -32913,7 +32988,7 @@ static bool __pyx_f_9pywrapfst_18MutableArcIterator_done(struct __pyx_obj_9pywra
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":3029
+  /* "pywrapfst.pyx":3045
  *       True if the iterator is exhausted, False otherwise.
  *     """
  *     return self._aiter.get().Done()             # <<<<<<<<<<<<<<
@@ -32922,12 +32997,12 @@ static bool __pyx_f_9pywrapfst_18MutableArcIterator_done(struct __pyx_obj_9pywra
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_aiter");
-    __PYX_ERR(0, 3029, __pyx_L1_error)
+    __PYX_ERR(0, 3045, __pyx_L1_error)
   }
   __pyx_r = __pyx_v_self->_aiter.get()->Done();
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3017
+  /* "pywrapfst.pyx":3033
  *     return result
  * 
  *   cpdef bool done(self):             # <<<<<<<<<<<<<<
@@ -32968,7 +33043,7 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_8done(struct __pyx_obj
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("done", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_18MutableArcIterator_done(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3017, __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, 3033, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -32985,7 +33060,7 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_8done(struct __pyx_obj
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3031
+/* "pywrapfst.pyx":3047
  *     return self._aiter.get().Done()
  * 
  *   cpdef uint32 flags(self):             # <<<<<<<<<<<<<<
@@ -33007,7 +33082,7 @@ static __pyx_t_10basictypes_uint32 __pyx_f_9pywrapfst_18MutableArcIterator_flags
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3031, __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, 3047, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_11flags)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -33022,14 +33097,14 @@ static __pyx_t_10basictypes_uint32 __pyx_f_9pywrapfst_18MutableArcIterator_flags
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3031, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3047, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3031, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3047, __pyx_L1_error)
       }
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_5 = __Pyx_PyInt_As_uint32_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3031, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyInt_As_uint32_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3047, __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;
@@ -33038,7 +33113,7 @@ static __pyx_t_10basictypes_uint32 __pyx_f_9pywrapfst_18MutableArcIterator_flags
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":3043
+  /* "pywrapfst.pyx":3059
  *       The current iterator behavioral flags as an integer.
  *     """
  *     return self._aiter.get().Flags()             # <<<<<<<<<<<<<<
@@ -33047,12 +33122,12 @@ static __pyx_t_10basictypes_uint32 __pyx_f_9pywrapfst_18MutableArcIterator_flags
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_aiter");
-    __PYX_ERR(0, 3043, __pyx_L1_error)
+    __PYX_ERR(0, 3059, __pyx_L1_error)
   }
   __pyx_r = __pyx_v_self->_aiter.get()->Flags();
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3031
+  /* "pywrapfst.pyx":3047
  *     return self._aiter.get().Done()
  * 
  *   cpdef uint32 flags(self):             # <<<<<<<<<<<<<<
@@ -33093,7 +33168,7 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_10flags(struct __pyx_o
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("flags", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_f_9pywrapfst_18MutableArcIterator_flags(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3031, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyInt_From_uint32_t(__pyx_f_9pywrapfst_18MutableArcIterator_flags(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3047, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -33110,7 +33185,7 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_10flags(struct __pyx_o
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3045
+/* "pywrapfst.pyx":3061
  *     return self._aiter.get().Flags()
  * 
  *   cpdef void next(self):             # <<<<<<<<<<<<<<
@@ -33130,7 +33205,7 @@ static void __pyx_f_9pywrapfst_18MutableArcIterator_next(struct __pyx_obj_9pywra
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3045, __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, 3061, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_13next)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -33145,10 +33220,10 @@ static void __pyx_f_9pywrapfst_18MutableArcIterator_next(struct __pyx_obj_9pywra
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3045, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3061, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3045, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3061, __pyx_L1_error)
       }
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -33159,7 +33234,7 @@ static void __pyx_f_9pywrapfst_18MutableArcIterator_next(struct __pyx_obj_9pywra
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":3054
+  /* "pywrapfst.pyx":3070
  *     should use the Pythonic API.
  *     """
  *     self._aiter.get().Next()             # <<<<<<<<<<<<<<
@@ -33168,11 +33243,11 @@ static void __pyx_f_9pywrapfst_18MutableArcIterator_next(struct __pyx_obj_9pywra
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_aiter");
-    __PYX_ERR(0, 3054, __pyx_L1_error)
+    __PYX_ERR(0, 3070, __pyx_L1_error)
   }
   __pyx_v_self->_aiter.get()->Next();
 
-  /* "pywrapfst.pyx":3045
+  /* "pywrapfst.pyx":3061
  *     return self._aiter.get().Flags()
  * 
  *   cpdef void next(self):             # <<<<<<<<<<<<<<
@@ -33212,7 +33287,7 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_12next(struct __pyx_ob
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("next", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_18MutableArcIterator_next(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3045, __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, 3061, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -33229,7 +33304,7 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_12next(struct __pyx_ob
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3056
+/* "pywrapfst.pyx":3072
  *     self._aiter.get().Next()
  * 
  *   cpdef size_t position(self):             # <<<<<<<<<<<<<<
@@ -33251,7 +33326,7 @@ static size_t __pyx_f_9pywrapfst_18MutableArcIterator_position(struct __pyx_obj_
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_position); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3056, __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, 3072, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_15position)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -33266,14 +33341,14 @@ static size_t __pyx_f_9pywrapfst_18MutableArcIterator_position(struct __pyx_obj_
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3056, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3072, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3056, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3072, __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, 3056, __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, 3072, __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;
@@ -33282,7 +33357,7 @@ static size_t __pyx_f_9pywrapfst_18MutableArcIterator_position(struct __pyx_obj_
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":3068
+  /* "pywrapfst.pyx":3084
  *       The iterator's position, expressed as an integer.
  *     """
  *     return self._aiter.get().Position()             # <<<<<<<<<<<<<<
@@ -33291,12 +33366,12 @@ static size_t __pyx_f_9pywrapfst_18MutableArcIterator_position(struct __pyx_obj_
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_aiter");
-    __PYX_ERR(0, 3068, __pyx_L1_error)
+    __PYX_ERR(0, 3084, __pyx_L1_error)
   }
   __pyx_r = __pyx_v_self->_aiter.get()->Position();
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3056
+  /* "pywrapfst.pyx":3072
  *     self._aiter.get().Next()
  * 
  *   cpdef size_t position(self):             # <<<<<<<<<<<<<<
@@ -33337,7 +33412,7 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_14position(struct __py
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("position", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_9pywrapfst_18MutableArcIterator_position(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3056, __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, 3072, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -33354,7 +33429,7 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_14position(struct __py
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3070
+/* "pywrapfst.pyx":3086
  *     return self._aiter.get().Position()
  * 
  *   cpdef void reset(self):             # <<<<<<<<<<<<<<
@@ -33374,7 +33449,7 @@ static void __pyx_f_9pywrapfst_18MutableArcIterator_reset(struct __pyx_obj_9pywr
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3070, __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, 3086, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_17reset)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -33389,10 +33464,10 @@ static void __pyx_f_9pywrapfst_18MutableArcIterator_reset(struct __pyx_obj_9pywr
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3070, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3086, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3070, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3086, __pyx_L1_error)
       }
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -33403,7 +33478,7 @@ static void __pyx_f_9pywrapfst_18MutableArcIterator_reset(struct __pyx_obj_9pywr
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":3079
+  /* "pywrapfst.pyx":3095
  *     should use the Pythonic API.
  *     """
  *     self._aiter.get().Reset()             # <<<<<<<<<<<<<<
@@ -33412,11 +33487,11 @@ static void __pyx_f_9pywrapfst_18MutableArcIterator_reset(struct __pyx_obj_9pywr
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_aiter");
-    __PYX_ERR(0, 3079, __pyx_L1_error)
+    __PYX_ERR(0, 3095, __pyx_L1_error)
   }
   __pyx_v_self->_aiter.get()->Reset();
 
-  /* "pywrapfst.pyx":3070
+  /* "pywrapfst.pyx":3086
  *     return self._aiter.get().Position()
  * 
  *   cpdef void reset(self):             # <<<<<<<<<<<<<<
@@ -33456,7 +33531,7 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_16reset(struct __pyx_o
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("reset", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_18MutableArcIterator_reset(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3070, __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, 3086, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -33473,7 +33548,7 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_16reset(struct __pyx_o
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3081
+/* "pywrapfst.pyx":3097
  *     self._aiter.get().Reset()
  * 
  *   cpdef void seek(self, size_t a):             # <<<<<<<<<<<<<<
@@ -33495,10 +33570,10 @@ static void __pyx_f_9pywrapfst_18MutableArcIterator_seek(struct __pyx_obj_9pywra
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3081, __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, 3097, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_19seek)) {
-      __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3081, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3097, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_INCREF(__pyx_t_1);
       __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
@@ -33512,14 +33587,14 @@ static void __pyx_f_9pywrapfst_18MutableArcIterator_seek(struct __pyx_obj_9pywra
         }
       }
       if (!__pyx_t_5) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3081, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3097, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         __Pyx_GOTREF(__pyx_t_2);
       } else {
         #if CYTHON_FAST_PYCALL
         if (PyFunction_Check(__pyx_t_4)) {
           PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
-          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3081, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3097, __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;
@@ -33528,20 +33603,20 @@ static void __pyx_f_9pywrapfst_18MutableArcIterator_seek(struct __pyx_obj_9pywra
         #if CYTHON_FAST_PYCCALL
         if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
           PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
-          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3081, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3097, __pyx_L1_error)
           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
           __Pyx_GOTREF(__pyx_t_2);
           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         } else
         #endif
         {
-          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3081, __pyx_L1_error)
+          __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3097, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_6);
           __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
           __Pyx_GIVEREF(__pyx_t_3);
           PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
           __pyx_t_3 = 0;
-          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3081, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3097, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_2);
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         }
@@ -33554,7 +33629,7 @@ static void __pyx_f_9pywrapfst_18MutableArcIterator_seek(struct __pyx_obj_9pywra
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":3093
+  /* "pywrapfst.pyx":3109
  *       a: The position to seek to.
  *     """
  *     self._aiter.get().Seek(a)             # <<<<<<<<<<<<<<
@@ -33563,11 +33638,11 @@ static void __pyx_f_9pywrapfst_18MutableArcIterator_seek(struct __pyx_obj_9pywra
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_aiter");
-    __PYX_ERR(0, 3093, __pyx_L1_error)
+    __PYX_ERR(0, 3109, __pyx_L1_error)
   }
   __pyx_v_self->_aiter.get()->Seek(__pyx_v_a);
 
-  /* "pywrapfst.pyx":3081
+  /* "pywrapfst.pyx":3097
  *     self._aiter.get().Reset()
  * 
  *   cpdef void seek(self, size_t a):             # <<<<<<<<<<<<<<
@@ -33598,7 +33673,7 @@ static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_19seek(PyObject *__pyx
   __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, 3081, __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, 3097, __pyx_L3_error)
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L3_error:;
@@ -33619,7 +33694,7 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_18seek(struct __pyx_ob
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("seek", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_18MutableArcIterator_seek(__pyx_v_self, __pyx_v_a, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3081, __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, 3097, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -33636,7 +33711,7 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_18seek(struct __pyx_ob
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3095
+/* "pywrapfst.pyx":3111
  *     self._aiter.get().Seek(a)
  * 
  *   cpdef void set_flags(self, uint32 flags, uint32 mask):             # <<<<<<<<<<<<<<
@@ -33660,12 +33735,12 @@ static void __pyx_f_9pywrapfst_18MutableArcIterator_set_flags(struct __pyx_obj_9
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3095, __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, 3111, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_21set_flags)) {
-      __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3095, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyInt_From_uint32_t(__pyx_v_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3111, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3095, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyInt_From_uint32_t(__pyx_v_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3111, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_INCREF(__pyx_t_1);
       __pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL;
@@ -33683,7 +33758,7 @@ static void __pyx_f_9pywrapfst_18MutableArcIterator_set_flags(struct __pyx_obj_9
       #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, 3095, __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, 3111, __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;
@@ -33693,7 +33768,7 @@ static void __pyx_f_9pywrapfst_18MutableArcIterator_set_flags(struct __pyx_obj_9
       #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, 3095, __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, 3111, __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;
@@ -33701,7 +33776,7 @@ static void __pyx_f_9pywrapfst_18MutableArcIterator_set_flags(struct __pyx_obj_9
       } else
       #endif
       {
-        __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3095, __pyx_L1_error)
+        __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3111, __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;
@@ -33712,7 +33787,7 @@ static void __pyx_f_9pywrapfst_18MutableArcIterator_set_flags(struct __pyx_obj_9
         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, 3095, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3111, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_2);
         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       }
@@ -33724,7 +33799,7 @@ static void __pyx_f_9pywrapfst_18MutableArcIterator_set_flags(struct __pyx_obj_9
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":3108
+  /* "pywrapfst.pyx":3124
  *       mask: A mask to be applied to the `flags` argument before setting them.
  *     """
  *     self._aiter.get().SetFlags(flags, mask)             # <<<<<<<<<<<<<<
@@ -33733,11 +33808,11 @@ static void __pyx_f_9pywrapfst_18MutableArcIterator_set_flags(struct __pyx_obj_9
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_aiter");
-    __PYX_ERR(0, 3108, __pyx_L1_error)
+    __PYX_ERR(0, 3124, __pyx_L1_error)
   }
   __pyx_v_self->_aiter.get()->SetFlags(__pyx_v_flags, __pyx_v_mask);
 
-  /* "pywrapfst.pyx":3095
+  /* "pywrapfst.pyx":3111
  *     self._aiter.get().Seek(a)
  * 
  *   cpdef void set_flags(self, uint32 flags, uint32 mask):             # <<<<<<<<<<<<<<
@@ -33789,11 +33864,11 @@ static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_21set_flags(PyObject *
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, 1); __PYX_ERR(0, 3095, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, 1); __PYX_ERR(0, 3111, __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, 3095, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_flags") < 0)) __PYX_ERR(0, 3111, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -33801,12 +33876,12 @@ static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_21set_flags(PyObject *
       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
     }
-    __pyx_v_flags = __Pyx_PyInt_As_uint32_t(values[0]); if (unlikely((__pyx_v_flags == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3095, __pyx_L3_error)
-    __pyx_v_mask = __Pyx_PyInt_As_uint32_t(values[1]); if (unlikely((__pyx_v_mask == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3095, __pyx_L3_error)
+    __pyx_v_flags = __Pyx_PyInt_As_uint32_t(values[0]); if (unlikely((__pyx_v_flags == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3111, __pyx_L3_error)
+    __pyx_v_mask = __Pyx_PyInt_As_uint32_t(values[1]); if (unlikely((__pyx_v_mask == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3111, __pyx_L3_error)
   }
   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, 3095, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3111, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("pywrapfst.MutableArcIterator.set_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -33825,7 +33900,7 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_20set_flags(struct __p
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("set_flags", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_18MutableArcIterator_set_flags(__pyx_v_self, __pyx_v_flags, __pyx_v_mask, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3095, __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, 3111, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -33842,7 +33917,7 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_20set_flags(struct __p
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3110
+/* "pywrapfst.pyx":3126
  *     self._aiter.get().SetFlags(flags, mask)
  * 
  *   cpdef void set_value(self, Arc arc):             # <<<<<<<<<<<<<<
@@ -33863,7 +33938,7 @@ static void __pyx_f_9pywrapfst_18MutableArcIterator_set_value(struct __pyx_obj_9
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3110, __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, 3126, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_23set_value)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -33878,13 +33953,13 @@ static void __pyx_f_9pywrapfst_18MutableArcIterator_set_value(struct __pyx_obj_9
         }
       }
       if (!__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_arc)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3110, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_arc)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3126, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_2);
       } else {
         #if CYTHON_FAST_PYCALL
         if (PyFunction_Check(__pyx_t_3)) {
           PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_arc)};
-          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3110, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3126, __pyx_L1_error)
           __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
           __Pyx_GOTREF(__pyx_t_2);
         } else
@@ -33892,19 +33967,19 @@ static void __pyx_f_9pywrapfst_18MutableArcIterator_set_value(struct __pyx_obj_9
         #if CYTHON_FAST_PYCCALL
         if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
           PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_arc)};
-          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3110, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3126, __pyx_L1_error)
           __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
           __Pyx_GOTREF(__pyx_t_2);
         } else
         #endif
         {
-          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3110, __pyx_L1_error)
+          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3126, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_5);
           __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
           __Pyx_INCREF(((PyObject *)__pyx_v_arc));
           __Pyx_GIVEREF(((PyObject *)__pyx_v_arc));
           PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_arc));
-          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3110, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3126, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_2);
           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
         }
@@ -33917,7 +33992,7 @@ static void __pyx_f_9pywrapfst_18MutableArcIterator_set_value(struct __pyx_obj_9
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":3119
+  /* "pywrapfst.pyx":3135
  *       arc: The arc to replace the current arc with.
  *     """
  *     self._aiter.get().SetValue(deref(arc._arc))             # <<<<<<<<<<<<<<
@@ -33926,15 +34001,15 @@ static void __pyx_f_9pywrapfst_18MutableArcIterator_set_value(struct __pyx_obj_9
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_aiter");
-    __PYX_ERR(0, 3119, __pyx_L1_error)
+    __PYX_ERR(0, 3135, __pyx_L1_error)
   }
   if (unlikely(((PyObject *)__pyx_v_arc) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_arc");
-    __PYX_ERR(0, 3119, __pyx_L1_error)
+    __PYX_ERR(0, 3135, __pyx_L1_error)
   }
   __pyx_v_self->_aiter.get()->SetValue((*__pyx_v_arc->_arc));
 
-  /* "pywrapfst.pyx":3110
+  /* "pywrapfst.pyx":3126
  *     self._aiter.get().SetFlags(flags, mask)
  * 
  *   cpdef void set_value(self, Arc arc):             # <<<<<<<<<<<<<<
@@ -33962,7 +34037,7 @@ static PyObject *__pyx_pw_9pywrapfst_18MutableArcIterator_23set_value(PyObject *
   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, 3110, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arc), __pyx_ptype_9pywrapfst_Arc, 1, "arc", 0))) __PYX_ERR(0, 3126, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_18MutableArcIterator_22set_value(((struct __pyx_obj_9pywrapfst_MutableArcIterator *)__pyx_v_self), ((struct __pyx_obj_9pywrapfst_Arc *)__pyx_v_arc));
 
   /* function exit code */
@@ -33980,7 +34055,7 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_22set_value(struct __p
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("set_value", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_18MutableArcIterator_set_value(__pyx_v_self, __pyx_v_arc, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3110, __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, 3126, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -33997,7 +34072,7 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_22set_value(struct __p
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3121
+/* "pywrapfst.pyx":3137
  *     self._aiter.get().SetValue(deref(arc._arc))
  * 
  *   cpdef object value(self):             # <<<<<<<<<<<<<<
@@ -34018,7 +34093,7 @@ static PyObject *__pyx_f_9pywrapfst_18MutableArcIterator_value(struct __pyx_obj_
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3121, __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, 3137, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_18MutableArcIterator_25value)) {
       __Pyx_XDECREF(__pyx_r);
@@ -34034,10 +34109,10 @@ static PyObject *__pyx_f_9pywrapfst_18MutableArcIterator_value(struct __pyx_obj_
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3121, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3137, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3121, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3137, __pyx_L1_error)
       }
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -34049,7 +34124,7 @@ static PyObject *__pyx_f_9pywrapfst_18MutableArcIterator_value(struct __pyx_obj_
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":3130
+  /* "pywrapfst.pyx":3146
  *     should use the Pythonic API.
  *     """
  *     return _init_Arc(self._aiter.get().Value())             # <<<<<<<<<<<<<<
@@ -34059,15 +34134,15 @@ static PyObject *__pyx_f_9pywrapfst_18MutableArcIterator_value(struct __pyx_obj_
   __Pyx_XDECREF(__pyx_r);
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_aiter");
-    __PYX_ERR(0, 3130, __pyx_L1_error)
+    __PYX_ERR(0, 3146, __pyx_L1_error)
   }
-  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_Arc(__pyx_v_self->_aiter.get()->Value())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3130, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_Arc(__pyx_v_self->_aiter.get()->Value())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3146, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3121
+  /* "pywrapfst.pyx":3137
  *     self._aiter.get().SetValue(deref(arc._arc))
  * 
  *   cpdef object value(self):             # <<<<<<<<<<<<<<
@@ -34109,7 +34184,7 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_24value(struct __pyx_o
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("value", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_9pywrapfst_18MutableArcIterator_value(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3121, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_9pywrapfst_18MutableArcIterator_value(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3137, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -34126,7 +34201,7 @@ static PyObject *__pyx_pf_9pywrapfst_18MutableArcIterator_24value(struct __pyx_o
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3146
+/* "pywrapfst.pyx":3162
  *   """
  * 
  *   def __repr__(self):             # <<<<<<<<<<<<<<
@@ -34157,7 +34232,7 @@ static PyObject *__pyx_pf_9pywrapfst_13StateIterator___repr__(struct __pyx_obj_9
   PyObject *__pyx_t_5 = NULL;
   __Pyx_RefNannySetupContext("__repr__", 0);
 
-  /* "pywrapfst.pyx":3147
+  /* "pywrapfst.pyx":3163
  * 
  *   def __repr__(self):
  *     return "<StateIterator at 0x{:x}>".format(id(self))             # <<<<<<<<<<<<<<
@@ -34165,14 +34240,14 @@ static PyObject *__pyx_pf_9pywrapfst_13StateIterator___repr__(struct __pyx_obj_9
  *   def __init__(self, _Fst ifst):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_StateIterator_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3147, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_StateIterator_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3163, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3147, __pyx_L1_error)
+  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3163, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3147, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3163, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_t_3 = NULL;
@@ -34186,14 +34261,14 @@ static PyObject *__pyx_pf_9pywrapfst_13StateIterator___repr__(struct __pyx_obj_9
     }
   }
   if (!__pyx_t_3) {
-    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3147, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3163, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else {
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_2)) {
       PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
-      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3147, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3163, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -34202,20 +34277,20 @@ static PyObject *__pyx_pf_9pywrapfst_13StateIterator___repr__(struct __pyx_obj_9
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
       PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
-      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3147, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3163, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     } else
     #endif
     {
-      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3147, __pyx_L1_error)
+      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3163, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
       __Pyx_GIVEREF(__pyx_t_4);
       PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
       __pyx_t_4 = 0;
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3147, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3163, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     }
@@ -34225,7 +34300,7 @@ static PyObject *__pyx_pf_9pywrapfst_13StateIterator___repr__(struct __pyx_obj_9
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3146
+  /* "pywrapfst.pyx":3162
  *   """
  * 
  *   def __repr__(self):             # <<<<<<<<<<<<<<
@@ -34248,7 +34323,7 @@ static PyObject *__pyx_pf_9pywrapfst_13StateIterator___repr__(struct __pyx_obj_9
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3149
+/* "pywrapfst.pyx":3165
  *     return "<StateIterator at 0x{:x}>".format(id(self))
  * 
  *   def __init__(self, _Fst ifst):             # <<<<<<<<<<<<<<
@@ -34281,7 +34356,7 @@ static int __pyx_pw_9pywrapfst_13StateIterator_3__init__(PyObject *__pyx_v_self,
         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, 3149, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 3165, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
       goto __pyx_L5_argtuple_error;
@@ -34292,13 +34367,13 @@ static int __pyx_pw_9pywrapfst_13StateIterator_3__init__(PyObject *__pyx_v_self,
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3149, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3165, __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, 3149, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3165, __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 */
@@ -34316,7 +34391,7 @@ static int __pyx_pf_9pywrapfst_13StateIterator_2__init__(struct __pyx_obj_9pywra
   std::shared_ptr<fst::script::FstClass>  __pyx_t_1;
   __Pyx_RefNannySetupContext("__init__", 0);
 
-  /* "pywrapfst.pyx":3151
+  /* "pywrapfst.pyx":3167
  *   def __init__(self, _Fst ifst):
  *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
  *     self._fst = ifst._fst             # <<<<<<<<<<<<<<
@@ -34325,16 +34400,16 @@ static int __pyx_pf_9pywrapfst_13StateIterator_2__init__(struct __pyx_obj_9pywra
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 3151, __pyx_L1_error)
+    __PYX_ERR(0, 3167, __pyx_L1_error)
   }
   __pyx_t_1 = __pyx_v_ifst->_fst;
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 3151, __pyx_L1_error)
+    __PYX_ERR(0, 3167, __pyx_L1_error)
   }
   __pyx_v_self->_fst = __pyx_t_1;
 
-  /* "pywrapfst.pyx":3152
+  /* "pywrapfst.pyx":3168
  *     # 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)))             # <<<<<<<<<<<<<<
@@ -34343,15 +34418,15 @@ static int __pyx_pf_9pywrapfst_13StateIterator_2__init__(struct __pyx_obj_9pywra
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_siter");
-    __PYX_ERR(0, 3152, __pyx_L1_error)
+    __PYX_ERR(0, 3168, __pyx_L1_error)
   }
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 3152, __pyx_L1_error)
+    __PYX_ERR(0, 3168, __pyx_L1_error)
   }
   __pyx_v_self->_siter.reset(new fst::script::StateIteratorClass((*__pyx_v_self->_fst)));
 
-  /* "pywrapfst.pyx":3149
+  /* "pywrapfst.pyx":3165
  *     return "<StateIterator at 0x{:x}>".format(id(self))
  * 
  *   def __init__(self, _Fst ifst):             # <<<<<<<<<<<<<<
@@ -34370,7 +34445,7 @@ static int __pyx_pf_9pywrapfst_13StateIterator_2__init__(struct __pyx_obj_9pywra
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3155
+/* "pywrapfst.pyx":3171
  * 
  *   # This just registers this class as a possible iterator.
  *   def __iter__(self):             # <<<<<<<<<<<<<<
@@ -34396,7 +34471,7 @@ static PyObject *__pyx_pf_9pywrapfst_13StateIterator_4__iter__(struct __pyx_obj_
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__iter__", 0);
 
-  /* "pywrapfst.pyx":3156
+  /* "pywrapfst.pyx":3172
  *   # This just registers this class as a possible iterator.
  *   def __iter__(self):
  *     return self             # <<<<<<<<<<<<<<
@@ -34408,7 +34483,7 @@ static PyObject *__pyx_pf_9pywrapfst_13StateIterator_4__iter__(struct __pyx_obj_
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3155
+  /* "pywrapfst.pyx":3171
  * 
  *   # This just registers this class as a possible iterator.
  *   def __iter__(self):             # <<<<<<<<<<<<<<
@@ -34423,7 +34498,7 @@ static PyObject *__pyx_pf_9pywrapfst_13StateIterator_4__iter__(struct __pyx_obj_
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3159
+/* "pywrapfst.pyx":3175
  * 
  *   # Magic method used to get a Pythonic API out of the C++ API.
  *   def __next__(self):             # <<<<<<<<<<<<<<
@@ -34452,7 +34527,7 @@ static PyObject *__pyx_pf_9pywrapfst_13StateIterator_6__next__(struct __pyx_obj_
   PyObject *__pyx_t_2 = NULL;
   __Pyx_RefNannySetupContext("__next__", 0);
 
-  /* "pywrapfst.pyx":3160
+  /* "pywrapfst.pyx":3176
  *   # Magic method used to get a Pythonic API out of the C++ API.
  *   def __next__(self):
  *     if self.done():             # <<<<<<<<<<<<<<
@@ -34461,12 +34536,12 @@ static PyObject *__pyx_pf_9pywrapfst_13StateIterator_6__next__(struct __pyx_obj_
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "done");
-    __PYX_ERR(0, 3160, __pyx_L1_error)
+    __PYX_ERR(0, 3176, __pyx_L1_error)
   }
   __pyx_t_1 = (((struct __pyx_vtabstruct_9pywrapfst_StateIterator *)__pyx_v_self->__pyx_vtab)->done(__pyx_v_self, 0) != 0);
   if (__pyx_t_1) {
 
-    /* "pywrapfst.pyx":3161
+    /* "pywrapfst.pyx":3177
  *   def __next__(self):
  *     if self.done():
  *       raise StopIteration             # <<<<<<<<<<<<<<
@@ -34474,9 +34549,9 @@ static PyObject *__pyx_pf_9pywrapfst_13StateIterator_6__next__(struct __pyx_obj_
  *     self.next()
  */
     __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-    __PYX_ERR(0, 3161, __pyx_L1_error)
+    __PYX_ERR(0, 3177, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":3160
+    /* "pywrapfst.pyx":3176
  *   # Magic method used to get a Pythonic API out of the C++ API.
  *   def __next__(self):
  *     if self.done():             # <<<<<<<<<<<<<<
@@ -34485,7 +34560,7 @@ static PyObject *__pyx_pf_9pywrapfst_13StateIterator_6__next__(struct __pyx_obj_
  */
   }
 
-  /* "pywrapfst.pyx":3162
+  /* "pywrapfst.pyx":3178
  *     if self.done():
  *       raise StopIteration
  *     cdef int64 result = self.value()             # <<<<<<<<<<<<<<
@@ -34494,11 +34569,11 @@ static PyObject *__pyx_pf_9pywrapfst_13StateIterator_6__next__(struct __pyx_obj_
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "value");
-    __PYX_ERR(0, 3162, __pyx_L1_error)
+    __PYX_ERR(0, 3178, __pyx_L1_error)
   }
   __pyx_v_result = ((struct __pyx_vtabstruct_9pywrapfst_StateIterator *)__pyx_v_self->__pyx_vtab)->value(__pyx_v_self, 0);
 
-  /* "pywrapfst.pyx":3163
+  /* "pywrapfst.pyx":3179
  *       raise StopIteration
  *     cdef int64 result = self.value()
  *     self.next()             # <<<<<<<<<<<<<<
@@ -34507,11 +34582,11 @@ static PyObject *__pyx_pf_9pywrapfst_13StateIterator_6__next__(struct __pyx_obj_
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "next");
-    __PYX_ERR(0, 3163, __pyx_L1_error)
+    __PYX_ERR(0, 3179, __pyx_L1_error)
   }
   ((struct __pyx_vtabstruct_9pywrapfst_StateIterator *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0);
 
-  /* "pywrapfst.pyx":3164
+  /* "pywrapfst.pyx":3180
  *     cdef int64 result = self.value()
  *     self.next()
  *     return result             # <<<<<<<<<<<<<<
@@ -34519,13 +34594,13 @@ static PyObject *__pyx_pf_9pywrapfst_13StateIterator_6__next__(struct __pyx_obj_
  *   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, 3164, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_int64_t(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3180, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3159
+  /* "pywrapfst.pyx":3175
  * 
  *   # Magic method used to get a Pythonic API out of the C++ API.
  *   def __next__(self):             # <<<<<<<<<<<<<<
@@ -34544,7 +34619,7 @@ static PyObject *__pyx_pf_9pywrapfst_13StateIterator_6__next__(struct __pyx_obj_
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3166
+/* "pywrapfst.pyx":3182
  *     return result
  * 
  *   cpdef bool done(self):             # <<<<<<<<<<<<<<
@@ -34566,7 +34641,7 @@ static bool __pyx_f_9pywrapfst_13StateIterator_done(struct __pyx_obj_9pywrapfst_
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3166, __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, 3182, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_13StateIterator_9done)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -34581,14 +34656,14 @@ static bool __pyx_f_9pywrapfst_13StateIterator_done(struct __pyx_obj_9pywrapfst_
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3166, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3182, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3166, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3182, __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, 3166, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3182, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __pyx_r = __pyx_t_5;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -34597,7 +34672,7 @@ static bool __pyx_f_9pywrapfst_13StateIterator_done(struct __pyx_obj_9pywrapfst_
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":3178
+  /* "pywrapfst.pyx":3194
  *       True if the iterator is exhausted, False otherwise.
  *     """
  *     return self._siter.get().Done()             # <<<<<<<<<<<<<<
@@ -34606,12 +34681,12 @@ static bool __pyx_f_9pywrapfst_13StateIterator_done(struct __pyx_obj_9pywrapfst_
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_siter");
-    __PYX_ERR(0, 3178, __pyx_L1_error)
+    __PYX_ERR(0, 3194, __pyx_L1_error)
   }
   __pyx_r = __pyx_v_self->_siter.get()->Done();
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3166
+  /* "pywrapfst.pyx":3182
  *     return result
  * 
  *   cpdef bool done(self):             # <<<<<<<<<<<<<<
@@ -34652,7 +34727,7 @@ static PyObject *__pyx_pf_9pywrapfst_13StateIterator_8done(struct __pyx_obj_9pyw
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("done", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_13StateIterator_done(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3166, __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, 3182, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -34669,7 +34744,7 @@ static PyObject *__pyx_pf_9pywrapfst_13StateIterator_8done(struct __pyx_obj_9pyw
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3180
+/* "pywrapfst.pyx":3196
  *     return self._siter.get().Done()
  * 
  *   cpdef void next(self):             # <<<<<<<<<<<<<<
@@ -34689,7 +34764,7 @@ static void __pyx_f_9pywrapfst_13StateIterator_next(struct __pyx_obj_9pywrapfst_
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3180, __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, 3196, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_13StateIterator_11next)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -34704,10 +34779,10 @@ static void __pyx_f_9pywrapfst_13StateIterator_next(struct __pyx_obj_9pywrapfst_
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3180, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3196, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3180, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3196, __pyx_L1_error)
       }
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -34718,7 +34793,7 @@ static void __pyx_f_9pywrapfst_13StateIterator_next(struct __pyx_obj_9pywrapfst_
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":3189
+  /* "pywrapfst.pyx":3205
  *     should use the Pythonic API.
  *     """
  *     self._siter.get().Next()             # <<<<<<<<<<<<<<
@@ -34727,11 +34802,11 @@ static void __pyx_f_9pywrapfst_13StateIterator_next(struct __pyx_obj_9pywrapfst_
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_siter");
-    __PYX_ERR(0, 3189, __pyx_L1_error)
+    __PYX_ERR(0, 3205, __pyx_L1_error)
   }
   __pyx_v_self->_siter.get()->Next();
 
-  /* "pywrapfst.pyx":3180
+  /* "pywrapfst.pyx":3196
  *     return self._siter.get().Done()
  * 
  *   cpdef void next(self):             # <<<<<<<<<<<<<<
@@ -34771,7 +34846,7 @@ static PyObject *__pyx_pf_9pywrapfst_13StateIterator_10next(struct __pyx_obj_9py
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("next", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_13StateIterator_next(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3180, __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, 3196, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -34788,7 +34863,7 @@ static PyObject *__pyx_pf_9pywrapfst_13StateIterator_10next(struct __pyx_obj_9py
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3191
+/* "pywrapfst.pyx":3207
  *     self._siter.get().Next()
  * 
  *   cpdef void reset(self):             # <<<<<<<<<<<<<<
@@ -34808,7 +34883,7 @@ static void __pyx_f_9pywrapfst_13StateIterator_reset(struct __pyx_obj_9pywrapfst
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3191, __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, 3207, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_13StateIterator_13reset)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -34823,10 +34898,10 @@ static void __pyx_f_9pywrapfst_13StateIterator_reset(struct __pyx_obj_9pywrapfst
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3191, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3207, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3191, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3207, __pyx_L1_error)
       }
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -34837,7 +34912,7 @@ static void __pyx_f_9pywrapfst_13StateIterator_reset(struct __pyx_obj_9pywrapfst
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":3200
+  /* "pywrapfst.pyx":3216
  *     should use the Pythonic API.
  *     """
  *     self._siter.get().Reset()             # <<<<<<<<<<<<<<
@@ -34846,11 +34921,11 @@ static void __pyx_f_9pywrapfst_13StateIterator_reset(struct __pyx_obj_9pywrapfst
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_siter");
-    __PYX_ERR(0, 3200, __pyx_L1_error)
+    __PYX_ERR(0, 3216, __pyx_L1_error)
   }
   __pyx_v_self->_siter.get()->Reset();
 
-  /* "pywrapfst.pyx":3191
+  /* "pywrapfst.pyx":3207
  *     self._siter.get().Next()
  * 
  *   cpdef void reset(self):             # <<<<<<<<<<<<<<
@@ -34890,7 +34965,7 @@ static PyObject *__pyx_pf_9pywrapfst_13StateIterator_12reset(struct __pyx_obj_9p
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("reset", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_13StateIterator_reset(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3191, __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, 3207, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -34907,7 +34982,7 @@ static PyObject *__pyx_pf_9pywrapfst_13StateIterator_12reset(struct __pyx_obj_9p
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3202
+/* "pywrapfst.pyx":3218
  *     self._siter.get().Reset()
  * 
  *   cpdef int64 value(self):             # <<<<<<<<<<<<<<
@@ -34929,7 +35004,7 @@ static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_13StateIterator_value(struc
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3202, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3218, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_13StateIterator_15value)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -34944,14 +35019,14 @@ static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_13StateIterator_value(struc
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3202, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3218, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3202, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3218, __pyx_L1_error)
       }
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3202, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_5 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3218, __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;
@@ -34960,7 +35035,7 @@ static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_13StateIterator_value(struc
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":3211
+  /* "pywrapfst.pyx":3227
  *     should use the Pythonic API.
  *     """
  *     return self._siter.get().Value()             # <<<<<<<<<<<<<<
@@ -34969,12 +35044,12 @@ static __pyx_t_10basictypes_int64 __pyx_f_9pywrapfst_13StateIterator_value(struc
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_siter");
-    __PYX_ERR(0, 3211, __pyx_L1_error)
+    __PYX_ERR(0, 3227, __pyx_L1_error)
   }
   __pyx_r = __pyx_v_self->_siter.get()->Value();
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3202
+  /* "pywrapfst.pyx":3218
  *     self._siter.get().Reset()
  * 
  *   cpdef int64 value(self):             # <<<<<<<<<<<<<<
@@ -35015,7 +35090,7 @@ static PyObject *__pyx_pf_9pywrapfst_13StateIterator_14value(struct __pyx_obj_9p
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("value", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_f_9pywrapfst_13StateIterator_value(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3202, __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, 3218, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -35032,7 +35107,7 @@ static PyObject *__pyx_pf_9pywrapfst_13StateIterator_14value(struct __pyx_obj_9p
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3217
+/* "pywrapfst.pyx":3233
  * 
  * 
  * cdef _Fst _map(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -35044,7 +35119,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__map(struct __pyx_ob
   float __pyx_v_delta = __pyx_k__34;
   PyObject *__pyx_v_mt = ((PyObject *)__pyx_n_b_identity);
 
-  /* "pywrapfst.pyx":3220
+  /* "pywrapfst.pyx":3236
  *                float delta=fst.kDelta,
  *                mt=b"identity",
  *                weight=None):             # <<<<<<<<<<<<<<
@@ -35079,27 +35154,27 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__map(struct __pyx_ob
     }
   }
 
-  /* "pywrapfst.pyx":3222
+  /* "pywrapfst.pyx":3238
  *                weight=None):
  *   cdef fst.MapType map_type
  *   if not fst.GetMapType(tostring(mt), addr(map_type)):             # <<<<<<<<<<<<<<
  *     raise FstArgError("Unknown map type: {!r}".format(mt))
  *   cdef fst.WeightClass wc = (_get_WeightClass_or_One(ifst.weight_type(),
  */
-  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_mt, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3222, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_mt, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3238, __pyx_L1_error)
   __pyx_t_2 = ((!(fst::script::GetMapType(__pyx_t_1, (&__pyx_v_map_type)) != 0)) != 0);
   if (__pyx_t_2) {
 
-    /* "pywrapfst.pyx":3223
+    /* "pywrapfst.pyx":3239
  *   cdef fst.MapType map_type
  *   if not fst.GetMapType(tostring(mt), addr(map_type)):
  *     raise FstArgError("Unknown map type: {!r}".format(mt))             # <<<<<<<<<<<<<<
  *   cdef fst.WeightClass wc = (_get_WeightClass_or_One(ifst.weight_type(),
  *       weight) if mt == fst.TIMES_MAPPER else
  */
-    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3223, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3239, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_map_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3223, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_map_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3239, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __pyx_t_7 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
@@ -35112,13 +35187,13 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__map(struct __pyx_ob
       }
     }
     if (!__pyx_t_7) {
-      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_mt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3223, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_mt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3239, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
     } else {
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_6)) {
         PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_mt};
-        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3223, __pyx_L1_error)
+        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3239, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
         __Pyx_GOTREF(__pyx_t_5);
       } else
@@ -35126,19 +35201,19 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__map(struct __pyx_ob
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
         PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_mt};
-        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3223, __pyx_L1_error)
+        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3239, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
         __Pyx_GOTREF(__pyx_t_5);
       } else
       #endif
       {
-        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3223, __pyx_L1_error)
+        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3239, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
         __Pyx_INCREF(__pyx_v_mt);
         __Pyx_GIVEREF(__pyx_v_mt);
         PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_mt);
-        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3223, __pyx_L1_error)
+        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3239, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       }
@@ -35155,14 +35230,14 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__map(struct __pyx_ob
       }
     }
     if (!__pyx_t_6) {
-      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3223, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3239, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_GOTREF(__pyx_t_3);
     } else {
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_4)) {
         PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
-        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3223, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3239, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -35171,20 +35246,20 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__map(struct __pyx_ob
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
         PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
-        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3223, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3239, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       } else
       #endif
       {
-        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3223, __pyx_L1_error)
+        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3239, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
         __Pyx_GIVEREF(__pyx_t_5);
         PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
         __pyx_t_5 = 0;
-        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3223, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3239, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       }
@@ -35192,9 +35267,9 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__map(struct __pyx_ob
     __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, 3223, __pyx_L1_error)
+    __PYX_ERR(0, 3239, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":3222
+    /* "pywrapfst.pyx":3238
  *                weight=None):
  *   cdef fst.MapType map_type
  *   if not fst.GetMapType(tostring(mt), addr(map_type)):             # <<<<<<<<<<<<<<
@@ -35203,22 +35278,22 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__map(struct __pyx_ob
  */
   }
 
-  /* "pywrapfst.pyx":3225
+  /* "pywrapfst.pyx":3241
  *     raise FstArgError("Unknown map type: {!r}".format(mt))
  *   cdef fst.WeightClass wc = (_get_WeightClass_or_One(ifst.weight_type(),
  *       weight) if mt == fst.TIMES_MAPPER else             # <<<<<<<<<<<<<<
  *       _get_WeightClass_or_Zero(ifst.weight_type(), weight))
  *   return _init_XFst(fst.Map(deref(ifst._fst), map_type, delta, wc))
  */
-  __pyx_t_3 = __Pyx_PyInt_From_enum__fst_3a__3a_script_3a__3a_MapType(fst::script::TIMES_MAPPER); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3225, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyInt_From_enum__fst_3a__3a_script_3a__3a_MapType(fst::script::TIMES_MAPPER); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3241, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = PyObject_RichCompare(__pyx_v_mt, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3225, __pyx_L1_error)
+  __pyx_t_4 = PyObject_RichCompare(__pyx_v_mt, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3241, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3225, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 3241, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   if (__pyx_t_2) {
 
-    /* "pywrapfst.pyx":3224
+    /* "pywrapfst.pyx":3240
  *   if not fst.GetMapType(tostring(mt), addr(map_type)):
  *     raise FstArgError("Unknown map type: {!r}".format(mt))
  *   cdef fst.WeightClass wc = (_get_WeightClass_or_One(ifst.weight_type(),             # <<<<<<<<<<<<<<
@@ -35227,21 +35302,21 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__map(struct __pyx_ob
  */
     if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "weight_type");
-      __PYX_ERR(0, 3224, __pyx_L1_error)
+      __PYX_ERR(0, 3240, __pyx_L1_error)
     }
 
-    /* "pywrapfst.pyx":3225
+    /* "pywrapfst.pyx":3241
  *     raise FstArgError("Unknown map type: {!r}".format(mt))
  *   cdef fst.WeightClass wc = (_get_WeightClass_or_One(ifst.weight_type(),
  *       weight) if mt == fst.TIMES_MAPPER else             # <<<<<<<<<<<<<<
  *       _get_WeightClass_or_Zero(ifst.weight_type(), weight))
  *   return _init_XFst(fst.Map(deref(ifst._fst), map_type, delta, wc))
  */
-    __pyx_t_10 = __pyx_f_9pywrapfst__get_WeightClass_or_One(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3224, __pyx_L1_error)
+    __pyx_t_10 = __pyx_f_9pywrapfst__get_WeightClass_or_One(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3240, __pyx_L1_error)
     __pyx_t_9 = __pyx_t_10;
   } else {
 
-    /* "pywrapfst.pyx":3226
+    /* "pywrapfst.pyx":3242
  *   cdef fst.WeightClass wc = (_get_WeightClass_or_One(ifst.weight_type(),
  *       weight) if mt == fst.TIMES_MAPPER else
  *       _get_WeightClass_or_Zero(ifst.weight_type(), weight))             # <<<<<<<<<<<<<<
@@ -35250,14 +35325,14 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__map(struct __pyx_ob
  */
     if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "weight_type");
-      __PYX_ERR(0, 3226, __pyx_L1_error)
+      __PYX_ERR(0, 3242, __pyx_L1_error)
     }
-    __pyx_t_10 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3226, __pyx_L1_error)
+    __pyx_t_10 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3242, __pyx_L1_error)
     __pyx_t_9 = __pyx_t_10;
   }
   __pyx_v_wc = __pyx_t_9;
 
-  /* "pywrapfst.pyx":3227
+  /* "pywrapfst.pyx":3243
  *       weight) if mt == fst.TIMES_MAPPER else
  *       _get_WeightClass_or_Zero(ifst.weight_type(), weight))
  *   return _init_XFst(fst.Map(deref(ifst._fst), map_type, delta, wc))             # <<<<<<<<<<<<<<
@@ -35267,15 +35342,15 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__map(struct __pyx_ob
   __Pyx_XDECREF(((PyObject *)__pyx_r));
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 3227, __pyx_L1_error)
+    __PYX_ERR(0, 3243, __pyx_L1_error)
   }
-  __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(fst::script::Map((*__pyx_v_ifst->_fst), __pyx_v_map_type, __pyx_v_delta, __pyx_v_wc))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3227, __pyx_L1_error)
+  __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(fst::script::Map((*__pyx_v_ifst->_fst), __pyx_v_map_type, __pyx_v_delta, __pyx_v_wc))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3243, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_4);
   __pyx_t_4 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3217
+  /* "pywrapfst.pyx":3233
  * 
  * 
  * cdef _Fst _map(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -35299,7 +35374,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst__map(struct __pyx_ob
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3230
+/* "pywrapfst.pyx":3246
  * 
  * 
  * cpdef _Fst arcmap(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -35312,7 +35387,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_arcmap(struct __pyx_
   float __pyx_v_delta = __pyx_k__35;
   PyObject *__pyx_v_mt = ((PyObject *)__pyx_n_b_identity);
 
-  /* "pywrapfst.pyx":3233
+  /* "pywrapfst.pyx":3249
  *                   float delta=fst.kDelta,
  *                   mt=b"identity",
  *                   weight=None):             # <<<<<<<<<<<<<<
@@ -35337,7 +35412,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_arcmap(struct __pyx_
     }
   }
 
-  /* "pywrapfst.pyx":3271
+  /* "pywrapfst.pyx":3287
  *   See also: `statemap`.
  *   """
  *   return _map(ifst, delta, mt, weight)             # <<<<<<<<<<<<<<
@@ -35349,13 +35424,13 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_arcmap(struct __pyx_
   __pyx_t_2.delta = __pyx_v_delta;
   __pyx_t_2.mt = __pyx_v_mt;
   __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, 3271, __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, 3287, __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":3230
+  /* "pywrapfst.pyx":3246
  * 
  * 
  * cpdef _Fst arcmap(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -35390,7 +35465,7 @@ static PyObject *__pyx_pw_9pywrapfst_13arcmap(PyObject *__pyx_self, PyObject *__
     PyObject* values[4] = {0,0,0,0};
     values[2] = ((PyObject *)__pyx_n_b_identity);
 
-    /* "pywrapfst.pyx":3233
+    /* "pywrapfst.pyx":3249
  *                   float delta=fst.kDelta,
  *                   mt=b"identity",
  *                   weight=None):             # <<<<<<<<<<<<<<
@@ -35431,7 +35506,7 @@ static PyObject *__pyx_pw_9pywrapfst_13arcmap(PyObject *__pyx_self, PyObject *__
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arcmap") < 0)) __PYX_ERR(0, 3230, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "arcmap") < 0)) __PYX_ERR(0, 3246, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -35445,7 +35520,7 @@ static PyObject *__pyx_pw_9pywrapfst_13arcmap(PyObject *__pyx_self, PyObject *__
     }
     __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, 3231, __pyx_L3_error)
+      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3247, __pyx_L3_error)
     } else {
       __pyx_v_delta = __pyx_k__35;
     }
@@ -35454,16 +35529,16 @@ static PyObject *__pyx_pw_9pywrapfst_13arcmap(PyObject *__pyx_self, PyObject *__
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("arcmap", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3230, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("arcmap", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3246, __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, 3230, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3246, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_12arcmap(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_mt, __pyx_v_weight);
 
-  /* "pywrapfst.pyx":3230
+  /* "pywrapfst.pyx":3246
  * 
  * 
  * cpdef _Fst arcmap(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -35491,7 +35566,7 @@ static PyObject *__pyx_pf_9pywrapfst_12arcmap(CYTHON_UNUSED PyObject *__pyx_self
   __pyx_t_2.delta = __pyx_v_delta;
   __pyx_t_2.mt = __pyx_v_mt;
   __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, 3230, __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, 3246, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -35508,7 +35583,7 @@ static PyObject *__pyx_pf_9pywrapfst_12arcmap(CYTHON_UNUSED PyObject *__pyx_self
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3274
+/* "pywrapfst.pyx":3290
  * 
  * 
  * cpdef _MutableFst compose(_Fst ifst1,             # <<<<<<<<<<<<<<
@@ -35520,7 +35595,7 @@ static PyObject *__pyx_pw_9pywrapfst_15compose(PyObject *__pyx_self, PyObject *_
 static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_compose(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_compose *__pyx_optional_args) {
   PyObject *__pyx_v_cf = ((PyObject *)__pyx_n_b_auto);
 
-  /* "pywrapfst.pyx":3277
+  /* "pywrapfst.pyx":3293
  *                           _Fst ifst2,
  *                           cf=b"auto",
  *                           bool connect=True):             # <<<<<<<<<<<<<<
@@ -35545,7 +35620,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_compose(struc
     }
   }
 
-  /* "pywrapfst.pyx":3301
+  /* "pywrapfst.pyx":3317
  *   See also: `arcsort`.
  *   """
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst1.arc_type())             # <<<<<<<<<<<<<<
@@ -35554,22 +35629,22 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_compose(struc
  */
   if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
-    __PYX_ERR(0, 3301, __pyx_L1_error)
+    __PYX_ERR(0, 3317, __pyx_L1_error)
   }
   __pyx_v_tfst = new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst1->__pyx_vtab)->arc_type(__pyx_v_ifst1, 0));
 
-  /* "pywrapfst.pyx":3303
+  /* "pywrapfst.pyx":3319
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst1.arc_type())
  *   cdef unique_ptr[fst.ComposeOptions] opts
  *   opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(tostring(cf))))             # <<<<<<<<<<<<<<
  *   fst.Compose(deref(ifst1._fst), deref(ifst2._fst), tfst, deref(opts))
  *   return _init_MutableFst(tfst)
  */
-  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_cf, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3303, __pyx_L1_error)
-  __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3303, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_cf, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3319, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3319, __pyx_L1_error)
   __pyx_v_opts.reset(new fst::script::ComposeOptions(__pyx_v_connect, __pyx_t_2));
 
-  /* "pywrapfst.pyx":3304
+  /* "pywrapfst.pyx":3320
  *   cdef unique_ptr[fst.ComposeOptions] opts
  *   opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(tostring(cf))))
  *   fst.Compose(deref(ifst1._fst), deref(ifst2._fst), tfst, deref(opts))             # <<<<<<<<<<<<<<
@@ -35578,15 +35653,15 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_compose(struc
  */
   if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 3304, __pyx_L1_error)
+    __PYX_ERR(0, 3320, __pyx_L1_error)
   }
   if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 3304, __pyx_L1_error)
+    __PYX_ERR(0, 3320, __pyx_L1_error)
   }
   fst::script::Compose((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_tfst, (*__pyx_v_opts));
 
-  /* "pywrapfst.pyx":3305
+  /* "pywrapfst.pyx":3321
  *   opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(tostring(cf))))
  *   fst.Compose(deref(ifst1._fst), deref(ifst2._fst), tfst, deref(opts))
  *   return _init_MutableFst(tfst)             # <<<<<<<<<<<<<<
@@ -35594,13 +35669,13 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_compose(struc
  * 
  */
   __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3305, __pyx_L1_error)
+  __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3321, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_3);
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3274
+  /* "pywrapfst.pyx":3290
  * 
  * 
  * cpdef _MutableFst compose(_Fst ifst1,             # <<<<<<<<<<<<<<
@@ -35653,7 +35728,7 @@ static PyObject *__pyx_pw_9pywrapfst_15compose(PyObject *__pyx_self, PyObject *_
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("compose", 0, 2, 4, 1); __PYX_ERR(0, 3274, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("compose", 0, 2, 4, 1); __PYX_ERR(0, 3290, __pyx_L3_error)
         }
         case  2:
         if (kw_args > 0) {
@@ -35667,7 +35742,7 @@ static PyObject *__pyx_pw_9pywrapfst_15compose(PyObject *__pyx_self, PyObject *_
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compose") < 0)) __PYX_ERR(0, 3274, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compose") < 0)) __PYX_ERR(0, 3290, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -35683,10 +35758,10 @@ static PyObject *__pyx_pw_9pywrapfst_15compose(PyObject *__pyx_self, PyObject *_
     __pyx_v_ifst2 = ((struct __pyx_obj_9pywrapfst__Fst *)values[1]);
     __pyx_v_cf = 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, 3277, __pyx_L3_error)
+      __pyx_v_connect = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3293, __pyx_L3_error)
     } else {
 
-      /* "pywrapfst.pyx":3277
+      /* "pywrapfst.pyx":3293
  *                           _Fst ifst2,
  *                           cf=b"auto",
  *                           bool connect=True):             # <<<<<<<<<<<<<<
@@ -35698,17 +35773,17 @@ static PyObject *__pyx_pw_9pywrapfst_15compose(PyObject *__pyx_self, PyObject *_
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("compose", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3274, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("compose", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3290, __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, 3274, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3275, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3290, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3291, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_14compose(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_cf, __pyx_v_connect);
 
-  /* "pywrapfst.pyx":3274
+  /* "pywrapfst.pyx":3290
  * 
  * 
  * cpdef _MutableFst compose(_Fst ifst1,             # <<<<<<<<<<<<<<
@@ -35735,7 +35810,7 @@ static PyObject *__pyx_pf_9pywrapfst_14compose(CYTHON_UNUSED PyObject *__pyx_sel
   __pyx_t_2.__pyx_n = 2;
   __pyx_t_2.cf = __pyx_v_cf;
   __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, 3274, __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, 3290, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -35752,7 +35827,7 @@ static PyObject *__pyx_pf_9pywrapfst_14compose(CYTHON_UNUSED PyObject *__pyx_sel
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3308
+/* "pywrapfst.pyx":3324
  * 
  * 
  * cpdef _Fst convert(_Fst ifst, fst_type=b""):             # <<<<<<<<<<<<<<
@@ -35781,7 +35856,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_convert(struct __pyx
     }
   }
 
-  /* "pywrapfst.pyx":3325
+  /* "pywrapfst.pyx":3341
  *     FstOpError: Conversion failed.
  *   """
  *   cdef FstClass_ptr tfst = new fst.FstClass(deref(ifst._fst))             # <<<<<<<<<<<<<<
@@ -35790,11 +35865,11 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_convert(struct __pyx
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 3325, __pyx_L1_error)
+    __PYX_ERR(0, 3341, __pyx_L1_error)
   }
   __pyx_v_tfst = new fst::script::FstClass((*__pyx_v_ifst->_fst));
 
-  /* "pywrapfst.pyx":3326
+  /* "pywrapfst.pyx":3342
  *   """
  *   cdef FstClass_ptr tfst = new fst.FstClass(deref(ifst._fst))
  *   tfst = fst.Convert(deref(ifst._fst), tostring(fst_type))             # <<<<<<<<<<<<<<
@@ -35803,12 +35878,12 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_convert(struct __pyx
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 3326, __pyx_L1_error)
+    __PYX_ERR(0, 3342, __pyx_L1_error)
   }
-  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_fst_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3326, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_fst_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3342, __pyx_L1_error)
   __pyx_v_tfst = fst::script::Convert((*__pyx_v_ifst->_fst), __pyx_t_1);
 
-  /* "pywrapfst.pyx":3328
+  /* "pywrapfst.pyx":3344
  *   tfst = fst.Convert(deref(ifst._fst), tostring(fst_type))
  *   # Script-land Convert returns the null pointer to signal failure.
  *   if tfst == NULL:             # <<<<<<<<<<<<<<
@@ -35818,16 +35893,16 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_convert(struct __pyx
   __pyx_t_2 = ((__pyx_v_tfst == NULL) != 0);
   if (__pyx_t_2) {
 
-    /* "pywrapfst.pyx":3329
+    /* "pywrapfst.pyx":3345
  *   # Script-land Convert returns the null pointer to signal failure.
  *   if tfst == NULL:
  *     raise FstOpError("Conversion to {!r} failed".format(fst_type))             # <<<<<<<<<<<<<<
  *   return _init_XFst(tfst)
  * 
  */
-    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3329, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3345, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Conversion_to_r_failed_2, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3329, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Conversion_to_r_failed_2, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3345, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __pyx_t_7 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
@@ -35840,13 +35915,13 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_convert(struct __pyx
       }
     }
     if (!__pyx_t_7) {
-      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_fst_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3329, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_fst_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3345, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
     } else {
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_6)) {
         PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_fst_type};
-        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3329, __pyx_L1_error)
+        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3345, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
         __Pyx_GOTREF(__pyx_t_5);
       } else
@@ -35854,19 +35929,19 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_convert(struct __pyx
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
         PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_v_fst_type};
-        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3329, __pyx_L1_error)
+        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3345, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
         __Pyx_GOTREF(__pyx_t_5);
       } else
       #endif
       {
-        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3329, __pyx_L1_error)
+        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3345, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
         __Pyx_INCREF(__pyx_v_fst_type);
         __Pyx_GIVEREF(__pyx_v_fst_type);
         PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_fst_type);
-        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3329, __pyx_L1_error)
+        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3345, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       }
@@ -35883,14 +35958,14 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_convert(struct __pyx
       }
     }
     if (!__pyx_t_6) {
-      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3329, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3345, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_GOTREF(__pyx_t_3);
     } else {
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_4)) {
         PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
-        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3329, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3345, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -35899,20 +35974,20 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_convert(struct __pyx
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
         PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
-        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3329, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3345, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       } else
       #endif
       {
-        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3329, __pyx_L1_error)
+        __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3345, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
         __Pyx_GIVEREF(__pyx_t_5);
         PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
         __pyx_t_5 = 0;
-        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3329, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3345, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       }
@@ -35920,9 +35995,9 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_convert(struct __pyx
     __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, 3329, __pyx_L1_error)
+    __PYX_ERR(0, 3345, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":3328
+    /* "pywrapfst.pyx":3344
  *   tfst = fst.Convert(deref(ifst._fst), tostring(fst_type))
  *   # Script-land Convert returns the null pointer to signal failure.
  *   if tfst == NULL:             # <<<<<<<<<<<<<<
@@ -35931,7 +36006,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_convert(struct __pyx
  */
   }
 
-  /* "pywrapfst.pyx":3330
+  /* "pywrapfst.pyx":3346
  *   if tfst == NULL:
  *     raise FstOpError("Conversion to {!r} failed".format(fst_type))
  *   return _init_XFst(tfst)             # <<<<<<<<<<<<<<
@@ -35939,13 +36014,13 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_convert(struct __pyx
  * 
  */
   __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3330, __pyx_L1_error)
+  __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3346, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_3);
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3308
+  /* "pywrapfst.pyx":3324
  * 
  * 
  * cpdef _Fst convert(_Fst ifst, fst_type=b""):             # <<<<<<<<<<<<<<
@@ -36003,7 +36078,7 @@ static PyObject *__pyx_pw_9pywrapfst_17convert(PyObject *__pyx_self, PyObject *_
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convert") < 0)) __PYX_ERR(0, 3308, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "convert") < 0)) __PYX_ERR(0, 3324, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -36018,13 +36093,13 @@ static PyObject *__pyx_pw_9pywrapfst_17convert(PyObject *__pyx_self, PyObject *_
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("convert", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3308, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("convert", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3324, __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, 3308, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3324, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_16convert(__pyx_self, __pyx_v_ifst, __pyx_v_fst_type);
 
   /* function exit code */
@@ -36045,7 +36120,7 @@ static PyObject *__pyx_pf_9pywrapfst_16convert(CYTHON_UNUSED PyObject *__pyx_sel
   __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, 3308, __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, 3324, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -36062,7 +36137,7 @@ static PyObject *__pyx_pf_9pywrapfst_16convert(CYTHON_UNUSED PyObject *__pyx_sel
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3333
+/* "pywrapfst.pyx":3349
  * 
  * 
  * cpdef _MutableFst determinize(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -36077,7 +36152,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_determinize(s
   __pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__37;
   __pyx_t_10basictypes_int64 __pyx_v_subsequential_label = ((__pyx_t_10basictypes_int64)0);
 
-  /* "pywrapfst.pyx":3338
+  /* "pywrapfst.pyx":3354
  *                               int64 nstate=fst.kNoStateId,
  *                               int64 subsequential_label=0,
  *                               weight=None,             # <<<<<<<<<<<<<<
@@ -36086,7 +36161,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_determinize(s
  */
   PyObject *__pyx_v_weight = ((PyObject *)Py_None);
 
-  /* "pywrapfst.pyx":3339
+  /* "pywrapfst.pyx":3355
  *                               int64 subsequential_label=0,
  *                               weight=None,
  *                               bool increment_subsequential_label=False):             # <<<<<<<<<<<<<<
@@ -36131,7 +36206,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_determinize(s
     }
   }
 
-  /* "pywrapfst.pyx":3374
+  /* "pywrapfst.pyx":3390
  *   See also: `disambiguate`, `rmepsilon`.
  *   """
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())             # <<<<<<<<<<<<<<
@@ -36140,11 +36215,11 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_determinize(s
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
-    __PYX_ERR(0, 3374, __pyx_L1_error)
+    __PYX_ERR(0, 3390, __pyx_L1_error)
   }
   __pyx_v_tfst = new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0));
 
-  /* "pywrapfst.pyx":3376
+  /* "pywrapfst.pyx":3392
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
  *   # Threshold is set to semiring Zero (no pruning) if weight unspecified.
  *   cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(),             # <<<<<<<<<<<<<<
@@ -36153,40 +36228,40 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_determinize(s
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "weight_type");
-    __PYX_ERR(0, 3376, __pyx_L1_error)
+    __PYX_ERR(0, 3392, __pyx_L1_error)
   }
 
-  /* "pywrapfst.pyx":3377
+  /* "pywrapfst.pyx":3393
  *   # Threshold is set to semiring Zero (no pruning) if weight unspecified.
  *   cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(),
  *                                                      weight)             # <<<<<<<<<<<<<<
  *   cdef fst.DeterminizeType determinize_type
  *   if not fst.GetDeterminizeType(tostring(dt), addr(determinize_type)):
  */
-  __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, 3376, __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, 3392, __pyx_L1_error)
   __pyx_v_wc = __pyx_t_1;
 
-  /* "pywrapfst.pyx":3379
+  /* "pywrapfst.pyx":3395
  *                                                      weight)
  *   cdef fst.DeterminizeType determinize_type
  *   if not fst.GetDeterminizeType(tostring(dt), addr(determinize_type)):             # <<<<<<<<<<<<<<
  *     raise FstArgError("Unknown determinization type: {!r}".format(dt))
  *   cdef unique_ptr[fst.DeterminizeOptions] opts
  */
-  __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_dt, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3379, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_dt, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3395, __pyx_L1_error)
   __pyx_t_3 = ((!(fst::script::GetDeterminizeType(__pyx_t_2, (&__pyx_v_determinize_type)) != 0)) != 0);
   if (__pyx_t_3) {
 
-    /* "pywrapfst.pyx":3380
+    /* "pywrapfst.pyx":3396
  *   cdef fst.DeterminizeType determinize_type
  *   if not fst.GetDeterminizeType(tostring(dt), addr(determinize_type)):
  *     raise FstArgError("Unknown determinization type: {!r}".format(dt))             # <<<<<<<<<<<<<<
  *   cdef unique_ptr[fst.DeterminizeOptions] opts
  *   opts.reset(new fst.DeterminizeOptions(delta, wc, nstate, subsequential_label,
  */
-    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3380, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3396, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_determinization_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3380, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unknown_determinization_type_r, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3396, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     __pyx_t_8 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
@@ -36199,13 +36274,13 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_determinize(s
       }
     }
     if (!__pyx_t_8) {
-      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_dt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3380, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_dt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3396, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
     } else {
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_7)) {
         PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_dt};
-        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3380, __pyx_L1_error)
+        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3396, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
         __Pyx_GOTREF(__pyx_t_6);
       } else
@@ -36213,19 +36288,19 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_determinize(s
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
         PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_dt};
-        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3380, __pyx_L1_error)
+        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3396, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
         __Pyx_GOTREF(__pyx_t_6);
       } else
       #endif
       {
-        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3380, __pyx_L1_error)
+        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3396, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_9);
         __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
         __Pyx_INCREF(__pyx_v_dt);
         __Pyx_GIVEREF(__pyx_v_dt);
         PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_dt);
-        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3380, __pyx_L1_error)
+        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3396, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
       }
@@ -36242,14 +36317,14 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_determinize(s
       }
     }
     if (!__pyx_t_7) {
-      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3380, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3396, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       __Pyx_GOTREF(__pyx_t_4);
     } else {
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_5)) {
         PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
-        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3380, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3396, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
@@ -36258,20 +36333,20 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_determinize(s
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
         PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
-        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3380, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3396, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       } else
       #endif
       {
-        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3380, __pyx_L1_error)
+        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3396, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_9);
         __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
         __Pyx_GIVEREF(__pyx_t_6);
         PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
         __pyx_t_6 = 0;
-        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3380, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3396, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
       }
@@ -36279,9 +36354,9 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_determinize(s
     __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, 3380, __pyx_L1_error)
+    __PYX_ERR(0, 3396, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":3379
+    /* "pywrapfst.pyx":3395
  *                                                      weight)
  *   cdef fst.DeterminizeType determinize_type
  *   if not fst.GetDeterminizeType(tostring(dt), addr(determinize_type)):             # <<<<<<<<<<<<<<
@@ -36290,7 +36365,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_determinize(s
  */
   }
 
-  /* "pywrapfst.pyx":3382
+  /* "pywrapfst.pyx":3398
  *     raise FstArgError("Unknown determinization type: {!r}".format(dt))
  *   cdef unique_ptr[fst.DeterminizeOptions] opts
  *   opts.reset(new fst.DeterminizeOptions(delta, wc, nstate, subsequential_label,             # <<<<<<<<<<<<<<
@@ -36299,7 +36374,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_determinize(s
  */
   __pyx_v_opts.reset(new fst::script::DeterminizeOptions(__pyx_v_delta, __pyx_v_wc, __pyx_v_nstate, __pyx_v_subsequential_label, __pyx_v_determinize_type, __pyx_v_increment_subsequential_label));
 
-  /* "pywrapfst.pyx":3385
+  /* "pywrapfst.pyx":3401
  *                                         determinize_type,
  *                                         increment_subsequential_label))
  *   fst.Determinize(deref(ifst._fst), tfst, deref(opts))             # <<<<<<<<<<<<<<
@@ -36308,11 +36383,11 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_determinize(s
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 3385, __pyx_L1_error)
+    __PYX_ERR(0, 3401, __pyx_L1_error)
   }
   fst::script::Determinize((*__pyx_v_ifst->_fst), __pyx_v_tfst, (*__pyx_v_opts));
 
-  /* "pywrapfst.pyx":3386
+  /* "pywrapfst.pyx":3402
  *                                         increment_subsequential_label))
  *   fst.Determinize(deref(ifst._fst), tfst, deref(opts))
  *   return _init_MutableFst(tfst)             # <<<<<<<<<<<<<<
@@ -36320,13 +36395,13 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_determinize(s
  * 
  */
   __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3386, __pyx_L1_error)
+  __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3402, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_4);
   __pyx_t_4 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3333
+  /* "pywrapfst.pyx":3349
  * 
  * 
  * cpdef _MutableFst determinize(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -36369,7 +36444,7 @@ static PyObject *__pyx_pw_9pywrapfst_19determinize(PyObject *__pyx_self, PyObjec
     PyObject* values[7] = {0,0,0,0,0,0,0};
     values[2] = ((PyObject *)__pyx_n_b_functional);
 
-    /* "pywrapfst.pyx":3338
+    /* "pywrapfst.pyx":3354
  *                               int64 nstate=fst.kNoStateId,
  *                               int64 subsequential_label=0,
  *                               weight=None,             # <<<<<<<<<<<<<<
@@ -36428,7 +36503,7 @@ static PyObject *__pyx_pw_9pywrapfst_19determinize(PyObject *__pyx_self, PyObjec
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "determinize") < 0)) __PYX_ERR(0, 3333, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "determinize") < 0)) __PYX_ERR(0, 3349, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -36445,27 +36520,27 @@ static PyObject *__pyx_pw_9pywrapfst_19determinize(PyObject *__pyx_self, PyObjec
     }
     __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, 3334, __pyx_L3_error)
+      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3350, __pyx_L3_error)
     } else {
       __pyx_v_delta = __pyx_k__36;
     }
     __pyx_v_dt = values[2];
     if (values[3]) {
-      __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3336, __pyx_L3_error)
+      __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3352, __pyx_L3_error)
     } else {
       __pyx_v_nstate = __pyx_k__37;
     }
     if (values[4]) {
-      __pyx_v_subsequential_label = __Pyx_PyInt_As_int64_t(values[4]); if (unlikely((__pyx_v_subsequential_label == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3337, __pyx_L3_error)
+      __pyx_v_subsequential_label = __Pyx_PyInt_As_int64_t(values[4]); if (unlikely((__pyx_v_subsequential_label == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3353, __pyx_L3_error)
     } else {
       __pyx_v_subsequential_label = ((__pyx_t_10basictypes_int64)0);
     }
     __pyx_v_weight = values[5];
     if (values[6]) {
-      __pyx_v_increment_subsequential_label = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_increment_subsequential_label == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3339, __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, 3355, __pyx_L3_error)
     } else {
 
-      /* "pywrapfst.pyx":3339
+      /* "pywrapfst.pyx":3355
  *                               int64 subsequential_label=0,
  *                               weight=None,
  *                               bool increment_subsequential_label=False):             # <<<<<<<<<<<<<<
@@ -36477,16 +36552,16 @@ static PyObject *__pyx_pw_9pywrapfst_19determinize(PyObject *__pyx_self, PyObjec
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("determinize", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3333, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("determinize", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3349, __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, 3333, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3349, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_18determinize(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_dt, __pyx_v_nstate, __pyx_v_subsequential_label, __pyx_v_weight, __pyx_v_increment_subsequential_label);
 
-  /* "pywrapfst.pyx":3333
+  /* "pywrapfst.pyx":3349
  * 
  * 
  * cpdef _MutableFst determinize(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -36517,7 +36592,7 @@ static PyObject *__pyx_pf_9pywrapfst_18determinize(CYTHON_UNUSED PyObject *__pyx
   __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, 3333, __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, 3349, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -36534,7 +36609,7 @@ static PyObject *__pyx_pf_9pywrapfst_18determinize(CYTHON_UNUSED PyObject *__pyx
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3389
+/* "pywrapfst.pyx":3405
  * 
  * 
  * cpdef _MutableFst difference(_Fst ifst1,             # <<<<<<<<<<<<<<
@@ -36546,7 +36621,7 @@ static PyObject *__pyx_pw_9pywrapfst_21difference(PyObject *__pyx_self, PyObject
 static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_difference(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_difference *__pyx_optional_args) {
   PyObject *__pyx_v_cf = ((PyObject *)__pyx_n_b_auto);
 
-  /* "pywrapfst.pyx":3392
+  /* "pywrapfst.pyx":3408
  *                              _Fst ifst2,
  *                              cf=b"auto",
  *                              bool connect=True):             # <<<<<<<<<<<<<<
@@ -36571,7 +36646,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_difference(st
     }
   }
 
-  /* "pywrapfst.pyx":3415
+  /* "pywrapfst.pyx":3431
  *     An FST representing the difference of the two input FSTs.
  *   """
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst1.arc_type())             # <<<<<<<<<<<<<<
@@ -36580,22 +36655,22 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_difference(st
  */
   if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
-    __PYX_ERR(0, 3415, __pyx_L1_error)
+    __PYX_ERR(0, 3431, __pyx_L1_error)
   }
   __pyx_v_tfst = new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst1->__pyx_vtab)->arc_type(__pyx_v_ifst1, 0));
 
-  /* "pywrapfst.pyx":3417
+  /* "pywrapfst.pyx":3433
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst1.arc_type())
  *   cdef unique_ptr[fst.ComposeOptions] opts
  *   opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(tostring(cf))))             # <<<<<<<<<<<<<<
  *   fst.Difference(deref(ifst1._fst), deref(ifst2._fst), tfst, deref(opts))
  *   return _init_MutableFst(tfst)
  */
-  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_cf, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3417, __pyx_L1_error)
-  __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3417, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_cf, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3433, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3433, __pyx_L1_error)
   __pyx_v_opts.reset(new fst::script::ComposeOptions(__pyx_v_connect, __pyx_t_2));
 
-  /* "pywrapfst.pyx":3418
+  /* "pywrapfst.pyx":3434
  *   cdef unique_ptr[fst.ComposeOptions] opts
  *   opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(tostring(cf))))
  *   fst.Difference(deref(ifst1._fst), deref(ifst2._fst), tfst, deref(opts))             # <<<<<<<<<<<<<<
@@ -36604,15 +36679,15 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_difference(st
  */
   if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 3418, __pyx_L1_error)
+    __PYX_ERR(0, 3434, __pyx_L1_error)
   }
   if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 3418, __pyx_L1_error)
+    __PYX_ERR(0, 3434, __pyx_L1_error)
   }
   fst::script::Difference((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_tfst, (*__pyx_v_opts));
 
-  /* "pywrapfst.pyx":3419
+  /* "pywrapfst.pyx":3435
  *   opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(tostring(cf))))
  *   fst.Difference(deref(ifst1._fst), deref(ifst2._fst), tfst, deref(opts))
  *   return _init_MutableFst(tfst)             # <<<<<<<<<<<<<<
@@ -36620,13 +36695,13 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_difference(st
  * 
  */
   __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3419, __pyx_L1_error)
+  __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3435, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_3);
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3389
+  /* "pywrapfst.pyx":3405
  * 
  * 
  * cpdef _MutableFst difference(_Fst ifst1,             # <<<<<<<<<<<<<<
@@ -36679,7 +36754,7 @@ static PyObject *__pyx_pw_9pywrapfst_21difference(PyObject *__pyx_self, PyObject
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("difference", 0, 2, 4, 1); __PYX_ERR(0, 3389, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("difference", 0, 2, 4, 1); __PYX_ERR(0, 3405, __pyx_L3_error)
         }
         case  2:
         if (kw_args > 0) {
@@ -36693,7 +36768,7 @@ static PyObject *__pyx_pw_9pywrapfst_21difference(PyObject *__pyx_self, PyObject
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "difference") < 0)) __PYX_ERR(0, 3389, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "difference") < 0)) __PYX_ERR(0, 3405, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -36709,10 +36784,10 @@ static PyObject *__pyx_pw_9pywrapfst_21difference(PyObject *__pyx_self, PyObject
     __pyx_v_ifst2 = ((struct __pyx_obj_9pywrapfst__Fst *)values[1]);
     __pyx_v_cf = 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, 3392, __pyx_L3_error)
+      __pyx_v_connect = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3408, __pyx_L3_error)
     } else {
 
-      /* "pywrapfst.pyx":3392
+      /* "pywrapfst.pyx":3408
  *                              _Fst ifst2,
  *                              cf=b"auto",
  *                              bool connect=True):             # <<<<<<<<<<<<<<
@@ -36724,17 +36799,17 @@ static PyObject *__pyx_pw_9pywrapfst_21difference(PyObject *__pyx_self, PyObject
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("difference", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3389, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("difference", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3405, __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, 3389, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3390, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3405, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3406, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_20difference(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_cf, __pyx_v_connect);
 
-  /* "pywrapfst.pyx":3389
+  /* "pywrapfst.pyx":3405
  * 
  * 
  * cpdef _MutableFst difference(_Fst ifst1,             # <<<<<<<<<<<<<<
@@ -36761,7 +36836,7 @@ static PyObject *__pyx_pf_9pywrapfst_20difference(CYTHON_UNUSED PyObject *__pyx_
   __pyx_t_2.__pyx_n = 2;
   __pyx_t_2.cf = __pyx_v_cf;
   __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, 3389, __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, 3405, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -36778,7 +36853,7 @@ static PyObject *__pyx_pf_9pywrapfst_20difference(CYTHON_UNUSED PyObject *__pyx_
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3422
+/* "pywrapfst.pyx":3438
  * 
  * 
  * cpdef _MutableFst disambiguate(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -36792,7 +36867,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_disambiguate(
   __pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__39;
   __pyx_t_10basictypes_int64 __pyx_v_subsequential_label = ((__pyx_t_10basictypes_int64)0);
 
-  /* "pywrapfst.pyx":3426
+  /* "pywrapfst.pyx":3442
  *                                int64 nstate=fst.kNoStateId,
  *                                int64 subsequential_label=0,
  *                                weight=None):             # <<<<<<<<<<<<<<
@@ -36823,7 +36898,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_disambiguate(
     }
   }
 
-  /* "pywrapfst.pyx":3452
+  /* "pywrapfst.pyx":3468
  *   See also: `determinize`, `rmepsilon`.
  *   """
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())             # <<<<<<<<<<<<<<
@@ -36832,11 +36907,11 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_disambiguate(
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
-    __PYX_ERR(0, 3452, __pyx_L1_error)
+    __PYX_ERR(0, 3468, __pyx_L1_error)
   }
   __pyx_v_tfst = new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0));
 
-  /* "pywrapfst.pyx":3454
+  /* "pywrapfst.pyx":3470
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
  *   # Threshold is set to semiring Zero (no pruning) if no weight is specified.
  *   cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(),             # <<<<<<<<<<<<<<
@@ -36845,20 +36920,20 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_disambiguate(
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "weight_type");
-    __PYX_ERR(0, 3454, __pyx_L1_error)
+    __PYX_ERR(0, 3470, __pyx_L1_error)
   }
 
-  /* "pywrapfst.pyx":3455
+  /* "pywrapfst.pyx":3471
  *   # Threshold is set to semiring Zero (no pruning) if no weight is specified.
  *   cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(),
  *                                                      weight)             # <<<<<<<<<<<<<<
  *   cdef unique_ptr[fst.DisambiguateOptions] opts
  *   opts.reset(new fst.DisambiguateOptions(delta, wc, nstate,
  */
-  __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3454, __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, 3470, __pyx_L1_error)
   __pyx_v_wc = __pyx_t_1;
 
-  /* "pywrapfst.pyx":3457
+  /* "pywrapfst.pyx":3473
  *                                                      weight)
  *   cdef unique_ptr[fst.DisambiguateOptions] opts
  *   opts.reset(new fst.DisambiguateOptions(delta, wc, nstate,             # <<<<<<<<<<<<<<
@@ -36867,7 +36942,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_disambiguate(
  */
   __pyx_v_opts.reset(new fst::script::DisambiguateOptions(__pyx_v_delta, __pyx_v_wc, __pyx_v_nstate, __pyx_v_subsequential_label));
 
-  /* "pywrapfst.pyx":3459
+  /* "pywrapfst.pyx":3475
  *   opts.reset(new fst.DisambiguateOptions(delta, wc, nstate,
  *                                          subsequential_label))
  *   fst.Disambiguate(deref(ifst._fst), tfst, deref(opts))             # <<<<<<<<<<<<<<
@@ -36876,11 +36951,11 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_disambiguate(
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 3459, __pyx_L1_error)
+    __PYX_ERR(0, 3475, __pyx_L1_error)
   }
   fst::script::Disambiguate((*__pyx_v_ifst->_fst), __pyx_v_tfst, (*__pyx_v_opts));
 
-  /* "pywrapfst.pyx":3460
+  /* "pywrapfst.pyx":3476
  *                                          subsequential_label))
  *   fst.Disambiguate(deref(ifst._fst), tfst, deref(opts))
  *   return _init_MutableFst(tfst)             # <<<<<<<<<<<<<<
@@ -36888,13 +36963,13 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_disambiguate(
  * 
  */
   __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3460, __pyx_L1_error)
+  __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3476, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_2);
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3422
+  /* "pywrapfst.pyx":3438
  * 
  * 
  * cpdef _MutableFst disambiguate(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -36929,7 +37004,7 @@ static PyObject *__pyx_pw_9pywrapfst_23disambiguate(PyObject *__pyx_self, PyObje
     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":3426
+    /* "pywrapfst.pyx":3442
  *                                int64 nstate=fst.kNoStateId,
  *                                int64 subsequential_label=0,
  *                                weight=None):             # <<<<<<<<<<<<<<
@@ -36976,7 +37051,7 @@ static PyObject *__pyx_pw_9pywrapfst_23disambiguate(PyObject *__pyx_self, PyObje
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "disambiguate") < 0)) __PYX_ERR(0, 3422, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "disambiguate") < 0)) __PYX_ERR(0, 3438, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -36991,17 +37066,17 @@ static PyObject *__pyx_pw_9pywrapfst_23disambiguate(PyObject *__pyx_self, PyObje
     }
     __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, 3423, __pyx_L3_error)
+      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3439, __pyx_L3_error)
     } else {
       __pyx_v_delta = __pyx_k__38;
     }
     if (values[2]) {
-      __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3424, __pyx_L3_error)
+      __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3440, __pyx_L3_error)
     } else {
       __pyx_v_nstate = __pyx_k__39;
     }
     if (values[3]) {
-      __pyx_v_subsequential_label = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_subsequential_label == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3425, __pyx_L3_error)
+      __pyx_v_subsequential_label = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_subsequential_label == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3441, __pyx_L3_error)
     } else {
       __pyx_v_subsequential_label = ((__pyx_t_10basictypes_int64)0);
     }
@@ -37009,16 +37084,16 @@ static PyObject *__pyx_pw_9pywrapfst_23disambiguate(PyObject *__pyx_self, PyObje
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("disambiguate", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3422, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("disambiguate", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3438, __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, 3422, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3438, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_22disambiguate(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nstate, __pyx_v_subsequential_label, __pyx_v_weight);
 
-  /* "pywrapfst.pyx":3422
+  /* "pywrapfst.pyx":3438
  * 
  * 
  * cpdef _MutableFst disambiguate(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -37047,7 +37122,7 @@ static PyObject *__pyx_pf_9pywrapfst_22disambiguate(CYTHON_UNUSED PyObject *__py
   __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, 3422, __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, 3438, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -37064,7 +37139,7 @@ static PyObject *__pyx_pf_9pywrapfst_22disambiguate(CYTHON_UNUSED PyObject *__py
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3463
+/* "pywrapfst.pyx":3479
  * 
  * 
  * cpdef _MutableFst epsnormalize(_Fst ifst, bool eps_norm_output=False):             # <<<<<<<<<<<<<<
@@ -37087,7 +37162,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_epsnormalize(
     }
   }
 
-  /* "pywrapfst.pyx":3485
+  /* "pywrapfst.pyx":3501
  *   See also: `rmepsilon`.
  *   """
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())             # <<<<<<<<<<<<<<
@@ -37096,11 +37171,11 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_epsnormalize(
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
-    __PYX_ERR(0, 3485, __pyx_L1_error)
+    __PYX_ERR(0, 3501, __pyx_L1_error)
   }
   __pyx_v_tfst = new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0));
 
-  /* "pywrapfst.pyx":3486
+  /* "pywrapfst.pyx":3502
  *   """
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
  *   fst.EpsNormalize(deref(ifst._fst), tfst, fst.EPS_NORM_OUTPUT if             # <<<<<<<<<<<<<<
@@ -37109,10 +37184,10 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_epsnormalize(
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 3486, __pyx_L1_error)
+    __PYX_ERR(0, 3502, __pyx_L1_error)
   }
 
-  /* "pywrapfst.pyx":3487
+  /* "pywrapfst.pyx":3503
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
  *   fst.EpsNormalize(deref(ifst._fst), tfst, fst.EPS_NORM_OUTPUT if
  *                                            eps_norm_output else             # <<<<<<<<<<<<<<
@@ -37121,7 +37196,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_epsnormalize(
  */
   if ((__pyx_v_eps_norm_output != 0)) {
 
-    /* "pywrapfst.pyx":3486
+    /* "pywrapfst.pyx":3502
  *   """
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
  *   fst.EpsNormalize(deref(ifst._fst), tfst, fst.EPS_NORM_OUTPUT if             # <<<<<<<<<<<<<<
@@ -37131,7 +37206,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_epsnormalize(
     __pyx_t_1 = fst::EPS_NORM_OUTPUT;
   } else {
 
-    /* "pywrapfst.pyx":3488
+    /* "pywrapfst.pyx":3504
  *   fst.EpsNormalize(deref(ifst._fst), tfst, fst.EPS_NORM_OUTPUT if
  *                                            eps_norm_output else
  *                                            fst.EPS_NORM_INPUT)             # <<<<<<<<<<<<<<
@@ -37141,7 +37216,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_epsnormalize(
     __pyx_t_1 = fst::EPS_NORM_INPUT;
   }
 
-  /* "pywrapfst.pyx":3486
+  /* "pywrapfst.pyx":3502
  *   """
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
  *   fst.EpsNormalize(deref(ifst._fst), tfst, fst.EPS_NORM_OUTPUT if             # <<<<<<<<<<<<<<
@@ -37150,7 +37225,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_epsnormalize(
  */
   fst::script::EpsNormalize((*__pyx_v_ifst->_fst), __pyx_v_tfst, __pyx_t_1);
 
-  /* "pywrapfst.pyx":3489
+  /* "pywrapfst.pyx":3505
  *                                            eps_norm_output else
  *                                            fst.EPS_NORM_INPUT)
  *   return _init_MutableFst(tfst)             # <<<<<<<<<<<<<<
@@ -37158,13 +37233,13 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_epsnormalize(
  * 
  */
   __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3489, __pyx_L1_error)
+  __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3505, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_2);
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3463
+  /* "pywrapfst.pyx":3479
  * 
  * 
  * cpdef _MutableFst epsnormalize(_Fst ifst, bool eps_norm_output=False):             # <<<<<<<<<<<<<<
@@ -37216,7 +37291,7 @@ static PyObject *__pyx_pw_9pywrapfst_25epsnormalize(PyObject *__pyx_self, PyObje
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "epsnormalize") < 0)) __PYX_ERR(0, 3463, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "epsnormalize") < 0)) __PYX_ERR(0, 3479, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -37228,20 +37303,20 @@ static PyObject *__pyx_pw_9pywrapfst_25epsnormalize(PyObject *__pyx_self, PyObje
     }
     __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, 3463, __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, 3479, __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, 3463, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("epsnormalize", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3479, __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, 3463, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3479, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_24epsnormalize(__pyx_self, __pyx_v_ifst, __pyx_v_eps_norm_output);
 
   /* function exit code */
@@ -37262,7 +37337,7 @@ static PyObject *__pyx_pf_9pywrapfst_24epsnormalize(CYTHON_UNUSED PyObject *__py
   __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, 3463, __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, 3479, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -37279,7 +37354,7 @@ static PyObject *__pyx_pf_9pywrapfst_24epsnormalize(CYTHON_UNUSED PyObject *__py
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3492
+/* "pywrapfst.pyx":3508
  * 
  * 
  * cpdef bool equal(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta):             # <<<<<<<<<<<<<<
@@ -37299,7 +37374,7 @@ static bool __pyx_f_9pywrapfst_equal(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_i
     }
   }
 
-  /* "pywrapfst.pyx":3512
+  /* "pywrapfst.pyx":3528
  *   See also: `equivalent`, `isomorphic`, `randequivalent`.
  *   """
  *   return fst.Equal(deref(ifst1._fst), deref(ifst2._fst), delta)             # <<<<<<<<<<<<<<
@@ -37308,16 +37383,16 @@ static bool __pyx_f_9pywrapfst_equal(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_i
  */
   if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 3512, __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 '%s'", "_fst");
-    __PYX_ERR(0, 3512, __pyx_L1_error)
+    __PYX_ERR(0, 3528, __pyx_L1_error)
   }
   __pyx_r = fst::script::Equal((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_delta);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3492
+  /* "pywrapfst.pyx":3508
  * 
  * 
  * cpdef bool equal(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta):             # <<<<<<<<<<<<<<
@@ -37365,7 +37440,7 @@ static PyObject *__pyx_pw_9pywrapfst_27equal(PyObject *__pyx_self, PyObject *__p
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("equal", 0, 2, 3, 1); __PYX_ERR(0, 3492, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("equal", 0, 2, 3, 1); __PYX_ERR(0, 3508, __pyx_L3_error)
         }
         case  2:
         if (kw_args > 0) {
@@ -37374,7 +37449,7 @@ static PyObject *__pyx_pw_9pywrapfst_27equal(PyObject *__pyx_self, PyObject *__p
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equal") < 0)) __PYX_ERR(0, 3492, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equal") < 0)) __PYX_ERR(0, 3508, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -37388,21 +37463,21 @@ static PyObject *__pyx_pw_9pywrapfst_27equal(PyObject *__pyx_self, PyObject *__p
     __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, 3492, __pyx_L3_error)
+      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3508, __pyx_L3_error)
     } else {
       __pyx_v_delta = __pyx_k__40;
     }
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("equal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3492, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("equal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3508, __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, 3492, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3492, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3508, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3508, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_26equal(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_delta);
 
   /* function exit code */
@@ -37425,7 +37500,7 @@ static PyObject *__pyx_pf_9pywrapfst_26equal(CYTHON_UNUSED PyObject *__pyx_self,
   __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, 3492, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3508, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
@@ -37442,7 +37517,7 @@ static PyObject *__pyx_pf_9pywrapfst_26equal(CYTHON_UNUSED PyObject *__pyx_self,
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3515
+/* "pywrapfst.pyx":3531
  * 
  * 
  * cpdef bool equivalent(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta) except *:             # <<<<<<<<<<<<<<
@@ -37467,7 +37542,7 @@ static bool __pyx_f_9pywrapfst_equivalent(struct __pyx_obj_9pywrapfst__Fst *__py
     }
   }
 
-  /* "pywrapfst.pyx":3539
+  /* "pywrapfst.pyx":3555
  *   """
  *   cdef bool error
  *   cdef bool result = fst.Equivalent(deref(ifst1._fst), deref(ifst2._fst), delta,             # <<<<<<<<<<<<<<
@@ -37476,14 +37551,14 @@ static bool __pyx_f_9pywrapfst_equivalent(struct __pyx_obj_9pywrapfst__Fst *__py
  */
   if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 3539, __pyx_L1_error)
+    __PYX_ERR(0, 3555, __pyx_L1_error)
   }
   if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 3539, __pyx_L1_error)
+    __PYX_ERR(0, 3555, __pyx_L1_error)
   }
 
-  /* "pywrapfst.pyx":3540
+  /* "pywrapfst.pyx":3556
  *   cdef bool error
  *   cdef bool result = fst.Equivalent(deref(ifst1._fst), deref(ifst2._fst), delta,
  *                                     addr(error))             # <<<<<<<<<<<<<<
@@ -37492,7 +37567,7 @@ static bool __pyx_f_9pywrapfst_equivalent(struct __pyx_obj_9pywrapfst__Fst *__py
  */
   __pyx_v_result = fst::script::Equivalent((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_delta, (&__pyx_v_error));
 
-  /* "pywrapfst.pyx":3541
+  /* "pywrapfst.pyx":3557
  *   cdef bool result = fst.Equivalent(deref(ifst1._fst), deref(ifst2._fst), delta,
  *                                     addr(error))
  *   if error:             # <<<<<<<<<<<<<<
@@ -37502,23 +37577,23 @@ static bool __pyx_f_9pywrapfst_equivalent(struct __pyx_obj_9pywrapfst__Fst *__py
   __pyx_t_1 = (__pyx_v_error != 0);
   if (__pyx_t_1) {
 
-    /* "pywrapfst.pyx":3542
+    /* "pywrapfst.pyx":3558
  *                                     addr(error))
  *   if error:
  *     raise FstOpError("Equivalence test encountered error")             # <<<<<<<<<<<<<<
  *   return result
  * 
  */
-    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3542, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3558, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3542, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3558, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __PYX_ERR(0, 3542, __pyx_L1_error)
+    __PYX_ERR(0, 3558, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":3541
+    /* "pywrapfst.pyx":3557
  *   cdef bool result = fst.Equivalent(deref(ifst1._fst), deref(ifst2._fst), delta,
  *                                     addr(error))
  *   if error:             # <<<<<<<<<<<<<<
@@ -37527,7 +37602,7 @@ static bool __pyx_f_9pywrapfst_equivalent(struct __pyx_obj_9pywrapfst__Fst *__py
  */
   }
 
-  /* "pywrapfst.pyx":3543
+  /* "pywrapfst.pyx":3559
  *   if error:
  *     raise FstOpError("Equivalence test encountered error")
  *   return result             # <<<<<<<<<<<<<<
@@ -37537,7 +37612,7 @@ static bool __pyx_f_9pywrapfst_equivalent(struct __pyx_obj_9pywrapfst__Fst *__py
   __pyx_r = __pyx_v_result;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3515
+  /* "pywrapfst.pyx":3531
  * 
  * 
  * cpdef bool equivalent(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta) except *:             # <<<<<<<<<<<<<<
@@ -37587,7 +37662,7 @@ static PyObject *__pyx_pw_9pywrapfst_29equivalent(PyObject *__pyx_self, PyObject
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("equivalent", 0, 2, 3, 1); __PYX_ERR(0, 3515, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("equivalent", 0, 2, 3, 1); __PYX_ERR(0, 3531, __pyx_L3_error)
         }
         case  2:
         if (kw_args > 0) {
@@ -37596,7 +37671,7 @@ static PyObject *__pyx_pw_9pywrapfst_29equivalent(PyObject *__pyx_self, PyObject
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equivalent") < 0)) __PYX_ERR(0, 3515, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "equivalent") < 0)) __PYX_ERR(0, 3531, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -37610,21 +37685,21 @@ static PyObject *__pyx_pw_9pywrapfst_29equivalent(PyObject *__pyx_self, PyObject
     __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, 3515, __pyx_L3_error)
+      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3531, __pyx_L3_error)
     } else {
       __pyx_v_delta = __pyx_k__41;
     }
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("equivalent", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3515, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("equivalent", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3531, __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, 3515, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3515, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3531, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3531, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_28equivalent(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_delta);
 
   /* function exit code */
@@ -37646,8 +37721,8 @@ static PyObject *__pyx_pf_9pywrapfst_28equivalent(CYTHON_UNUSED PyObject *__pyx_
   __Pyx_XDECREF(__pyx_r);
   __pyx_t_2.__pyx_n = 1;
   __pyx_t_2.delta = __pyx_v_delta;
-  __pyx_t_1 = __pyx_f_9pywrapfst_equivalent(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3515, __pyx_L1_error)
-  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3515, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_9pywrapfst_equivalent(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3531, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3531, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
@@ -37664,7 +37739,7 @@ static PyObject *__pyx_pf_9pywrapfst_28equivalent(CYTHON_UNUSED PyObject *__pyx_
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3546
+/* "pywrapfst.pyx":3562
  * 
  * 
  * cpdef _MutableFst intersect(_Fst ifst1,             # <<<<<<<<<<<<<<
@@ -37676,7 +37751,7 @@ static PyObject *__pyx_pw_9pywrapfst_31intersect(PyObject *__pyx_self, PyObject
 static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_intersect(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst2, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_intersect *__pyx_optional_args) {
   PyObject *__pyx_v_cf = ((PyObject *)__pyx_n_b_auto);
 
-  /* "pywrapfst.pyx":3549
+  /* "pywrapfst.pyx":3565
  *                             _Fst ifst2,
  *                             cf=b"auto",
  *                             bool connect=True):             # <<<<<<<<<<<<<<
@@ -37701,7 +37776,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_intersect(str
     }
   }
 
-  /* "pywrapfst.pyx":3570
+  /* "pywrapfst.pyx":3586
  *     An equivalent epsilon-normalized FST.
  *   """
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst1.arc_type())             # <<<<<<<<<<<<<<
@@ -37710,22 +37785,22 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_intersect(str
  */
   if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
-    __PYX_ERR(0, 3570, __pyx_L1_error)
+    __PYX_ERR(0, 3586, __pyx_L1_error)
   }
   __pyx_v_tfst = new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst1->__pyx_vtab)->arc_type(__pyx_v_ifst1, 0));
 
-  /* "pywrapfst.pyx":3572
+  /* "pywrapfst.pyx":3588
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst1.arc_type())
  *   cdef unique_ptr[fst.ComposeOptions] opts
  *   opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(tostring(cf))))             # <<<<<<<<<<<<<<
  *   fst.Intersect(deref(ifst1._fst), deref(ifst2._fst), tfst, deref(opts))
  *   return _init_MutableFst(tfst)
  */
-  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_cf, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3572, __pyx_L1_error)
-  __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3572, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_cf, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3588, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3588, __pyx_L1_error)
   __pyx_v_opts.reset(new fst::script::ComposeOptions(__pyx_v_connect, __pyx_t_2));
 
-  /* "pywrapfst.pyx":3573
+  /* "pywrapfst.pyx":3589
  *   cdef unique_ptr[fst.ComposeOptions] opts
  *   opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(tostring(cf))))
  *   fst.Intersect(deref(ifst1._fst), deref(ifst2._fst), tfst, deref(opts))             # <<<<<<<<<<<<<<
@@ -37734,15 +37809,15 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_intersect(str
  */
   if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 3573, __pyx_L1_error)
+    __PYX_ERR(0, 3589, __pyx_L1_error)
   }
   if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 3573, __pyx_L1_error)
+    __PYX_ERR(0, 3589, __pyx_L1_error)
   }
   fst::script::Intersect((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_tfst, (*__pyx_v_opts));
 
-  /* "pywrapfst.pyx":3574
+  /* "pywrapfst.pyx":3590
  *   opts.reset(new fst.ComposeOptions(connect, _get_compose_filter(tostring(cf))))
  *   fst.Intersect(deref(ifst1._fst), deref(ifst2._fst), tfst, deref(opts))
  *   return _init_MutableFst(tfst)             # <<<<<<<<<<<<<<
@@ -37750,13 +37825,13 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_intersect(str
  * 
  */
   __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3574, __pyx_L1_error)
+  __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3590, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_3);
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3546
+  /* "pywrapfst.pyx":3562
  * 
  * 
  * cpdef _MutableFst intersect(_Fst ifst1,             # <<<<<<<<<<<<<<
@@ -37809,7 +37884,7 @@ static PyObject *__pyx_pw_9pywrapfst_31intersect(PyObject *__pyx_self, PyObject
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("intersect", 0, 2, 4, 1); __PYX_ERR(0, 3546, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("intersect", 0, 2, 4, 1); __PYX_ERR(0, 3562, __pyx_L3_error)
         }
         case  2:
         if (kw_args > 0) {
@@ -37823,7 +37898,7 @@ static PyObject *__pyx_pw_9pywrapfst_31intersect(PyObject *__pyx_self, PyObject
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "intersect") < 0)) __PYX_ERR(0, 3546, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "intersect") < 0)) __PYX_ERR(0, 3562, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -37839,10 +37914,10 @@ static PyObject *__pyx_pw_9pywrapfst_31intersect(PyObject *__pyx_self, PyObject
     __pyx_v_ifst2 = ((struct __pyx_obj_9pywrapfst__Fst *)values[1]);
     __pyx_v_cf = 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, 3549, __pyx_L3_error)
+      __pyx_v_connect = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3565, __pyx_L3_error)
     } else {
 
-      /* "pywrapfst.pyx":3549
+      /* "pywrapfst.pyx":3565
  *                             _Fst ifst2,
  *                             cf=b"auto",
  *                             bool connect=True):             # <<<<<<<<<<<<<<
@@ -37854,17 +37929,17 @@ static PyObject *__pyx_pw_9pywrapfst_31intersect(PyObject *__pyx_self, PyObject
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("intersect", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3546, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("intersect", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3562, __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, 3546, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3547, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3562, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3563, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_30intersect(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_cf, __pyx_v_connect);
 
-  /* "pywrapfst.pyx":3546
+  /* "pywrapfst.pyx":3562
  * 
  * 
  * cpdef _MutableFst intersect(_Fst ifst1,             # <<<<<<<<<<<<<<
@@ -37891,7 +37966,7 @@ static PyObject *__pyx_pf_9pywrapfst_30intersect(CYTHON_UNUSED PyObject *__pyx_s
   __pyx_t_2.__pyx_n = 2;
   __pyx_t_2.cf = __pyx_v_cf;
   __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, 3546, __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, 3562, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -37908,7 +37983,7 @@ static PyObject *__pyx_pf_9pywrapfst_30intersect(CYTHON_UNUSED PyObject *__pyx_s
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3577
+/* "pywrapfst.pyx":3593
  * 
  * 
  * cpdef bool isomorphic(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta):             # <<<<<<<<<<<<<<
@@ -37928,7 +38003,7 @@ static bool __pyx_f_9pywrapfst_isomorphic(struct __pyx_obj_9pywrapfst__Fst *__py
     }
   }
 
-  /* "pywrapfst.pyx":3600
+  /* "pywrapfst.pyx":3616
  *   See also: `equal`, `equivalent`, `randequivalent`.
  *   """
  *   return fst.Isomorphic(deref(ifst1._fst), deref(ifst2._fst), delta)             # <<<<<<<<<<<<<<
@@ -37937,16 +38012,16 @@ static bool __pyx_f_9pywrapfst_isomorphic(struct __pyx_obj_9pywrapfst__Fst *__py
  */
   if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 3600, __pyx_L1_error)
+    __PYX_ERR(0, 3616, __pyx_L1_error)
   }
   if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 3600, __pyx_L1_error)
+    __PYX_ERR(0, 3616, __pyx_L1_error)
   }
   __pyx_r = fst::script::Isomorphic((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_delta);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3577
+  /* "pywrapfst.pyx":3593
  * 
  * 
  * cpdef bool isomorphic(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta):             # <<<<<<<<<<<<<<
@@ -37994,7 +38069,7 @@ static PyObject *__pyx_pw_9pywrapfst_33isomorphic(PyObject *__pyx_self, PyObject
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("isomorphic", 0, 2, 3, 1); __PYX_ERR(0, 3577, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("isomorphic", 0, 2, 3, 1); __PYX_ERR(0, 3593, __pyx_L3_error)
         }
         case  2:
         if (kw_args > 0) {
@@ -38003,7 +38078,7 @@ static PyObject *__pyx_pw_9pywrapfst_33isomorphic(PyObject *__pyx_self, PyObject
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "isomorphic") < 0)) __PYX_ERR(0, 3577, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "isomorphic") < 0)) __PYX_ERR(0, 3593, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -38017,21 +38092,21 @@ static PyObject *__pyx_pw_9pywrapfst_33isomorphic(PyObject *__pyx_self, PyObject
     __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, 3577, __pyx_L3_error)
+      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3593, __pyx_L3_error)
     } else {
       __pyx_v_delta = __pyx_k__43;
     }
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("isomorphic", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3577, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("isomorphic", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3593, __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, 3577, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3577, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3593, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3593, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_32isomorphic(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_delta);
 
   /* function exit code */
@@ -38054,7 +38129,7 @@ static PyObject *__pyx_pf_9pywrapfst_32isomorphic(CYTHON_UNUSED PyObject *__pyx_
   __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, 3577, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3593, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
@@ -38071,7 +38146,7 @@ static PyObject *__pyx_pf_9pywrapfst_32isomorphic(CYTHON_UNUSED PyObject *__pyx_
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3603
+/* "pywrapfst.pyx":3619
  * 
  * 
  * cpdef _MutableFst prune(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -38084,7 +38159,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_prune(struct
   float __pyx_v_delta = __pyx_k__44;
   __pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__45;
 
-  /* "pywrapfst.pyx":3606
+  /* "pywrapfst.pyx":3622
  *                         float delta=fst.kDelta,
  *                         int64 nstate=fst.kNoStateId,
  *                         weight=None):             # <<<<<<<<<<<<<<
@@ -38111,7 +38186,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_prune(struct
     }
   }
 
-  /* "pywrapfst.pyx":3629
+  /* "pywrapfst.pyx":3645
  *   See also: The destructive variant.
  *   """
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())             # <<<<<<<<<<<<<<
@@ -38120,11 +38195,11 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_prune(struct
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
-    __PYX_ERR(0, 3629, __pyx_L1_error)
+    __PYX_ERR(0, 3645, __pyx_L1_error)
   }
   __pyx_v_tfst = new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0));
 
-  /* "pywrapfst.pyx":3630
+  /* "pywrapfst.pyx":3646
  *   """
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
  *   cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight)             # <<<<<<<<<<<<<<
@@ -38133,12 +38208,12 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_prune(struct
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "weight_type");
-    __PYX_ERR(0, 3630, __pyx_L1_error)
+    __PYX_ERR(0, 3646, __pyx_L1_error)
   }
-  __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3630, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3646, __pyx_L1_error)
   __pyx_v_wc = __pyx_t_1;
 
-  /* "pywrapfst.pyx":3631
+  /* "pywrapfst.pyx":3647
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
  *   cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight)
  *   fst.Prune(deref(ifst._fst), tfst, wc, nstate, delta)             # <<<<<<<<<<<<<<
@@ -38147,11 +38222,11 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_prune(struct
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 3631, __pyx_L1_error)
+    __PYX_ERR(0, 3647, __pyx_L1_error)
   }
   fst::script::Prune((*__pyx_v_ifst->_fst), __pyx_v_tfst, __pyx_v_wc, __pyx_v_nstate, __pyx_v_delta);
 
-  /* "pywrapfst.pyx":3632
+  /* "pywrapfst.pyx":3648
  *   cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight)
  *   fst.Prune(deref(ifst._fst), tfst, wc, nstate, delta)
  *   return _init_MutableFst(tfst)             # <<<<<<<<<<<<<<
@@ -38159,13 +38234,13 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_prune(struct
  * 
  */
   __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3632, __pyx_L1_error)
+  __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3648, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_2);
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3603
+  /* "pywrapfst.pyx":3619
  * 
  * 
  * cpdef _MutableFst prune(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -38199,7 +38274,7 @@ static PyObject *__pyx_pw_9pywrapfst_35prune(PyObject *__pyx_self, PyObject *__p
     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":3606
+    /* "pywrapfst.pyx":3622
  *                         float delta=fst.kDelta,
  *                         int64 nstate=fst.kNoStateId,
  *                         weight=None):             # <<<<<<<<<<<<<<
@@ -38240,7 +38315,7 @@ static PyObject *__pyx_pw_9pywrapfst_35prune(PyObject *__pyx_self, PyObject *__p
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prune") < 0)) __PYX_ERR(0, 3603, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prune") < 0)) __PYX_ERR(0, 3619, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -38254,12 +38329,12 @@ static PyObject *__pyx_pw_9pywrapfst_35prune(PyObject *__pyx_self, PyObject *__p
     }
     __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, 3604, __pyx_L3_error)
+      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3620, __pyx_L3_error)
     } else {
       __pyx_v_delta = __pyx_k__44;
     }
     if (values[2]) {
-      __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3605, __pyx_L3_error)
+      __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3621, __pyx_L3_error)
     } else {
       __pyx_v_nstate = __pyx_k__45;
     }
@@ -38267,16 +38342,16 @@ static PyObject *__pyx_pw_9pywrapfst_35prune(PyObject *__pyx_self, PyObject *__p
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("prune", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3603, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("prune", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3619, __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, 3603, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3619, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_34prune(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nstate, __pyx_v_weight);
 
-  /* "pywrapfst.pyx":3603
+  /* "pywrapfst.pyx":3619
  * 
  * 
  * cpdef _MutableFst prune(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -38304,7 +38379,7 @@ static PyObject *__pyx_pf_9pywrapfst_34prune(CYTHON_UNUSED PyObject *__pyx_self,
   __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, 3603, __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, 3619, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -38321,7 +38396,7 @@ static PyObject *__pyx_pf_9pywrapfst_34prune(CYTHON_UNUSED PyObject *__pyx_self,
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3635
+/* "pywrapfst.pyx":3651
  * 
  * 
  * cpdef _MutableFst push(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -38333,7 +38408,7 @@ static PyObject *__pyx_pw_9pywrapfst_37push(PyObject *__pyx_self, PyObject *__py
 static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_push(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_push *__pyx_optional_args) {
   float __pyx_v_delta = __pyx_k__46;
 
-  /* "pywrapfst.pyx":3637
+  /* "pywrapfst.pyx":3653
  * cpdef _MutableFst push(_Fst ifst,
  *                        float delta=fst.kDelta,
  *                        bool push_weights=False,             # <<<<<<<<<<<<<<
@@ -38342,7 +38417,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_push(struct _
  */
   bool __pyx_v_push_weights = ((bool)0);
 
-  /* "pywrapfst.pyx":3638
+  /* "pywrapfst.pyx":3654
  *                        float delta=fst.kDelta,
  *                        bool push_weights=False,
  *                        bool push_labels=False,             # <<<<<<<<<<<<<<
@@ -38351,7 +38426,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_push(struct _
  */
   bool __pyx_v_push_labels = ((bool)0);
 
-  /* "pywrapfst.pyx":3639
+  /* "pywrapfst.pyx":3655
  *                        bool push_weights=False,
  *                        bool push_labels=False,
  *                        bool remove_common_affix=False,             # <<<<<<<<<<<<<<
@@ -38360,7 +38435,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_push(struct _
  */
   bool __pyx_v_remove_common_affix = ((bool)0);
 
-  /* "pywrapfst.pyx":3640
+  /* "pywrapfst.pyx":3656
  *                        bool push_labels=False,
  *                        bool remove_common_affix=False,
  *                        bool remove_total_weight=False,             # <<<<<<<<<<<<<<
@@ -38369,7 +38444,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_push(struct _
  */
   bool __pyx_v_remove_total_weight = ((bool)0);
 
-  /* "pywrapfst.pyx":3641
+  /* "pywrapfst.pyx":3657
  *                        bool remove_common_affix=False,
  *                        bool remove_total_weight=False,
  *                        bool to_final=False):             # <<<<<<<<<<<<<<
@@ -38404,7 +38479,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_push(struct _
     }
   }
 
-  /* "pywrapfst.pyx":3680
+  /* "pywrapfst.pyx":3696
  *   """
  *   # This is copied, almost verbatim, from nlp/fst/bin/fstpush.cc.
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())             # <<<<<<<<<<<<<<
@@ -38413,11 +38488,11 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_push(struct _
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
-    __PYX_ERR(0, 3680, __pyx_L1_error)
+    __PYX_ERR(0, 3696, __pyx_L1_error)
   }
   __pyx_v_tfst = new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0));
 
-  /* "pywrapfst.pyx":3681
+  /* "pywrapfst.pyx":3697
  *   # This is copied, almost verbatim, from nlp/fst/bin/fstpush.cc.
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
  *   cdef uint32 flags = fst.GetPushFlags(push_weights, push_labels,             # <<<<<<<<<<<<<<
@@ -38426,7 +38501,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_push(struct _
  */
   __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":3683
+  /* "pywrapfst.pyx":3699
  *   cdef uint32 flags = fst.GetPushFlags(push_weights, push_labels,
  *                                        remove_common_affix, remove_total_weight)
  *   fst.Push(deref(ifst._fst), tfst, flags, fst.GetReweightType(to_final), delta)             # <<<<<<<<<<<<<<
@@ -38435,11 +38510,11 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_push(struct _
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 3683, __pyx_L1_error)
+    __PYX_ERR(0, 3699, __pyx_L1_error)
   }
   fst::script::Push((*__pyx_v_ifst->_fst), __pyx_v_tfst, __pyx_v_flags, fst::script::GetReweightType(__pyx_v_to_final), __pyx_v_delta);
 
-  /* "pywrapfst.pyx":3684
+  /* "pywrapfst.pyx":3700
  *                                        remove_common_affix, remove_total_weight)
  *   fst.Push(deref(ifst._fst), tfst, flags, fst.GetReweightType(to_final), delta)
  *   return _init_MutableFst(tfst)             # <<<<<<<<<<<<<<
@@ -38447,13 +38522,13 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_push(struct _
  * 
  */
   __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3684, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3700, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_1);
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3635
+  /* "pywrapfst.pyx":3651
  * 
  * 
  * cpdef _MutableFst push(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -38540,7 +38615,7 @@ static PyObject *__pyx_pw_9pywrapfst_37push(PyObject *__pyx_self, PyObject *__py
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "push") < 0)) __PYX_ERR(0, 3635, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "push") < 0)) __PYX_ERR(0, 3651, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -38557,15 +38632,15 @@ static PyObject *__pyx_pw_9pywrapfst_37push(PyObject *__pyx_self, PyObject *__py
     }
     __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, 3636, __pyx_L3_error)
+      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3652, __pyx_L3_error)
     } else {
       __pyx_v_delta = __pyx_k__46;
     }
     if (values[2]) {
-      __pyx_v_push_weights = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_push_weights == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3637, __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, 3653, __pyx_L3_error)
     } else {
 
-      /* "pywrapfst.pyx":3637
+      /* "pywrapfst.pyx":3653
  * cpdef _MutableFst push(_Fst ifst,
  *                        float delta=fst.kDelta,
  *                        bool push_weights=False,             # <<<<<<<<<<<<<<
@@ -38575,10 +38650,10 @@ static PyObject *__pyx_pw_9pywrapfst_37push(PyObject *__pyx_self, PyObject *__py
       __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, 3638, __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, 3654, __pyx_L3_error)
     } else {
 
-      /* "pywrapfst.pyx":3638
+      /* "pywrapfst.pyx":3654
  *                        float delta=fst.kDelta,
  *                        bool push_weights=False,
  *                        bool push_labels=False,             # <<<<<<<<<<<<<<
@@ -38588,10 +38663,10 @@ static PyObject *__pyx_pw_9pywrapfst_37push(PyObject *__pyx_self, PyObject *__py
       __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, 3639, __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, 3655, __pyx_L3_error)
     } else {
 
-      /* "pywrapfst.pyx":3639
+      /* "pywrapfst.pyx":3655
  *                        bool push_weights=False,
  *                        bool push_labels=False,
  *                        bool remove_common_affix=False,             # <<<<<<<<<<<<<<
@@ -38601,10 +38676,10 @@ static PyObject *__pyx_pw_9pywrapfst_37push(PyObject *__pyx_self, PyObject *__py
       __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, 3640, __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, 3656, __pyx_L3_error)
     } else {
 
-      /* "pywrapfst.pyx":3640
+      /* "pywrapfst.pyx":3656
  *                        bool push_labels=False,
  *                        bool remove_common_affix=False,
  *                        bool remove_total_weight=False,             # <<<<<<<<<<<<<<
@@ -38614,10 +38689,10 @@ static PyObject *__pyx_pw_9pywrapfst_37push(PyObject *__pyx_self, PyObject *__py
       __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, 3641, __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, 3657, __pyx_L3_error)
     } else {
 
-      /* "pywrapfst.pyx":3641
+      /* "pywrapfst.pyx":3657
  *                        bool remove_common_affix=False,
  *                        bool remove_total_weight=False,
  *                        bool to_final=False):             # <<<<<<<<<<<<<<
@@ -38629,16 +38704,16 @@ static PyObject *__pyx_pw_9pywrapfst_37push(PyObject *__pyx_self, PyObject *__py
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("push", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3635, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("push", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3651, __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, 3635, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3651, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_36push(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_push_weights, __pyx_v_push_labels, __pyx_v_remove_common_affix, __pyx_v_remove_total_weight, __pyx_v_to_final);
 
-  /* "pywrapfst.pyx":3635
+  /* "pywrapfst.pyx":3651
  * 
  * 
  * cpdef _MutableFst push(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -38669,7 +38744,7 @@ static PyObject *__pyx_pf_9pywrapfst_36push(CYTHON_UNUSED PyObject *__pyx_self,
   __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, 3635, __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, 3651, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -38686,7 +38761,7 @@ static PyObject *__pyx_pf_9pywrapfst_36push(CYTHON_UNUSED PyObject *__pyx_self,
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3687
+/* "pywrapfst.pyx":3703
  * 
  * 
  * cpdef bool randequivalent(_Fst ifst1,             # <<<<<<<<<<<<<<
@@ -38731,18 +38806,18 @@ static bool __pyx_f_9pywrapfst_randequivalent(struct __pyx_obj_9pywrapfst__Fst *
     }
   }
 
-  /* "pywrapfst.pyx":3725
+  /* "pywrapfst.pyx":3741
  *   See also: `equal`, `equivalent`, `isomorphic`, `randgen`.
  *   """
  *   cdef fst.RandArcSelection ras = _get_rand_arc_selection(tostring(select))             # <<<<<<<<<<<<<<
  *   cdef unique_ptr[fst.RandGenOptions[fst.RandArcSelection]] opts
  *   # The three trailing options will be ignored by RandEquivalent.
  */
-  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_select, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3725, __pyx_L1_error)
-  __pyx_t_2 = __pyx_f_9pywrapfst__get_rand_arc_selection(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3725, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_select, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3741, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_9pywrapfst__get_rand_arc_selection(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3741, __pyx_L1_error)
   __pyx_v_ras = __pyx_t_2;
 
-  /* "pywrapfst.pyx":3728
+  /* "pywrapfst.pyx":3744
  *   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,             # <<<<<<<<<<<<<<
@@ -38751,7 +38826,7 @@ static bool __pyx_f_9pywrapfst_randequivalent(struct __pyx_obj_9pywrapfst__Fst *
  */
   __pyx_v_opts.reset(new fst::RandGenOptions<enum fst::script::RandArcSelection> (__pyx_v_ras, __pyx_v_max_length, 1, 0, 0));
 
-  /* "pywrapfst.pyx":3730
+  /* "pywrapfst.pyx":3746
  *   opts.reset(new fst.RandGenOptions[fst.RandArcSelection](ras, max_length,
  *                                                           1, False, False))
  *   if seed == 0:             # <<<<<<<<<<<<<<
@@ -38761,7 +38836,7 @@ static bool __pyx_f_9pywrapfst_randequivalent(struct __pyx_obj_9pywrapfst__Fst *
   __pyx_t_3 = ((__pyx_v_seed == 0) != 0);
   if (__pyx_t_3) {
 
-    /* "pywrapfst.pyx":3731
+    /* "pywrapfst.pyx":3747
  *                                                           1, False, False))
  *   if seed == 0:
  *     seed = time(NULL) + getpid()             # <<<<<<<<<<<<<<
@@ -38770,7 +38845,7 @@ static bool __pyx_f_9pywrapfst_randequivalent(struct __pyx_obj_9pywrapfst__Fst *
  */
     __pyx_v_seed = (time(NULL) + getpid());
 
-    /* "pywrapfst.pyx":3730
+    /* "pywrapfst.pyx":3746
  *   opts.reset(new fst.RandGenOptions[fst.RandArcSelection](ras, max_length,
  *                                                           1, False, False))
  *   if seed == 0:             # <<<<<<<<<<<<<<
@@ -38779,7 +38854,7 @@ static bool __pyx_f_9pywrapfst_randequivalent(struct __pyx_obj_9pywrapfst__Fst *
  */
   }
 
-  /* "pywrapfst.pyx":3733
+  /* "pywrapfst.pyx":3749
  *     seed = time(NULL) + getpid()
  *   cdef bool error
  *   cdef bool result = fst.RandEquivalent(deref(ifst1._fst), deref(ifst2._fst),             # <<<<<<<<<<<<<<
@@ -38788,14 +38863,14 @@ static bool __pyx_f_9pywrapfst_randequivalent(struct __pyx_obj_9pywrapfst__Fst *
  */
   if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 3733, __pyx_L1_error)
+    __PYX_ERR(0, 3749, __pyx_L1_error)
   }
   if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 3733, __pyx_L1_error)
+    __PYX_ERR(0, 3749, __pyx_L1_error)
   }
 
-  /* "pywrapfst.pyx":3735
+  /* "pywrapfst.pyx":3751
  *   cdef bool result = fst.RandEquivalent(deref(ifst1._fst), deref(ifst2._fst),
  *                                         npath, delta, seed, deref(opts),
  *                                         addr(error))             # <<<<<<<<<<<<<<
@@ -38804,7 +38879,7 @@ static bool __pyx_f_9pywrapfst_randequivalent(struct __pyx_obj_9pywrapfst__Fst *
  */
   __pyx_v_result = fst::script::RandEquivalent((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_npath, __pyx_v_delta, __pyx_v_seed, (*__pyx_v_opts), (&__pyx_v_error));
 
-  /* "pywrapfst.pyx":3736
+  /* "pywrapfst.pyx":3752
  *                                         npath, delta, seed, deref(opts),
  *                                         addr(error))
  *   if error:             # <<<<<<<<<<<<<<
@@ -38814,23 +38889,23 @@ static bool __pyx_f_9pywrapfst_randequivalent(struct __pyx_obj_9pywrapfst__Fst *
   __pyx_t_3 = (__pyx_v_error != 0);
   if (__pyx_t_3) {
 
-    /* "pywrapfst.pyx":3737
+    /* "pywrapfst.pyx":3753
  *                                         addr(error))
  *   if error:
  *     raise FstOpError("Random equivalence test encountered error")             # <<<<<<<<<<<<<<
  *   return result
  * 
  */
-    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3737, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3753, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3737, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3753, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_Raise(__pyx_t_5, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __PYX_ERR(0, 3737, __pyx_L1_error)
+    __PYX_ERR(0, 3753, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":3736
+    /* "pywrapfst.pyx":3752
  *                                         npath, delta, seed, deref(opts),
  *                                         addr(error))
  *   if error:             # <<<<<<<<<<<<<<
@@ -38839,7 +38914,7 @@ static bool __pyx_f_9pywrapfst_randequivalent(struct __pyx_obj_9pywrapfst__Fst *
  */
   }
 
-  /* "pywrapfst.pyx":3738
+  /* "pywrapfst.pyx":3754
  *   if error:
  *     raise FstOpError("Random equivalence test encountered error")
  *   return result             # <<<<<<<<<<<<<<
@@ -38849,7 +38924,7 @@ static bool __pyx_f_9pywrapfst_randequivalent(struct __pyx_obj_9pywrapfst__Fst *
   __pyx_r = __pyx_v_result;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3687
+  /* "pywrapfst.pyx":3703
  * 
  * 
  * cpdef bool randequivalent(_Fst ifst1,             # <<<<<<<<<<<<<<
@@ -38908,7 +38983,7 @@ static PyObject *__pyx_pw_9pywrapfst_39randequivalent(PyObject *__pyx_self, PyOb
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst2)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("randequivalent", 0, 2, 7, 1); __PYX_ERR(0, 3687, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("randequivalent", 0, 2, 7, 1); __PYX_ERR(0, 3703, __pyx_L3_error)
         }
         case  2:
         if (kw_args > 0) {
@@ -38937,7 +39012,7 @@ static PyObject *__pyx_pw_9pywrapfst_39randequivalent(PyObject *__pyx_self, PyOb
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "randequivalent") < 0)) __PYX_ERR(0, 3687, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "randequivalent") < 0)) __PYX_ERR(0, 3703, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -38955,37 +39030,37 @@ static PyObject *__pyx_pw_9pywrapfst_39randequivalent(PyObject *__pyx_self, PyOb
     __pyx_v_ifst1 = ((struct __pyx_obj_9pywrapfst__Fst *)values[0]);
     __pyx_v_ifst2 = ((struct __pyx_obj_9pywrapfst__Fst *)values[1]);
     if (values[2]) {
-      __pyx_v_npath = __Pyx_PyInt_As_int32_t(values[2]); if (unlikely((__pyx_v_npath == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3689, __pyx_L3_error)
+      __pyx_v_npath = __Pyx_PyInt_As_int32_t(values[2]); if (unlikely((__pyx_v_npath == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3705, __pyx_L3_error)
     } else {
       __pyx_v_npath = ((__pyx_t_10basictypes_int32)1);
     }
     if (values[3]) {
-      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[3]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3690, __pyx_L3_error)
+      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[3]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3706, __pyx_L3_error)
     } else {
       __pyx_v_delta = __pyx_k__47;
     }
     if (values[4]) {
-      __pyx_v_seed = __Pyx_PyInt_As_time_t(values[4]); if (unlikely((__pyx_v_seed == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3691, __pyx_L3_error)
+      __pyx_v_seed = __Pyx_PyInt_As_time_t(values[4]); if (unlikely((__pyx_v_seed == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3707, __pyx_L3_error)
     } else {
       __pyx_v_seed = ((time_t)0);
     }
     __pyx_v_select = values[5];
     if (values[6]) {
-      __pyx_v_max_length = __Pyx_PyInt_As_int32_t(values[6]); if (unlikely((__pyx_v_max_length == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3693, __pyx_L3_error)
+      __pyx_v_max_length = __Pyx_PyInt_As_int32_t(values[6]); if (unlikely((__pyx_v_max_length == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3709, __pyx_L3_error)
     } else {
       __pyx_v_max_length = __pyx_k__48;
     }
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("randequivalent", 0, 2, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3687, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("randequivalent", 0, 2, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3703, __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, 3687, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3688, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst1), __pyx_ptype_9pywrapfst__Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3703, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_ptype_9pywrapfst__Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3704, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_38randequivalent(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_npath, __pyx_v_delta, __pyx_v_seed, __pyx_v_select, __pyx_v_max_length);
 
   /* function exit code */
@@ -39011,8 +39086,8 @@ static PyObject *__pyx_pf_9pywrapfst_38randequivalent(CYTHON_UNUSED PyObject *__
   __pyx_t_2.seed = __pyx_v_seed;
   __pyx_t_2.select = __pyx_v_select;
   __pyx_t_2.max_length = __pyx_v_max_length;
-  __pyx_t_1 = __pyx_f_9pywrapfst_randequivalent(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3687, __pyx_L1_error)
-  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3687, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_9pywrapfst_randequivalent(__pyx_v_ifst1, __pyx_v_ifst2, 0, &__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3703, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3703, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
@@ -39029,7 +39104,7 @@ static PyObject *__pyx_pf_9pywrapfst_38randequivalent(CYTHON_UNUSED PyObject *__
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3741
+/* "pywrapfst.pyx":3757
  * 
  * 
  * cpdef _MutableFst randgen(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -39044,7 +39119,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_randgen(struc
   PyObject *__pyx_v_select = ((PyObject *)__pyx_n_b_uniform);
   __pyx_t_10basictypes_int32 __pyx_v_max_length = __pyx_k__50;
 
-  /* "pywrapfst.pyx":3746
+  /* "pywrapfst.pyx":3762
  *                           select=b"uniform",
  *                           int32 max_length=INT32_MAX,
  *                           bool weighted=False,             # <<<<<<<<<<<<<<
@@ -39053,7 +39128,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_randgen(struc
  */
   bool __pyx_v_weighted = ((bool)0);
 
-  /* "pywrapfst.pyx":3747
+  /* "pywrapfst.pyx":3763
  *                           int32 max_length=INT32_MAX,
  *                           bool weighted=False,
  *                           bool remove_total_weight=False):             # <<<<<<<<<<<<<<
@@ -39092,18 +39167,18 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_randgen(struc
     }
   }
 
-  /* "pywrapfst.pyx":3779
+  /* "pywrapfst.pyx":3795
  *   See also: `randequivalent`.
  *   """
  *   cdef fst.RandArcSelection ras = _get_rand_arc_selection(tostring(select))             # <<<<<<<<<<<<<<
  *   cdef unique_ptr[fst.RandGenOptions[fst.RandArcSelection]] opts
  *   opts.reset(new fst.RandGenOptions[fst.RandArcSelection](ras, max_length,
  */
-  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_select, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3779, __pyx_L1_error)
-  __pyx_t_2 = __pyx_f_9pywrapfst__get_rand_arc_selection(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3779, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_select, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3795, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_9pywrapfst__get_rand_arc_selection(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3795, __pyx_L1_error)
   __pyx_v_ras = __pyx_t_2;
 
-  /* "pywrapfst.pyx":3781
+  /* "pywrapfst.pyx":3797
  *   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,             # <<<<<<<<<<<<<<
@@ -39112,7 +39187,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_randgen(struc
  */
   __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":3784
+  /* "pywrapfst.pyx":3800
  *                                                           npath, weighted,
  *                                                           remove_total_weight))
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())             # <<<<<<<<<<<<<<
@@ -39121,11 +39196,11 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_randgen(struc
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
-    __PYX_ERR(0, 3784, __pyx_L1_error)
+    __PYX_ERR(0, 3800, __pyx_L1_error)
   }
   __pyx_v_tfst = new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0));
 
-  /* "pywrapfst.pyx":3785
+  /* "pywrapfst.pyx":3801
  *                                                           remove_total_weight))
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
  *   if seed == 0:             # <<<<<<<<<<<<<<
@@ -39135,7 +39210,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_randgen(struc
   __pyx_t_3 = ((__pyx_v_seed == 0) != 0);
   if (__pyx_t_3) {
 
-    /* "pywrapfst.pyx":3786
+    /* "pywrapfst.pyx":3802
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
  *   if seed == 0:
  *     seed = time(NULL) + getpid()             # <<<<<<<<<<<<<<
@@ -39144,7 +39219,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_randgen(struc
  */
     __pyx_v_seed = (time(NULL) + getpid());
 
-    /* "pywrapfst.pyx":3785
+    /* "pywrapfst.pyx":3801
  *                                                           remove_total_weight))
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
  *   if seed == 0:             # <<<<<<<<<<<<<<
@@ -39153,7 +39228,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_randgen(struc
  */
   }
 
-  /* "pywrapfst.pyx":3787
+  /* "pywrapfst.pyx":3803
  *   if seed == 0:
  *     seed = time(NULL) + getpid()
  *   fst.RandGen(deref(ifst._fst), tfst, seed, deref(opts))             # <<<<<<<<<<<<<<
@@ -39162,11 +39237,11 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_randgen(struc
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 3787, __pyx_L1_error)
+    __PYX_ERR(0, 3803, __pyx_L1_error)
   }
   fst::script::RandGen((*__pyx_v_ifst->_fst), __pyx_v_tfst, __pyx_v_seed, (*__pyx_v_opts));
 
-  /* "pywrapfst.pyx":3788
+  /* "pywrapfst.pyx":3804
  *     seed = time(NULL) + getpid()
  *   fst.RandGen(deref(ifst._fst), tfst, seed, deref(opts))
  *   return _init_MutableFst(tfst)             # <<<<<<<<<<<<<<
@@ -39174,13 +39249,13 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_randgen(struc
  * 
  */
   __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3788, __pyx_L1_error)
+  __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3804, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_4);
   __pyx_t_4 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3741
+  /* "pywrapfst.pyx":3757
  * 
  * 
  * cpdef _MutableFst randgen(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -39268,7 +39343,7 @@ static PyObject *__pyx_pw_9pywrapfst_41randgen(PyObject *__pyx_self, PyObject *_
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "randgen") < 0)) __PYX_ERR(0, 3741, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "randgen") < 0)) __PYX_ERR(0, 3757, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -39285,26 +39360,26 @@ static PyObject *__pyx_pw_9pywrapfst_41randgen(PyObject *__pyx_self, PyObject *_
     }
     __pyx_v_ifst = ((struct __pyx_obj_9pywrapfst__Fst *)values[0]);
     if (values[1]) {
-      __pyx_v_npath = __Pyx_PyInt_As_int32_t(values[1]); if (unlikely((__pyx_v_npath == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3742, __pyx_L3_error)
+      __pyx_v_npath = __Pyx_PyInt_As_int32_t(values[1]); if (unlikely((__pyx_v_npath == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3758, __pyx_L3_error)
     } else {
       __pyx_v_npath = ((__pyx_t_10basictypes_int32)1);
     }
     if (values[2]) {
-      __pyx_v_seed = __Pyx_PyInt_As_time_t(values[2]); if (unlikely((__pyx_v_seed == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3743, __pyx_L3_error)
+      __pyx_v_seed = __Pyx_PyInt_As_time_t(values[2]); if (unlikely((__pyx_v_seed == ((time_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3759, __pyx_L3_error)
     } else {
       __pyx_v_seed = ((time_t)0);
     }
     __pyx_v_select = values[3];
     if (values[4]) {
-      __pyx_v_max_length = __Pyx_PyInt_As_int32_t(values[4]); if (unlikely((__pyx_v_max_length == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3745, __pyx_L3_error)
+      __pyx_v_max_length = __Pyx_PyInt_As_int32_t(values[4]); if (unlikely((__pyx_v_max_length == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3761, __pyx_L3_error)
     } else {
       __pyx_v_max_length = __pyx_k__50;
     }
     if (values[5]) {
-      __pyx_v_weighted = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_weighted == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3746, __pyx_L3_error)
+      __pyx_v_weighted = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_weighted == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3762, __pyx_L3_error)
     } else {
 
-      /* "pywrapfst.pyx":3746
+      /* "pywrapfst.pyx":3762
  *                           select=b"uniform",
  *                           int32 max_length=INT32_MAX,
  *                           bool weighted=False,             # <<<<<<<<<<<<<<
@@ -39314,10 +39389,10 @@ static PyObject *__pyx_pw_9pywrapfst_41randgen(PyObject *__pyx_self, PyObject *_
       __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, 3747, __pyx_L3_error)
+      __pyx_v_remove_total_weight = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_remove_total_weight == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3763, __pyx_L3_error)
     } else {
 
-      /* "pywrapfst.pyx":3747
+      /* "pywrapfst.pyx":3763
  *                           int32 max_length=INT32_MAX,
  *                           bool weighted=False,
  *                           bool remove_total_weight=False):             # <<<<<<<<<<<<<<
@@ -39329,16 +39404,16 @@ static PyObject *__pyx_pw_9pywrapfst_41randgen(PyObject *__pyx_self, PyObject *_
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("randgen", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3741, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("randgen", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3757, __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, 3741, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3757, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_40randgen(__pyx_self, __pyx_v_ifst, __pyx_v_npath, __pyx_v_seed, __pyx_v_select, __pyx_v_max_length, __pyx_v_weighted, __pyx_v_remove_total_weight);
 
-  /* "pywrapfst.pyx":3741
+  /* "pywrapfst.pyx":3757
  * 
  * 
  * cpdef _MutableFst randgen(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -39369,7 +39444,7 @@ static PyObject *__pyx_pf_9pywrapfst_40randgen(CYTHON_UNUSED PyObject *__pyx_sel
   __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, 3741, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_randgen(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3757, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -39386,7 +39461,7 @@ static PyObject *__pyx_pf_9pywrapfst_40randgen(CYTHON_UNUSED PyObject *__pyx_sel
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3791
+/* "pywrapfst.pyx":3807
  * 
  * 
  * cpdef _MutableFst replace(pairs,             # <<<<<<<<<<<<<<
@@ -39399,7 +39474,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_replace(PyObj
   PyObject *__pyx_v_call_arc_labeling = ((PyObject *)__pyx_n_b_input);
   PyObject *__pyx_v_return_arc_labeling = ((PyObject *)__pyx_n_b_neither);
 
-  /* "pywrapfst.pyx":3794
+  /* "pywrapfst.pyx":3810
  *                           call_arc_labeling=b"input",
  *                           return_arc_labeling=b"neither",
  *                           bool epsilon_on_replace=False,             # <<<<<<<<<<<<<<
@@ -39447,26 +39522,26 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_replace(PyObj
     }
   }
 
-  /* "pywrapfst.pyx":3836
+  /* "pywrapfst.pyx":3852
  *   cdef int64 label
  *   cdef _Fst ifst
  *   it = iter(pairs)             # <<<<<<<<<<<<<<
  *   (root_label, ifst) = next(it)
  *   _pairs.push_back(fst.LabelFstClassPair(root_label, ifst._fst.get()))
  */
-  __pyx_t_1 = PyObject_GetIter(__pyx_v_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3836, __pyx_L1_error)
+  __pyx_t_1 = PyObject_GetIter(__pyx_v_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3852, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_it = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "pywrapfst.pyx":3837
+  /* "pywrapfst.pyx":3853
  *   cdef _Fst ifst
  *   it = iter(pairs)
  *   (root_label, ifst) = next(it)             # <<<<<<<<<<<<<<
  *   _pairs.push_back(fst.LabelFstClassPair(root_label, ifst._fst.get()))
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
  */
-  __pyx_t_1 = __Pyx_PyIter_Next(__pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3837, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyIter_Next(__pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3853, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
     PyObject* sequence = __pyx_t_1;
@@ -39478,7 +39553,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_replace(PyObj
     if (unlikely(size != 2)) {
       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      __PYX_ERR(0, 3837, __pyx_L1_error)
+      __PYX_ERR(0, 3853, __pyx_L1_error)
     }
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
     if (likely(PyTuple_CheckExact(sequence))) {
@@ -39491,15 +39566,15 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_replace(PyObj
     __Pyx_INCREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_t_3);
     #else
-    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3837, __pyx_L1_error)
+    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3853, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3837, __pyx_L1_error)
+    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3853, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     #endif
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   } else {
     Py_ssize_t index = -1;
-    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3837, __pyx_L1_error)
+    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3853, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
@@ -39507,7 +39582,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_replace(PyObj
     __Pyx_GOTREF(__pyx_t_2);
     index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
     __Pyx_GOTREF(__pyx_t_3);
-    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 3837, __pyx_L1_error)
+    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 3853, __pyx_L1_error)
     __pyx_t_5 = NULL;
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     goto __pyx_L4_unpacking_done;
@@ -39515,17 +39590,17 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_replace(PyObj
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_t_5 = NULL;
     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-    __PYX_ERR(0, 3837, __pyx_L1_error)
+    __PYX_ERR(0, 3853, __pyx_L1_error)
     __pyx_L4_unpacking_done:;
   }
-  __pyx_t_6 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_6 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3837, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_6 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3853, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_9pywrapfst__Fst))))) __PYX_ERR(0, 3837, __pyx_L1_error)
+  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_9pywrapfst__Fst))))) __PYX_ERR(0, 3853, __pyx_L1_error)
   __pyx_v_root_label = __pyx_t_6;
   __pyx_v_ifst = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "pywrapfst.pyx":3838
+  /* "pywrapfst.pyx":3854
  *   it = iter(pairs)
  *   (root_label, ifst) = next(it)
  *   _pairs.push_back(fst.LabelFstClassPair(root_label, ifst._fst.get()))             # <<<<<<<<<<<<<<
@@ -39534,22 +39609,22 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_replace(PyObj
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 3838, __pyx_L1_error)
+    __PYX_ERR(0, 3854, __pyx_L1_error)
   }
   try {
     __pyx_t_7 = __pyx_t_3fst_LabelFstClassPair(__pyx_v_root_label, __pyx_v_ifst->_fst.get());
   } catch(...) {
     __Pyx_CppExn2PyErr();
-    __PYX_ERR(0, 3838, __pyx_L1_error)
+    __PYX_ERR(0, 3854, __pyx_L1_error)
   }
   try {
     __pyx_v__pairs.push_back(__pyx_t_7);
   } catch(...) {
     __Pyx_CppExn2PyErr();
-    __PYX_ERR(0, 3838, __pyx_L1_error)
+    __PYX_ERR(0, 3854, __pyx_L1_error)
   }
 
-  /* "pywrapfst.pyx":3839
+  /* "pywrapfst.pyx":3855
  *   (root_label, ifst) = next(it)
  *   _pairs.push_back(fst.LabelFstClassPair(root_label, ifst._fst.get()))
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())             # <<<<<<<<<<<<<<
@@ -39558,11 +39633,11 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_replace(PyObj
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
-    __PYX_ERR(0, 3839, __pyx_L1_error)
+    __PYX_ERR(0, 3855, __pyx_L1_error)
   }
   __pyx_v_tfst = new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0));
 
-  /* "pywrapfst.pyx":3840
+  /* "pywrapfst.pyx":3856
  *   _pairs.push_back(fst.LabelFstClassPair(root_label, ifst._fst.get()))
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
  *   for (label, ifst) in it:             # <<<<<<<<<<<<<<
@@ -39573,26 +39648,26 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_replace(PyObj
     __pyx_t_1 = __pyx_v_it; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0;
     __pyx_t_9 = NULL;
   } else {
-    __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3840, __pyx_L1_error)
+    __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3856, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3840, __pyx_L1_error)
+    __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3856, __pyx_L1_error)
   }
   for (;;) {
     if (likely(!__pyx_t_9)) {
       if (likely(PyList_CheckExact(__pyx_t_1))) {
         if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 3840, __pyx_L1_error)
+        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 3856, __pyx_L1_error)
         #else
-        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3840, __pyx_L1_error)
+        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3856, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_3);
         #endif
       } else {
         if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 3840, __pyx_L1_error)
+        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 3856, __pyx_L1_error)
         #else
-        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3840, __pyx_L1_error)
+        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3856, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_3);
         #endif
       }
@@ -39602,7 +39677,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_replace(PyObj
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
           if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else __PYX_ERR(0, 3840, __pyx_L1_error)
+          else __PYX_ERR(0, 3856, __pyx_L1_error)
         }
         break;
       }
@@ -39618,7 +39693,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_replace(PyObj
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        __PYX_ERR(0, 3840, __pyx_L1_error)
+        __PYX_ERR(0, 3856, __pyx_L1_error)
       }
       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
       if (likely(PyTuple_CheckExact(sequence))) {
@@ -39631,15 +39706,15 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_replace(PyObj
       __Pyx_INCREF(__pyx_t_2);
       __Pyx_INCREF(__pyx_t_4);
       #else
-      __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3840, __pyx_L1_error)
+      __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3856, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3840, __pyx_L1_error)
+      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3856, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       #endif
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     } else {
       Py_ssize_t index = -1;
-      __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3840, __pyx_L1_error)
+      __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3856, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_10);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       __pyx_t_5 = Py_TYPE(__pyx_t_10)->tp_iternext;
@@ -39647,7 +39722,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_replace(PyObj
       __Pyx_GOTREF(__pyx_t_2);
       index = 1; __pyx_t_4 = __pyx_t_5(__pyx_t_10); if (unlikely(!__pyx_t_4)) goto __pyx_L7_unpacking_failed;
       __Pyx_GOTREF(__pyx_t_4);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_10), 2) < 0) __PYX_ERR(0, 3840, __pyx_L1_error)
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_10), 2) < 0) __PYX_ERR(0, 3856, __pyx_L1_error)
       __pyx_t_5 = NULL;
       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
       goto __pyx_L8_unpacking_done;
@@ -39655,17 +39730,17 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_replace(PyObj
       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
       __pyx_t_5 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      __PYX_ERR(0, 3840, __pyx_L1_error)
+      __PYX_ERR(0, 3856, __pyx_L1_error)
       __pyx_L8_unpacking_done:;
     }
-    __pyx_t_6 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_6 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3840, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_6 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3856, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_9pywrapfst__Fst))))) __PYX_ERR(0, 3840, __pyx_L1_error)
+    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_9pywrapfst__Fst))))) __PYX_ERR(0, 3856, __pyx_L1_error)
     __pyx_v_label = __pyx_t_6;
     __Pyx_DECREF_SET(__pyx_v_ifst, ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_4));
     __pyx_t_4 = 0;
 
-    /* "pywrapfst.pyx":3841
+    /* "pywrapfst.pyx":3857
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
  *   for (label, ifst) in it:
  *     _pairs.push_back(fst.LabelFstClassPair(label, ifst._fst.get()))             # <<<<<<<<<<<<<<
@@ -39674,22 +39749,22 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_replace(PyObj
  */
     if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-      __PYX_ERR(0, 3841, __pyx_L1_error)
+      __PYX_ERR(0, 3857, __pyx_L1_error)
     }
     try {
       __pyx_t_7 = __pyx_t_3fst_LabelFstClassPair(__pyx_v_label, __pyx_v_ifst->_fst.get());
     } catch(...) {
       __Pyx_CppExn2PyErr();
-      __PYX_ERR(0, 3841, __pyx_L1_error)
+      __PYX_ERR(0, 3857, __pyx_L1_error)
     }
     try {
       __pyx_v__pairs.push_back(__pyx_t_7);
     } catch(...) {
       __Pyx_CppExn2PyErr();
-      __PYX_ERR(0, 3841, __pyx_L1_error)
+      __PYX_ERR(0, 3857, __pyx_L1_error)
     }
 
-    /* "pywrapfst.pyx":3840
+    /* "pywrapfst.pyx":3856
  *   _pairs.push_back(fst.LabelFstClassPair(root_label, ifst._fst.get()))
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
  *   for (label, ifst) in it:             # <<<<<<<<<<<<<<
@@ -39699,45 +39774,45 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_replace(PyObj
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "pywrapfst.pyx":3843
+  /* "pywrapfst.pyx":3859
  *     _pairs.push_back(fst.LabelFstClassPair(label, ifst._fst.get()))
  *   cdef fst.ReplaceLabelType cal = _get_replace_label_type(
  *       tostring(call_arc_labeling), epsilon_on_replace)             # <<<<<<<<<<<<<<
  *   cdef fst.ReplaceLabelType ral = _get_replace_label_type(
  *       tostring(return_arc_labeling), epsilon_on_replace)
  */
-  __pyx_t_11 = __pyx_f_9pywrapfst_tostring(__pyx_v_call_arc_labeling, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3843, __pyx_L1_error)
+  __pyx_t_11 = __pyx_f_9pywrapfst_tostring(__pyx_v_call_arc_labeling, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3859, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":3842
+  /* "pywrapfst.pyx":3858
  *   for (label, ifst) in it:
  *     _pairs.push_back(fst.LabelFstClassPair(label, ifst._fst.get()))
  *   cdef fst.ReplaceLabelType cal = _get_replace_label_type(             # <<<<<<<<<<<<<<
  *       tostring(call_arc_labeling), epsilon_on_replace)
  *   cdef fst.ReplaceLabelType ral = _get_replace_label_type(
  */
-  __pyx_t_12 = __pyx_f_9pywrapfst__get_replace_label_type(__pyx_t_11, __pyx_v_epsilon_on_replace); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3842, __pyx_L1_error)
+  __pyx_t_12 = __pyx_f_9pywrapfst__get_replace_label_type(__pyx_t_11, __pyx_v_epsilon_on_replace); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3858, __pyx_L1_error)
   __pyx_v_cal = __pyx_t_12;
 
-  /* "pywrapfst.pyx":3845
+  /* "pywrapfst.pyx":3861
  *       tostring(call_arc_labeling), epsilon_on_replace)
  *   cdef fst.ReplaceLabelType ral = _get_replace_label_type(
  *       tostring(return_arc_labeling), epsilon_on_replace)             # <<<<<<<<<<<<<<
  *   cdef unique_ptr[fst.ReplaceOptions] opts
  *   opts.reset(new fst.ReplaceOptions(root_label, cal, ral, return_label))
  */
-  __pyx_t_11 = __pyx_f_9pywrapfst_tostring(__pyx_v_return_arc_labeling, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3845, __pyx_L1_error)
+  __pyx_t_11 = __pyx_f_9pywrapfst_tostring(__pyx_v_return_arc_labeling, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3861, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":3844
+  /* "pywrapfst.pyx":3860
  *   cdef fst.ReplaceLabelType cal = _get_replace_label_type(
  *       tostring(call_arc_labeling), epsilon_on_replace)
  *   cdef fst.ReplaceLabelType ral = _get_replace_label_type(             # <<<<<<<<<<<<<<
  *       tostring(return_arc_labeling), epsilon_on_replace)
  *   cdef unique_ptr[fst.ReplaceOptions] opts
  */
-  __pyx_t_12 = __pyx_f_9pywrapfst__get_replace_label_type(__pyx_t_11, __pyx_v_epsilon_on_replace); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3844, __pyx_L1_error)
+  __pyx_t_12 = __pyx_f_9pywrapfst__get_replace_label_type(__pyx_t_11, __pyx_v_epsilon_on_replace); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3860, __pyx_L1_error)
   __pyx_v_ral = __pyx_t_12;
 
-  /* "pywrapfst.pyx":3847
+  /* "pywrapfst.pyx":3863
  *       tostring(return_arc_labeling), epsilon_on_replace)
  *   cdef unique_ptr[fst.ReplaceOptions] opts
  *   opts.reset(new fst.ReplaceOptions(root_label, cal, ral, return_label))             # <<<<<<<<<<<<<<
@@ -39746,7 +39821,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_replace(PyObj
  */
   __pyx_v_opts.reset(new fst::script::ReplaceOptions(__pyx_v_root_label, __pyx_v_cal, __pyx_v_ral, __pyx_v_return_label));
 
-  /* "pywrapfst.pyx":3848
+  /* "pywrapfst.pyx":3864
  *   cdef unique_ptr[fst.ReplaceOptions] opts
  *   opts.reset(new fst.ReplaceOptions(root_label, cal, ral, return_label))
  *   fst.Replace(_pairs, tfst, deref(opts))             # <<<<<<<<<<<<<<
@@ -39755,7 +39830,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_replace(PyObj
  */
   fst::script::Replace(__pyx_v__pairs, __pyx_v_tfst, (*__pyx_v_opts));
 
-  /* "pywrapfst.pyx":3849
+  /* "pywrapfst.pyx":3865
  *   opts.reset(new fst.ReplaceOptions(root_label, cal, ral, return_label))
  *   fst.Replace(_pairs, tfst, deref(opts))
  *   return _init_MutableFst(tfst)             # <<<<<<<<<<<<<<
@@ -39763,13 +39838,13 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_replace(PyObj
  * 
  */
   __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3849, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3865, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_1);
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3791
+  /* "pywrapfst.pyx":3807
  * 
  * 
  * cpdef _MutableFst replace(pairs,             # <<<<<<<<<<<<<<
@@ -39850,7 +39925,7 @@ static PyObject *__pyx_pw_9pywrapfst_43replace(PyObject *__pyx_self, PyObject *_
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "replace") < 0)) __PYX_ERR(0, 3791, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "replace") < 0)) __PYX_ERR(0, 3807, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -39867,10 +39942,10 @@ static PyObject *__pyx_pw_9pywrapfst_43replace(PyObject *__pyx_self, PyObject *_
     __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, 3794, __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, 3810, __pyx_L3_error)
     } else {
 
-      /* "pywrapfst.pyx":3794
+      /* "pywrapfst.pyx":3810
  *                           call_arc_labeling=b"input",
  *                           return_arc_labeling=b"neither",
  *                           bool epsilon_on_replace=False,             # <<<<<<<<<<<<<<
@@ -39880,14 +39955,14 @@ static PyObject *__pyx_pw_9pywrapfst_43replace(PyObject *__pyx_self, PyObject *_
       __pyx_v_epsilon_on_replace = ((bool)0);
     }
     if (values[4]) {
-      __pyx_v_return_label = __Pyx_PyInt_As_int64_t(values[4]); if (unlikely((__pyx_v_return_label == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3795, __pyx_L3_error)
+      __pyx_v_return_label = __Pyx_PyInt_As_int64_t(values[4]); if (unlikely((__pyx_v_return_label == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3811, __pyx_L3_error)
     } else {
       __pyx_v_return_label = ((__pyx_t_10basictypes_int64)0);
     }
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("replace", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3791, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("replace", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3807, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("pywrapfst.replace", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -39895,7 +39970,7 @@ static PyObject *__pyx_pw_9pywrapfst_43replace(PyObject *__pyx_self, PyObject *_
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_9pywrapfst_42replace(__pyx_self, __pyx_v_pairs, __pyx_v_call_arc_labeling, __pyx_v_return_arc_labeling, __pyx_v_epsilon_on_replace, __pyx_v_return_label);
 
-  /* "pywrapfst.pyx":3791
+  /* "pywrapfst.pyx":3807
  * 
  * 
  * cpdef _MutableFst replace(pairs,             # <<<<<<<<<<<<<<
@@ -39920,7 +39995,7 @@ static PyObject *__pyx_pf_9pywrapfst_42replace(CYTHON_UNUSED PyObject *__pyx_sel
   __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, 3791, __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, 3807, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -39937,7 +40012,7 @@ static PyObject *__pyx_pf_9pywrapfst_42replace(CYTHON_UNUSED PyObject *__pyx_sel
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3852
+/* "pywrapfst.pyx":3868
  * 
  * 
  * cpdef _MutableFst reverse(_Fst ifst, bool require_superinitial=True):             # <<<<<<<<<<<<<<
@@ -39959,7 +40034,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_reverse(struc
     }
   }
 
-  /* "pywrapfst.pyx":3871
+  /* "pywrapfst.pyx":3887
  *     A reversed FST.
  *   """
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())             # <<<<<<<<<<<<<<
@@ -39968,11 +40043,11 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_reverse(struc
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
-    __PYX_ERR(0, 3871, __pyx_L1_error)
+    __PYX_ERR(0, 3887, __pyx_L1_error)
   }
   __pyx_v_tfst = new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0));
 
-  /* "pywrapfst.pyx":3872
+  /* "pywrapfst.pyx":3888
  *   """
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
  *   fst.Reverse(deref(ifst._fst), tfst, require_superinitial)             # <<<<<<<<<<<<<<
@@ -39981,11 +40056,11 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_reverse(struc
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 3872, __pyx_L1_error)
+    __PYX_ERR(0, 3888, __pyx_L1_error)
   }
   fst::script::Reverse((*__pyx_v_ifst->_fst), __pyx_v_tfst, __pyx_v_require_superinitial);
 
-  /* "pywrapfst.pyx":3873
+  /* "pywrapfst.pyx":3889
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
  *   fst.Reverse(deref(ifst._fst), tfst, require_superinitial)
  *   return _init_MutableFst(tfst)             # <<<<<<<<<<<<<<
@@ -39993,13 +40068,13 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_reverse(struc
  * 
  */
   __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3873, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3889, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_1);
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3852
+  /* "pywrapfst.pyx":3868
  * 
  * 
  * cpdef _MutableFst reverse(_Fst ifst, bool require_superinitial=True):             # <<<<<<<<<<<<<<
@@ -40051,7 +40126,7 @@ static PyObject *__pyx_pw_9pywrapfst_45reverse(PyObject *__pyx_self, PyObject *_
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reverse") < 0)) __PYX_ERR(0, 3852, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reverse") < 0)) __PYX_ERR(0, 3868, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -40063,20 +40138,20 @@ static PyObject *__pyx_pw_9pywrapfst_45reverse(PyObject *__pyx_self, PyObject *_
     }
     __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, 3852, __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, 3868, __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, 3852, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("reverse", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3868, __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, 3852, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3868, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_44reverse(__pyx_self, __pyx_v_ifst, __pyx_v_require_superinitial);
 
   /* function exit code */
@@ -40097,7 +40172,7 @@ static PyObject *__pyx_pf_9pywrapfst_44reverse(CYTHON_UNUSED PyObject *__pyx_sel
   __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, 3852, __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, 3868, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -40114,7 +40189,7 @@ static PyObject *__pyx_pf_9pywrapfst_44reverse(CYTHON_UNUSED PyObject *__pyx_sel
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3876
+/* "pywrapfst.pyx":3892
  * 
  * 
  * cpdef _MutableFst rmepsilon(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -40125,7 +40200,7 @@ static PyObject *__pyx_pf_9pywrapfst_44reverse(CYTHON_UNUSED PyObject *__pyx_sel
 static PyObject *__pyx_pw_9pywrapfst_47rmepsilon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_rmepsilon(struct __pyx_obj_9pywrapfst__Fst *__pyx_v_ifst, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_rmepsilon *__pyx_optional_args) {
 
-  /* "pywrapfst.pyx":3877
+  /* "pywrapfst.pyx":3893
  * 
  * cpdef _MutableFst rmepsilon(_Fst ifst,
  *                             bool connect=True,             # <<<<<<<<<<<<<<
@@ -40137,7 +40212,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_rmepsilon(str
   __pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__52;
   PyObject *__pyx_v_qt = ((PyObject *)__pyx_n_b_auto);
 
-  /* "pywrapfst.pyx":3881
+  /* "pywrapfst.pyx":3897
  *                             int64 nstate=fst.kNoStateId,
  *                             qt=b"auto",
  *                             bool reverse=False,             # <<<<<<<<<<<<<<
@@ -40146,7 +40221,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_rmepsilon(str
  */
   bool __pyx_v_reverse = ((bool)0);
 
-  /* "pywrapfst.pyx":3882
+  /* "pywrapfst.pyx":3898
  *                             qt=b"auto",
  *                             bool reverse=False,
  *                             weight=None):             # <<<<<<<<<<<<<<
@@ -40185,7 +40260,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_rmepsilon(str
     }
   }
 
-  /* "pywrapfst.pyx":3906
+  /* "pywrapfst.pyx":3922
  *     An equivalent FST with no epsilon transitions.
  *   """
  *   cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight)             # <<<<<<<<<<<<<<
@@ -40194,22 +40269,22 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_rmepsilon(str
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "weight_type");
-    __PYX_ERR(0, 3906, __pyx_L1_error)
+    __PYX_ERR(0, 3922, __pyx_L1_error)
   }
-  __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3906, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3922, __pyx_L1_error)
   __pyx_v_wc = __pyx_t_1;
 
-  /* "pywrapfst.pyx":3908
+  /* "pywrapfst.pyx":3924
  *   cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight)
  *   cdef unique_ptr[fst.RmEpsilonOptions] opts
  *   opts.reset(new fst.RmEpsilonOptions(_get_queue_type(tostring(qt)), delta,             # <<<<<<<<<<<<<<
  *                                       connect, wc, nstate))
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
  */
-  __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_qt, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3908, __pyx_L1_error)
-  __pyx_t_3 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3908, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_qt, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3924, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3924, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":3909
+  /* "pywrapfst.pyx":3925
  *   cdef unique_ptr[fst.RmEpsilonOptions] opts
  *   opts.reset(new fst.RmEpsilonOptions(_get_queue_type(tostring(qt)), delta,
  *                                       connect, wc, nstate))             # <<<<<<<<<<<<<<
@@ -40218,7 +40293,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_rmepsilon(str
  */
   __pyx_v_opts.reset(new fst::script::RmEpsilonOptions(__pyx_t_3, __pyx_v_delta, __pyx_v_connect, __pyx_v_wc, __pyx_v_nstate));
 
-  /* "pywrapfst.pyx":3910
+  /* "pywrapfst.pyx":3926
  *   opts.reset(new fst.RmEpsilonOptions(_get_queue_type(tostring(qt)), delta,
  *                                       connect, wc, nstate))
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())             # <<<<<<<<<<<<<<
@@ -40227,11 +40302,11 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_rmepsilon(str
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
-    __PYX_ERR(0, 3910, __pyx_L1_error)
+    __PYX_ERR(0, 3926, __pyx_L1_error)
   }
   __pyx_v_tfst = new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0));
 
-  /* "pywrapfst.pyx":3911
+  /* "pywrapfst.pyx":3927
  *                                       connect, wc, nstate))
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
  *   fst.RmEpsilon(deref(ifst._fst), tfst, reverse, deref(opts))             # <<<<<<<<<<<<<<
@@ -40240,11 +40315,11 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_rmepsilon(str
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 3911, __pyx_L1_error)
+    __PYX_ERR(0, 3927, __pyx_L1_error)
   }
   fst::script::RmEpsilon((*__pyx_v_ifst->_fst), __pyx_v_tfst, __pyx_v_reverse, (*__pyx_v_opts));
 
-  /* "pywrapfst.pyx":3912
+  /* "pywrapfst.pyx":3928
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
  *   fst.RmEpsilon(deref(ifst._fst), tfst, reverse, deref(opts))
  *   return _init_MutableFst(tfst)             # <<<<<<<<<<<<<<
@@ -40252,13 +40327,13 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_rmepsilon(str
  * 
  */
   __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3912, __pyx_L1_error)
+  __pyx_t_4 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3928, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_4);
   __pyx_t_4 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3876
+  /* "pywrapfst.pyx":3892
  * 
  * 
  * cpdef _MutableFst rmepsilon(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -40296,7 +40371,7 @@ static PyObject *__pyx_pw_9pywrapfst_47rmepsilon(PyObject *__pyx_self, PyObject
     PyObject* values[7] = {0,0,0,0,0,0,0};
     values[4] = ((PyObject *)__pyx_n_b_auto);
 
-    /* "pywrapfst.pyx":3882
+    /* "pywrapfst.pyx":3898
  *                             qt=b"auto",
  *                             bool reverse=False,
  *                             weight=None):             # <<<<<<<<<<<<<<
@@ -40355,7 +40430,7 @@ static PyObject *__pyx_pw_9pywrapfst_47rmepsilon(PyObject *__pyx_self, PyObject
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rmepsilon") < 0)) __PYX_ERR(0, 3876, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rmepsilon") < 0)) __PYX_ERR(0, 3892, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -40372,10 +40447,10 @@ static PyObject *__pyx_pw_9pywrapfst_47rmepsilon(PyObject *__pyx_self, PyObject
     }
     __pyx_v_ifst = ((struct __pyx_obj_9pywrapfst__Fst *)values[0]);
     if (values[1]) {
-      __pyx_v_connect = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3877, __pyx_L3_error)
+      __pyx_v_connect = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_connect == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3893, __pyx_L3_error)
     } else {
 
-      /* "pywrapfst.pyx":3877
+      /* "pywrapfst.pyx":3893
  * 
  * cpdef _MutableFst rmepsilon(_Fst ifst,
  *                             bool connect=True,             # <<<<<<<<<<<<<<
@@ -40385,21 +40460,21 @@ static PyObject *__pyx_pw_9pywrapfst_47rmepsilon(PyObject *__pyx_self, PyObject
       __pyx_v_connect = ((bool)1);
     }
     if (values[2]) {
-      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3878, __pyx_L3_error)
+      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3894, __pyx_L3_error)
     } else {
       __pyx_v_delta = __pyx_k__51;
     }
     if (values[3]) {
-      __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3879, __pyx_L3_error)
+      __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3895, __pyx_L3_error)
     } else {
       __pyx_v_nstate = __pyx_k__52;
     }
     __pyx_v_qt = values[4];
     if (values[5]) {
-      __pyx_v_reverse = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_reverse == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3881, __pyx_L3_error)
+      __pyx_v_reverse = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_reverse == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3897, __pyx_L3_error)
     } else {
 
-      /* "pywrapfst.pyx":3881
+      /* "pywrapfst.pyx":3897
  *                             int64 nstate=fst.kNoStateId,
  *                             qt=b"auto",
  *                             bool reverse=False,             # <<<<<<<<<<<<<<
@@ -40412,16 +40487,16 @@ static PyObject *__pyx_pw_9pywrapfst_47rmepsilon(PyObject *__pyx_self, PyObject
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("rmepsilon", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3876, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("rmepsilon", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3892, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("pywrapfst.rmepsilon", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3876, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3892, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_46rmepsilon(__pyx_self, __pyx_v_ifst, __pyx_v_connect, __pyx_v_delta, __pyx_v_nstate, __pyx_v_qt, __pyx_v_reverse, __pyx_v_weight);
 
-  /* "pywrapfst.pyx":3876
+  /* "pywrapfst.pyx":3892
  * 
  * 
  * cpdef _MutableFst rmepsilon(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -40452,7 +40527,7 @@ static PyObject *__pyx_pf_9pywrapfst_46rmepsilon(CYTHON_UNUSED PyObject *__pyx_s
   __pyx_t_2.qt = __pyx_v_qt;
   __pyx_t_2.reverse = __pyx_v_reverse;
   __pyx_t_2.weight = __pyx_v_weight;
-  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_rmepsilon(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3876, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_rmepsilon(__pyx_v_ifst, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3892, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -40469,7 +40544,7 @@ static PyObject *__pyx_pf_9pywrapfst_46rmepsilon(CYTHON_UNUSED PyObject *__pyx_s
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3918
+/* "pywrapfst.pyx":3934
  * 
  * 
  * cdef vector[fst.WeightClass] *_shortestdistance(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -40482,7 +40557,7 @@ static std::vector<fst::script::WeightClass>  *__pyx_f_9pywrapfst__shortestdista
   __pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__54;
   PyObject *__pyx_v_qt = ((PyObject *)__pyx_n_b_auto);
 
-  /* "pywrapfst.pyx":3920
+  /* "pywrapfst.pyx":3936
  * cdef vector[fst.WeightClass] *_shortestdistance(_Fst ifst,
  *     float delta=fst.kDelta, int64 nstate=fst.kNoStateId, qt=b"auto",
  *     bool reverse=False) except *:             # <<<<<<<<<<<<<<
@@ -40514,7 +40589,7 @@ static std::vector<fst::script::WeightClass>  *__pyx_f_9pywrapfst__shortestdista
     }
   }
 
-  /* "pywrapfst.pyx":3921
+  /* "pywrapfst.pyx":3937
  *     float delta=fst.kDelta, int64 nstate=fst.kNoStateId, qt=b"auto",
  *     bool reverse=False) except *:
  *   cdef vector[fst.WeightClass] *distance = new vector[fst.WeightClass]()             # <<<<<<<<<<<<<<
@@ -40525,11 +40600,11 @@ static std::vector<fst::script::WeightClass>  *__pyx_f_9pywrapfst__shortestdista
     __pyx_t_1 = new std::vector<fst::script::WeightClass> ();
   } catch(...) {
     __Pyx_CppExn2PyErr();
-    __PYX_ERR(0, 3921, __pyx_L1_error)
+    __PYX_ERR(0, 3937, __pyx_L1_error)
   }
   __pyx_v_distance = __pyx_t_1;
 
-  /* "pywrapfst.pyx":3925
+  /* "pywrapfst.pyx":3941
  *   # not be used in all cases.
  *   cdef unique_ptr[fst.ShortestDistanceOptions] opts
  *   if reverse:             # <<<<<<<<<<<<<<
@@ -40539,7 +40614,7 @@ static std::vector<fst::script::WeightClass>  *__pyx_f_9pywrapfst__shortestdista
   __pyx_t_2 = (__pyx_v_reverse != 0);
   if (__pyx_t_2) {
 
-    /* "pywrapfst.pyx":3928
+    /* "pywrapfst.pyx":3944
  *     # Only the simpler signature supports shortest distance to final states;
  *     # `nstate` and `qt` arguments are ignored.
  *     fst.ShortestDistance(deref(ifst._fst), distance, True, delta)             # <<<<<<<<<<<<<<
@@ -40548,11 +40623,11 @@ static std::vector<fst::script::WeightClass>  *__pyx_f_9pywrapfst__shortestdista
  */
     if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-      __PYX_ERR(0, 3928, __pyx_L1_error)
+      __PYX_ERR(0, 3944, __pyx_L1_error)
     }
     fst::script::ShortestDistance((*__pyx_v_ifst->_fst), __pyx_v_distance, 1, __pyx_v_delta);
 
-    /* "pywrapfst.pyx":3925
+    /* "pywrapfst.pyx":3941
  *   # not be used in all cases.
  *   cdef unique_ptr[fst.ShortestDistanceOptions] opts
  *   if reverse:             # <<<<<<<<<<<<<<
@@ -40562,7 +40637,7 @@ static std::vector<fst::script::WeightClass>  *__pyx_f_9pywrapfst__shortestdista
     goto __pyx_L3;
   }
 
-  /* "pywrapfst.pyx":3930
+  /* "pywrapfst.pyx":3946
  *     fst.ShortestDistance(deref(ifst._fst), distance, True, delta)
  *   else:
  *     opts.reset(new fst.ShortestDistanceOptions(             # <<<<<<<<<<<<<<
@@ -40571,17 +40646,17 @@ static std::vector<fst::script::WeightClass>  *__pyx_f_9pywrapfst__shortestdista
  */
   /*else*/ {
 
-    /* "pywrapfst.pyx":3931
+    /* "pywrapfst.pyx":3947
  *   else:
  *     opts.reset(new fst.ShortestDistanceOptions(
  *         _get_queue_type(tostring(qt)), fst.ANY_ARC_FILTER, nstate, delta))             # <<<<<<<<<<<<<<
  *     fst.ShortestDistance(deref(ifst._fst), distance, deref(opts))
  *   return distance
  */
-    __pyx_t_3 = __pyx_f_9pywrapfst_tostring(__pyx_v_qt, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3931, __pyx_L1_error)
-    __pyx_t_4 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3931, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_9pywrapfst_tostring(__pyx_v_qt, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3947, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3947, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":3930
+    /* "pywrapfst.pyx":3946
  *     fst.ShortestDistance(deref(ifst._fst), distance, True, delta)
  *   else:
  *     opts.reset(new fst.ShortestDistanceOptions(             # <<<<<<<<<<<<<<
@@ -40590,7 +40665,7 @@ static std::vector<fst::script::WeightClass>  *__pyx_f_9pywrapfst__shortestdista
  */
     __pyx_v_opts.reset(new fst::script::ShortestDistanceOptions(__pyx_t_4, fst::script::ANY_ARC_FILTER, __pyx_v_nstate, __pyx_v_delta));
 
-    /* "pywrapfst.pyx":3932
+    /* "pywrapfst.pyx":3948
  *     opts.reset(new fst.ShortestDistanceOptions(
  *         _get_queue_type(tostring(qt)), fst.ANY_ARC_FILTER, nstate, delta))
  *     fst.ShortestDistance(deref(ifst._fst), distance, deref(opts))             # <<<<<<<<<<<<<<
@@ -40599,13 +40674,13 @@ static std::vector<fst::script::WeightClass>  *__pyx_f_9pywrapfst__shortestdista
  */
     if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-      __PYX_ERR(0, 3932, __pyx_L1_error)
+      __PYX_ERR(0, 3948, __pyx_L1_error)
     }
     fst::script::ShortestDistance((*__pyx_v_ifst->_fst), __pyx_v_distance, (*__pyx_v_opts));
   }
   __pyx_L3:;
 
-  /* "pywrapfst.pyx":3933
+  /* "pywrapfst.pyx":3949
  *         _get_queue_type(tostring(qt)), fst.ANY_ARC_FILTER, nstate, delta))
  *     fst.ShortestDistance(deref(ifst._fst), distance, deref(opts))
  *   return distance             # <<<<<<<<<<<<<<
@@ -40615,7 +40690,7 @@ static std::vector<fst::script::WeightClass>  *__pyx_f_9pywrapfst__shortestdista
   __pyx_r = __pyx_v_distance;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3918
+  /* "pywrapfst.pyx":3934
  * 
  * 
  * cdef vector[fst.WeightClass] *_shortestdistance(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -40632,7 +40707,7 @@ static std::vector<fst::script::WeightClass>  *__pyx_f_9pywrapfst__shortestdista
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3936
+/* "pywrapfst.pyx":3952
  * 
  * 
  * def shortestdistance(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -40696,7 +40771,7 @@ static PyObject *__pyx_pw_9pywrapfst_49shortestdistance(PyObject *__pyx_self, Py
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortestdistance") < 0)) __PYX_ERR(0, 3936, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortestdistance") < 0)) __PYX_ERR(0, 3952, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -40711,21 +40786,21 @@ static PyObject *__pyx_pw_9pywrapfst_49shortestdistance(PyObject *__pyx_self, Py
     }
     __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, 3937, __pyx_L3_error)
+      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3953, __pyx_L3_error)
     } else {
       __pyx_v_delta = __pyx_k__55;
     }
     if (values[2]) {
-      __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3938, __pyx_L3_error)
+      __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3954, __pyx_L3_error)
     } else {
       __pyx_v_nstate = __pyx_k__56;
     }
     __pyx_v_qt = 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, 3940, __pyx_L3_error)
+      __pyx_v_reverse = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_reverse == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3956, __pyx_L3_error)
     } else {
 
-      /* "pywrapfst.pyx":3940
+      /* "pywrapfst.pyx":3956
  *                      int64 nstate=fst.kNoStateId,
  *                      qt=b"auto",
  *                      bool reverse=False):             # <<<<<<<<<<<<<<
@@ -40737,16 +40812,16 @@ static PyObject *__pyx_pw_9pywrapfst_49shortestdistance(PyObject *__pyx_self, Py
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("shortestdistance", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3936, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("shortestdistance", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3952, __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, 3936, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3952, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_48shortestdistance(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nstate, __pyx_v_qt, __pyx_v_reverse);
 
-  /* "pywrapfst.pyx":3936
+  /* "pywrapfst.pyx":3952
  * 
  * 
  * def shortestdistance(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -40779,7 +40854,7 @@ static PyObject *__pyx_pf_9pywrapfst_48shortestdistance(CYTHON_UNUSED PyObject *
   int __pyx_t_7;
   __Pyx_RefNannySetupContext("shortestdistance", 0);
 
-  /* "pywrapfst.pyx":3968
+  /* "pywrapfst.pyx":3984
  *   """
  *   cdef unique_ptr[vector[fst.WeightClass]] distance
  *   distance.reset(_shortestdistance(ifst, delta, nstate, qt, reverse))             # <<<<<<<<<<<<<<
@@ -40791,10 +40866,10 @@ static PyObject *__pyx_pf_9pywrapfst_48shortestdistance(CYTHON_UNUSED PyObject *
   __pyx_t_2.nstate = __pyx_v_nstate;
   __pyx_t_2.qt = __pyx_v_qt;
   __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, 3968, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_9pywrapfst__shortestdistance(__pyx_v_ifst, &__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3984, __pyx_L1_error)
   __pyx_v_distance.reset(__pyx_t_1);
 
-  /* "pywrapfst.pyx":3970
+  /* "pywrapfst.pyx":3986
  *   distance.reset(_shortestdistance(ifst, delta, nstate, qt, reverse))
  *   # Packs the distances, as strings, into a Python list.
  *   cdef string weight_type = ifst.weight_type()             # <<<<<<<<<<<<<<
@@ -40803,23 +40878,23 @@ static PyObject *__pyx_pf_9pywrapfst_48shortestdistance(CYTHON_UNUSED PyObject *
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "weight_type");
-    __PYX_ERR(0, 3970, __pyx_L1_error)
+    __PYX_ERR(0, 3986, __pyx_L1_error)
   }
   __pyx_v_weight_type = ((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0);
 
-  /* "pywrapfst.pyx":3971
+  /* "pywrapfst.pyx":3987
  *   # Packs the distances, as strings, into a Python list.
  *   cdef string weight_type = ifst.weight_type()
  *   result = []             # <<<<<<<<<<<<<<
  *   # This is just the Cython version of the normal vector iteration idiom.
  *   cdef vector[fst.WeightClass].iterator it = distance.get().begin()
  */
-  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3971, __pyx_L1_error)
+  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3987, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_v_result = ((PyObject*)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "pywrapfst.pyx":3973
+  /* "pywrapfst.pyx":3989
  *   result = []
  *   # This is just the Cython version of the normal vector iteration idiom.
  *   cdef vector[fst.WeightClass].iterator it = distance.get().begin()             # <<<<<<<<<<<<<<
@@ -40828,7 +40903,7 @@ static PyObject *__pyx_pf_9pywrapfst_48shortestdistance(CYTHON_UNUSED PyObject *
  */
   __pyx_v_it = __pyx_v_distance.get()->begin();
 
-  /* "pywrapfst.pyx":3974
+  /* "pywrapfst.pyx":3990
  *   # This is just the Cython version of the normal vector iteration idiom.
  *   cdef vector[fst.WeightClass].iterator it = distance.get().begin()
  *   while it != distance.get().end():             # <<<<<<<<<<<<<<
@@ -40839,18 +40914,18 @@ static PyObject *__pyx_pf_9pywrapfst_48shortestdistance(CYTHON_UNUSED PyObject *
     __pyx_t_4 = ((__pyx_v_it != __pyx_v_distance.get()->end()) != 0);
     if (!__pyx_t_4) break;
 
-    /* "pywrapfst.pyx":3975
+    /* "pywrapfst.pyx":3991
  *   cdef vector[fst.WeightClass].iterator it = distance.get().begin()
  *   while it != distance.get().end():
  *     result.append(Weight(weight_type, deref(it).ToString()))             # <<<<<<<<<<<<<<
  *     inc(it)
  *   return result
  */
-    __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_weight_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3975, __pyx_L1_error)
+    __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_weight_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3991, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_5 = __pyx_convert_PyBytes_string_to_py_std__in_string((*__pyx_v_it).ToString()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3975, __pyx_L1_error)
+    __pyx_t_5 = __pyx_convert_PyBytes_string_to_py_std__in_string((*__pyx_v_it).ToString()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3991, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3975, __pyx_L1_error)
+    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3991, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_GIVEREF(__pyx_t_3);
     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
@@ -40858,13 +40933,13 @@ static PyObject *__pyx_pf_9pywrapfst_48shortestdistance(CYTHON_UNUSED PyObject *
     PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
     __pyx_t_3 = 0;
     __pyx_t_5 = 0;
-    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3975, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_9pywrapfst_Weight), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3991, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_5); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 3975, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_5); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 3991, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "pywrapfst.pyx":3976
+    /* "pywrapfst.pyx":3992
  *   while it != distance.get().end():
  *     result.append(Weight(weight_type, deref(it).ToString()))
  *     inc(it)             # <<<<<<<<<<<<<<
@@ -40874,7 +40949,7 @@ static PyObject *__pyx_pf_9pywrapfst_48shortestdistance(CYTHON_UNUSED PyObject *
     (++__pyx_v_it);
   }
 
-  /* "pywrapfst.pyx":3977
+  /* "pywrapfst.pyx":3993
  *     result.append(Weight(weight_type, deref(it).ToString()))
  *     inc(it)
  *   return result             # <<<<<<<<<<<<<<
@@ -40886,7 +40961,7 @@ static PyObject *__pyx_pf_9pywrapfst_48shortestdistance(CYTHON_UNUSED PyObject *
   __pyx_r = __pyx_v_result;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3936
+  /* "pywrapfst.pyx":3952
  * 
  * 
  * def shortestdistance(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -40908,7 +40983,7 @@ static PyObject *__pyx_pf_9pywrapfst_48shortestdistance(CYTHON_UNUSED PyObject *
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":3980
+/* "pywrapfst.pyx":3996
  * 
  * 
  * cpdef _MutableFst shortestpath(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -40923,7 +40998,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_shortestpath(
   __pyx_t_10basictypes_int64 __pyx_v_nstate = __pyx_k__58;
   PyObject *__pyx_v_qt = ((PyObject *)__pyx_n_b_auto);
 
-  /* "pywrapfst.pyx":3985
+  /* "pywrapfst.pyx":4001
  *                                int64 nstate=fst.kNoStateId,
  *                                qt=b"auto",
  *                                bool unique=False,             # <<<<<<<<<<<<<<
@@ -40932,7 +41007,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_shortestpath(
  */
   bool __pyx_v_unique = ((bool)0);
 
-  /* "pywrapfst.pyx":3986
+  /* "pywrapfst.pyx":4002
  *                                qt=b"auto",
  *                                bool unique=False,
  *                                weight=None):             # <<<<<<<<<<<<<<
@@ -40973,7 +41048,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_shortestpath(
     }
   }
 
-  /* "pywrapfst.pyx":4017
+  /* "pywrapfst.pyx":4033
  *     An FST containing the n-shortest paths.
  *   """
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())             # <<<<<<<<<<<<<<
@@ -40982,11 +41057,11 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_shortestpath(
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
-    __PYX_ERR(0, 4017, __pyx_L1_error)
+    __PYX_ERR(0, 4033, __pyx_L1_error)
   }
   __pyx_v_tfst = new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0));
 
-  /* "pywrapfst.pyx":4019
+  /* "pywrapfst.pyx":4035
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
  *   cdef unique_ptr[vector[fst.WeightClass]] distance
  *   distance.reset(new vector[fst.WeightClass]())             # <<<<<<<<<<<<<<
@@ -40997,11 +41072,11 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_shortestpath(
     __pyx_t_1 = new std::vector<fst::script::WeightClass> ();
   } catch(...) {
     __Pyx_CppExn2PyErr();
-    __PYX_ERR(0, 4019, __pyx_L1_error)
+    __PYX_ERR(0, 4035, __pyx_L1_error)
   }
   __pyx_v_distance.reset(__pyx_t_1);
 
-  /* "pywrapfst.pyx":4021
+  /* "pywrapfst.pyx":4037
  *   distance.reset(new vector[fst.WeightClass]())
  *   # Threshold is set to semiring Zero (no pruning) if no weight is specified.
  *   cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight)             # <<<<<<<<<<<<<<
@@ -41010,22 +41085,22 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_shortestpath(
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "weight_type");
-    __PYX_ERR(0, 4021, __pyx_L1_error)
+    __PYX_ERR(0, 4037, __pyx_L1_error)
   }
-  __pyx_t_2 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4021, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_9pywrapfst__get_WeightClass_or_Zero(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0), __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4037, __pyx_L1_error)
   __pyx_v_wc = __pyx_t_2;
 
-  /* "pywrapfst.pyx":4023
+  /* "pywrapfst.pyx":4039
  *   cdef fst.WeightClass wc = _get_WeightClass_or_Zero(ifst.weight_type(), weight)
  *   cdef unique_ptr[fst.ShortestPathOptions] opts
  *   opts.reset(new fst.ShortestPathOptions(_get_queue_type(tostring(qt)),             # <<<<<<<<<<<<<<
  *                                          nshortest, unique, False, delta,
  *                                          False, wc, nstate))
  */
-  __pyx_t_3 = __pyx_f_9pywrapfst_tostring(__pyx_v_qt, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4023, __pyx_L1_error)
-  __pyx_t_4 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4023, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_9pywrapfst_tostring(__pyx_v_qt, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4039, __pyx_L1_error)
+  __pyx_t_4 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4039, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":4025
+  /* "pywrapfst.pyx":4041
  *   opts.reset(new fst.ShortestPathOptions(_get_queue_type(tostring(qt)),
  *                                          nshortest, unique, False, delta,
  *                                          False, wc, nstate))             # <<<<<<<<<<<<<<
@@ -41034,7 +41109,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_shortestpath(
  */
   __pyx_v_opts.reset(new fst::script::ShortestPathOptions(__pyx_t_4, __pyx_v_nshortest, __pyx_v_unique, 0, __pyx_v_delta, 0, __pyx_v_wc, __pyx_v_nstate));
 
-  /* "pywrapfst.pyx":4026
+  /* "pywrapfst.pyx":4042
  *                                          nshortest, unique, False, delta,
  *                                          False, wc, nstate))
  *   fst.ShortestPath(deref(ifst._fst), tfst, distance.get(), deref(opts))             # <<<<<<<<<<<<<<
@@ -41043,11 +41118,11 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_shortestpath(
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 4026, __pyx_L1_error)
+    __PYX_ERR(0, 4042, __pyx_L1_error)
   }
   fst::script::ShortestPath((*__pyx_v_ifst->_fst), __pyx_v_tfst, __pyx_v_distance.get(), (*__pyx_v_opts));
 
-  /* "pywrapfst.pyx":4027
+  /* "pywrapfst.pyx":4043
  *                                          False, wc, nstate))
  *   fst.ShortestPath(deref(ifst._fst), tfst, distance.get(), deref(opts))
  *   return _init_MutableFst(tfst)             # <<<<<<<<<<<<<<
@@ -41055,13 +41130,13 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_shortestpath(
  * 
  */
   __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __pyx_t_5 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4027, __pyx_L1_error)
+  __pyx_t_5 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4043, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_5);
   __pyx_t_5 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":3980
+  /* "pywrapfst.pyx":3996
  * 
  * 
  * cpdef _MutableFst shortestpath(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -41099,7 +41174,7 @@ static PyObject *__pyx_pw_9pywrapfst_51shortestpath(PyObject *__pyx_self, PyObje
     PyObject* values[7] = {0,0,0,0,0,0,0};
     values[4] = ((PyObject *)__pyx_n_b_auto);
 
-    /* "pywrapfst.pyx":3986
+    /* "pywrapfst.pyx":4002
  *                                qt=b"auto",
  *                                bool unique=False,
  *                                weight=None):             # <<<<<<<<<<<<<<
@@ -41158,7 +41233,7 @@ static PyObject *__pyx_pw_9pywrapfst_51shortestpath(PyObject *__pyx_self, PyObje
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortestpath") < 0)) __PYX_ERR(0, 3980, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortestpath") < 0)) __PYX_ERR(0, 3996, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -41175,26 +41250,26 @@ static PyObject *__pyx_pw_9pywrapfst_51shortestpath(PyObject *__pyx_self, PyObje
     }
     __pyx_v_ifst = ((struct __pyx_obj_9pywrapfst__Fst *)values[0]);
     if (values[1]) {
-      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3981, __pyx_L3_error)
+      __pyx_v_delta = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 3997, __pyx_L3_error)
     } else {
       __pyx_v_delta = __pyx_k__57;
     }
     if (values[2]) {
-      __pyx_v_nshortest = __Pyx_PyInt_As_int32_t(values[2]); if (unlikely((__pyx_v_nshortest == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3982, __pyx_L3_error)
+      __pyx_v_nshortest = __Pyx_PyInt_As_int32_t(values[2]); if (unlikely((__pyx_v_nshortest == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3998, __pyx_L3_error)
     } else {
       __pyx_v_nshortest = ((__pyx_t_10basictypes_int32)1);
     }
     if (values[3]) {
-      __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3983, __pyx_L3_error)
+      __pyx_v_nstate = __Pyx_PyInt_As_int64_t(values[3]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3999, __pyx_L3_error)
     } else {
       __pyx_v_nstate = __pyx_k__58;
     }
     __pyx_v_qt = 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, 3985, __pyx_L3_error)
+      __pyx_v_unique = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_unique == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4001, __pyx_L3_error)
     } else {
 
-      /* "pywrapfst.pyx":3985
+      /* "pywrapfst.pyx":4001
  *                                int64 nstate=fst.kNoStateId,
  *                                qt=b"auto",
  *                                bool unique=False,             # <<<<<<<<<<<<<<
@@ -41207,16 +41282,16 @@ static PyObject *__pyx_pw_9pywrapfst_51shortestpath(PyObject *__pyx_self, PyObje
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("shortestpath", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3980, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("shortestpath", 0, 1, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 3996, __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, 3980, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 3996, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_50shortestpath(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nshortest, __pyx_v_nstate, __pyx_v_qt, __pyx_v_unique, __pyx_v_weight);
 
-  /* "pywrapfst.pyx":3980
+  /* "pywrapfst.pyx":3996
  * 
  * 
  * cpdef _MutableFst shortestpath(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -41247,7 +41322,7 @@ static PyObject *__pyx_pf_9pywrapfst_50shortestpath(CYTHON_UNUSED PyObject *__py
   __pyx_t_2.qt = __pyx_v_qt;
   __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, 3980, __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, 3996, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -41264,7 +41339,7 @@ static PyObject *__pyx_pf_9pywrapfst_50shortestpath(CYTHON_UNUSED PyObject *__py
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4030
+/* "pywrapfst.pyx":4046
  * 
  * 
  * cpdef _Fst statemap(_Fst ifst, mt):             # <<<<<<<<<<<<<<
@@ -41280,7 +41355,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_statemap(struct __py
   struct __pyx_opt_args_9pywrapfst__map __pyx_t_2;
   __Pyx_RefNannySetupContext("statemap", 0);
 
-  /* "pywrapfst.pyx":4053
+  /* "pywrapfst.pyx":4069
  *   See also: `arcmap`.
  *   """
  *   return _map(ifst, fst.kDelta, mt, None)             # <<<<<<<<<<<<<<
@@ -41292,13 +41367,13 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_statemap(struct __py
   __pyx_t_2.delta = fst::kDelta;
   __pyx_t_2.mt = __pyx_v_mt;
   __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, 4053, __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, 4069, __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":4030
+  /* "pywrapfst.pyx":4046
  * 
  * 
  * cpdef _Fst statemap(_Fst ifst, mt):             # <<<<<<<<<<<<<<
@@ -41346,11 +41421,11 @@ static PyObject *__pyx_pw_9pywrapfst_53statemap(PyObject *__pyx_self, PyObject *
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mt)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("statemap", 1, 2, 2, 1); __PYX_ERR(0, 4030, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("statemap", 1, 2, 2, 1); __PYX_ERR(0, 4046, __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, 4030, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "statemap") < 0)) __PYX_ERR(0, 4046, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -41363,13 +41438,13 @@ static PyObject *__pyx_pw_9pywrapfst_53statemap(PyObject *__pyx_self, PyObject *
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("statemap", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4030, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("statemap", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4046, __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, 4030, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 4046, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_52statemap(__pyx_self, __pyx_v_ifst, __pyx_v_mt);
 
   /* function exit code */
@@ -41387,7 +41462,7 @@ static PyObject *__pyx_pf_9pywrapfst_52statemap(CYTHON_UNUSED PyObject *__pyx_se
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("statemap", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_statemap(__pyx_v_ifst, __pyx_v_mt, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4030, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_statemap(__pyx_v_ifst, __pyx_v_mt, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4046, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -41404,7 +41479,7 @@ static PyObject *__pyx_pf_9pywrapfst_52statemap(CYTHON_UNUSED PyObject *__pyx_se
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4056
+/* "pywrapfst.pyx":4072
  * 
  * 
  * cpdef _MutableFst synchronize(_Fst ifst):             # <<<<<<<<<<<<<<
@@ -41420,7 +41495,7 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_synchronize(s
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("synchronize", 0);
 
-  /* "pywrapfst.pyx":4075
+  /* "pywrapfst.pyx":4091
  *     An equivalent synchronized FST.
  *   """
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())             # <<<<<<<<<<<<<<
@@ -41429,11 +41504,11 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_synchronize(s
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "arc_type");
-    __PYX_ERR(0, 4075, __pyx_L1_error)
+    __PYX_ERR(0, 4091, __pyx_L1_error)
   }
   __pyx_v_tfst = new fst::script::VectorFstClass(((struct __pyx_vtabstruct_9pywrapfst__Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0));
 
-  /* "pywrapfst.pyx":4076
+  /* "pywrapfst.pyx":4092
  *   """
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
  *   fst.Synchronize(deref(ifst._fst), tfst)             # <<<<<<<<<<<<<<
@@ -41442,11 +41517,11 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_synchronize(s
  */
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 4076, __pyx_L1_error)
+    __PYX_ERR(0, 4092, __pyx_L1_error)
   }
   fst::script::Synchronize((*__pyx_v_ifst->_fst), __pyx_v_tfst);
 
-  /* "pywrapfst.pyx":4077
+  /* "pywrapfst.pyx":4093
  *   cdef VectorFstClass_ptr tfst = new fst.VectorFstClass(ifst.arc_type())
  *   fst.Synchronize(deref(ifst._fst), tfst)
  *   return _init_MutableFst(tfst)             # <<<<<<<<<<<<<<
@@ -41454,13 +41529,13 @@ static struct __pyx_obj_9pywrapfst__MutableFst *__pyx_f_9pywrapfst_synchronize(s
  * 
  */
   __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4077, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4093, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_1);
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":4056
+  /* "pywrapfst.pyx":4072
  * 
  * 
  * cpdef _MutableFst synchronize(_Fst ifst):             # <<<<<<<<<<<<<<
@@ -41486,7 +41561,7 @@ static PyObject *__pyx_pw_9pywrapfst_55synchronize(PyObject *__pyx_self, PyObjec
   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, 4056, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 4072, __pyx_L1_error)
   __pyx_r = __pyx_pf_9pywrapfst_54synchronize(__pyx_self, ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_v_ifst));
 
   /* function exit code */
@@ -41504,7 +41579,7 @@ static PyObject *__pyx_pf_9pywrapfst_54synchronize(CYTHON_UNUSED PyObject *__pyx
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("synchronize", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_synchronize(__pyx_v_ifst, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4056, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_synchronize(__pyx_v_ifst, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4072, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -41521,7 +41596,7 @@ static PyObject *__pyx_pf_9pywrapfst_54synchronize(CYTHON_UNUSED PyObject *__pyx
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4134
+/* "pywrapfst.pyx":4150
  *   """
  * 
  *   def __cinit__(self,             # <<<<<<<<<<<<<<
@@ -41549,7 +41624,7 @@ static int __pyx_pw_9pywrapfst_8Compiler_1__cinit__(PyObject *__pyx_v_self, PyOb
     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fst_type,&__pyx_n_s_arc_type,&__pyx_n_s_isymbols,&__pyx_n_s_osymbols,&__pyx_n_s_ssymbols,&__pyx_n_s_acceptor,&__pyx_n_s_keep_isymbols,&__pyx_n_s_keep_osymbols,&__pyx_n_s_keep_state_numbering,&__pyx_n_s_allow_negative_labels,0};
     PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
 
-    /* "pywrapfst.pyx":4137
+    /* "pywrapfst.pyx":4153
  *                 string fst_type=b"vector",
  *                 string arc_type=b"standard",
  *                 SymbolTable isymbols=None,             # <<<<<<<<<<<<<<
@@ -41558,7 +41633,7 @@ static int __pyx_pw_9pywrapfst_8Compiler_1__cinit__(PyObject *__pyx_v_self, PyOb
  */
     values[2] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTable *)Py_None);
 
-    /* "pywrapfst.pyx":4138
+    /* "pywrapfst.pyx":4154
  *                 string arc_type=b"standard",
  *                 SymbolTable isymbols=None,
  *                 SymbolTable osymbols=None,             # <<<<<<<<<<<<<<
@@ -41567,7 +41642,7 @@ static int __pyx_pw_9pywrapfst_8Compiler_1__cinit__(PyObject *__pyx_v_self, PyOb
  */
     values[3] = (PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTable *)Py_None);
 
-    /* "pywrapfst.pyx":4139
+    /* "pywrapfst.pyx":4155
  *                 SymbolTable isymbols=None,
  *                 SymbolTable osymbols=None,
  *                 SymbolTable ssymbols=None,             # <<<<<<<<<<<<<<
@@ -41646,7 +41721,7 @@ static int __pyx_pw_9pywrapfst_8Compiler_1__cinit__(PyObject *__pyx_v_self, PyOb
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 4134, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 4150, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -41665,12 +41740,12 @@ static int __pyx_pw_9pywrapfst_8Compiler_1__cinit__(PyObject *__pyx_v_self, PyOb
       }
     }
     if (values[0]) {
-      __pyx_v_fst_type = __pyx_convert_string_from_py_std__in_string(values[0]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4135, __pyx_L3_error)
+      __pyx_v_fst_type = __pyx_convert_string_from_py_std__in_string(values[0]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4151, __pyx_L3_error)
     } else {
       __pyx_v_fst_type = __pyx_k__59;
     }
     if (values[1]) {
-      __pyx_v_arc_type = __pyx_convert_string_from_py_std__in_string(values[1]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4136, __pyx_L3_error)
+      __pyx_v_arc_type = __pyx_convert_string_from_py_std__in_string(values[1]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4152, __pyx_L3_error)
     } else {
       __pyx_v_arc_type = __pyx_k__60;
     }
@@ -41678,10 +41753,10 @@ static int __pyx_pw_9pywrapfst_8Compiler_1__cinit__(PyObject *__pyx_v_self, PyOb
     __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, 4140, __pyx_L3_error)
+      __pyx_v_acceptor = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_acceptor == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4156, __pyx_L3_error)
     } else {
 
-      /* "pywrapfst.pyx":4140
+      /* "pywrapfst.pyx":4156
  *                 SymbolTable osymbols=None,
  *                 SymbolTable ssymbols=None,
  *                 bool acceptor=False,             # <<<<<<<<<<<<<<
@@ -41691,10 +41766,10 @@ static int __pyx_pw_9pywrapfst_8Compiler_1__cinit__(PyObject *__pyx_v_self, PyOb
       __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, 4141, __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, 4157, __pyx_L3_error)
     } else {
 
-      /* "pywrapfst.pyx":4141
+      /* "pywrapfst.pyx":4157
  *                 SymbolTable ssymbols=None,
  *                 bool acceptor=False,
  *                 bool keep_isymbols=False,             # <<<<<<<<<<<<<<
@@ -41704,10 +41779,10 @@ static int __pyx_pw_9pywrapfst_8Compiler_1__cinit__(PyObject *__pyx_v_self, PyOb
       __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, 4142, __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, 4158, __pyx_L3_error)
     } else {
 
-      /* "pywrapfst.pyx":4142
+      /* "pywrapfst.pyx":4158
  *                 bool acceptor=False,
  *                 bool keep_isymbols=False,
  *                 bool keep_osymbols=False,             # <<<<<<<<<<<<<<
@@ -41717,10 +41792,10 @@ static int __pyx_pw_9pywrapfst_8Compiler_1__cinit__(PyObject *__pyx_v_self, PyOb
       __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, 4143, __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, 4159, __pyx_L3_error)
     } else {
 
-      /* "pywrapfst.pyx":4143
+      /* "pywrapfst.pyx":4159
  *                 bool keep_isymbols=False,
  *                 bool keep_osymbols=False,
  *                 bool keep_state_numbering=False,             # <<<<<<<<<<<<<<
@@ -41730,10 +41805,10 @@ static int __pyx_pw_9pywrapfst_8Compiler_1__cinit__(PyObject *__pyx_v_self, PyOb
       __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, 4144, __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, 4160, __pyx_L3_error)
     } else {
 
-      /* "pywrapfst.pyx":4144
+      /* "pywrapfst.pyx":4160
  *                 bool keep_osymbols=False,
  *                 bool keep_state_numbering=False,
  *                 bool allow_negative_labels=False):             # <<<<<<<<<<<<<<
@@ -41745,18 +41820,18 @@ static int __pyx_pw_9pywrapfst_8Compiler_1__cinit__(PyObject *__pyx_v_self, PyOb
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4134, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4150, __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, 4137, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 4138, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 4139, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "isymbols", 0))) __PYX_ERR(0, 4153, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 4154, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_ptype_9pywrapfst_SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 4155, __pyx_L1_error)
   __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":4134
+  /* "pywrapfst.pyx":4150
  *   """
  * 
  *   def __cinit__(self,             # <<<<<<<<<<<<<<
@@ -41783,7 +41858,7 @@ static int __pyx_pf_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_9pywrapfst_C
   fst::SymbolTable *__pyx_t_5;
   __Pyx_RefNannySetupContext("__cinit__", 0);
 
-  /* "pywrapfst.pyx":4145
+  /* "pywrapfst.pyx":4161
  *                 bool keep_state_numbering=False,
  *                 bool allow_negative_labels=False):
  *     self._sstrm.reset(new stringstream())             # <<<<<<<<<<<<<<
@@ -41792,45 +41867,45 @@ static int __pyx_pf_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_9pywrapfst_C
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_sstrm");
-    __PYX_ERR(0, 4145, __pyx_L1_error)
+    __PYX_ERR(0, 4161, __pyx_L1_error)
   }
   __pyx_v_self->_sstrm.reset(new std::stringstream());
 
-  /* "pywrapfst.pyx":4146
+  /* "pywrapfst.pyx":4162
  *                 bool allow_negative_labels=False):
  *     self._sstrm.reset(new stringstream())
  *     self._fst_type = tostring(fst_type)             # <<<<<<<<<<<<<<
  *     self._arc_type = tostring(arc_type)
  *     self._isymbols = NULL
  */
-  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_fst_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4146, __pyx_L1_error)
+  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_fst_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4162, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_t_1, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4146, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_t_1, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4162, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst_type");
-    __PYX_ERR(0, 4146, __pyx_L1_error)
+    __PYX_ERR(0, 4162, __pyx_L1_error)
   }
   __pyx_v_self->_fst_type = __pyx_t_2;
 
-  /* "pywrapfst.pyx":4147
+  /* "pywrapfst.pyx":4163
  *     self._sstrm.reset(new stringstream())
  *     self._fst_type = tostring(fst_type)
  *     self._arc_type = tostring(arc_type)             # <<<<<<<<<<<<<<
  *     self._isymbols = NULL
  *     if isymbols is not None:
  */
-  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4147, __pyx_L1_error)
+  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4163, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_t_1, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4147, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_t_1, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4163, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_arc_type");
-    __PYX_ERR(0, 4147, __pyx_L1_error)
+    __PYX_ERR(0, 4163, __pyx_L1_error)
   }
   __pyx_v_self->_arc_type = __pyx_t_2;
 
-  /* "pywrapfst.pyx":4148
+  /* "pywrapfst.pyx":4164
  *     self._fst_type = tostring(fst_type)
  *     self._arc_type = tostring(arc_type)
  *     self._isymbols = NULL             # <<<<<<<<<<<<<<
@@ -41839,11 +41914,11 @@ static int __pyx_pf_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_9pywrapfst_C
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_isymbols");
-    __PYX_ERR(0, 4148, __pyx_L1_error)
+    __PYX_ERR(0, 4164, __pyx_L1_error)
   }
   __pyx_v_self->_isymbols = NULL;
 
-  /* "pywrapfst.pyx":4149
+  /* "pywrapfst.pyx":4165
  *     self._arc_type = tostring(arc_type)
  *     self._isymbols = NULL
  *     if isymbols is not None:             # <<<<<<<<<<<<<<
@@ -41854,7 +41929,7 @@ static int __pyx_pf_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_9pywrapfst_C
   __pyx_t_4 = (__pyx_t_3 != 0);
   if (__pyx_t_4) {
 
-    /* "pywrapfst.pyx":4150
+    /* "pywrapfst.pyx":4166
  *     self._isymbols = NULL
  *     if isymbols is not None:
  *       self._isymbols = isymbols._table             # <<<<<<<<<<<<<<
@@ -41863,16 +41938,16 @@ static int __pyx_pf_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_9pywrapfst_C
  */
     if (unlikely(((PyObject *)__pyx_v_isymbols) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
-      __PYX_ERR(0, 4150, __pyx_L1_error)
+      __PYX_ERR(0, 4166, __pyx_L1_error)
     }
     __pyx_t_5 = __pyx_v_isymbols->__pyx_base.__pyx_base._table;
     if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_isymbols");
-      __PYX_ERR(0, 4150, __pyx_L1_error)
+      __PYX_ERR(0, 4166, __pyx_L1_error)
     }
     __pyx_v_self->_isymbols = __pyx_t_5;
 
-    /* "pywrapfst.pyx":4149
+    /* "pywrapfst.pyx":4165
  *     self._arc_type = tostring(arc_type)
  *     self._isymbols = NULL
  *     if isymbols is not None:             # <<<<<<<<<<<<<<
@@ -41881,7 +41956,7 @@ static int __pyx_pf_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_9pywrapfst_C
  */
   }
 
-  /* "pywrapfst.pyx":4151
+  /* "pywrapfst.pyx":4167
  *     if isymbols is not None:
  *       self._isymbols = isymbols._table
  *     self._osymbols = NULL             # <<<<<<<<<<<<<<
@@ -41890,11 +41965,11 @@ static int __pyx_pf_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_9pywrapfst_C
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_osymbols");
-    __PYX_ERR(0, 4151, __pyx_L1_error)
+    __PYX_ERR(0, 4167, __pyx_L1_error)
   }
   __pyx_v_self->_osymbols = NULL;
 
-  /* "pywrapfst.pyx":4152
+  /* "pywrapfst.pyx":4168
  *       self._isymbols = isymbols._table
  *     self._osymbols = NULL
  *     if osymbols is not None:             # <<<<<<<<<<<<<<
@@ -41905,7 +41980,7 @@ static int __pyx_pf_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_9pywrapfst_C
   __pyx_t_3 = (__pyx_t_4 != 0);
   if (__pyx_t_3) {
 
-    /* "pywrapfst.pyx":4153
+    /* "pywrapfst.pyx":4169
  *     self._osymbols = NULL
  *     if osymbols is not None:
  *       self._osymbols = osymbols._table             # <<<<<<<<<<<<<<
@@ -41914,16 +41989,16 @@ static int __pyx_pf_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_9pywrapfst_C
  */
     if (unlikely(((PyObject *)__pyx_v_osymbols) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
-      __PYX_ERR(0, 4153, __pyx_L1_error)
+      __PYX_ERR(0, 4169, __pyx_L1_error)
     }
     __pyx_t_5 = __pyx_v_osymbols->__pyx_base.__pyx_base._table;
     if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_osymbols");
-      __PYX_ERR(0, 4153, __pyx_L1_error)
+      __PYX_ERR(0, 4169, __pyx_L1_error)
     }
     __pyx_v_self->_osymbols = __pyx_t_5;
 
-    /* "pywrapfst.pyx":4152
+    /* "pywrapfst.pyx":4168
  *       self._isymbols = isymbols._table
  *     self._osymbols = NULL
  *     if osymbols is not None:             # <<<<<<<<<<<<<<
@@ -41932,7 +42007,7 @@ static int __pyx_pf_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_9pywrapfst_C
  */
   }
 
-  /* "pywrapfst.pyx":4154
+  /* "pywrapfst.pyx":4170
  *     if osymbols is not None:
  *       self._osymbols = osymbols._table
  *     self._ssymbols = NULL             # <<<<<<<<<<<<<<
@@ -41941,11 +42016,11 @@ static int __pyx_pf_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_9pywrapfst_C
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_ssymbols");
-    __PYX_ERR(0, 4154, __pyx_L1_error)
+    __PYX_ERR(0, 4170, __pyx_L1_error)
   }
   __pyx_v_self->_ssymbols = NULL;
 
-  /* "pywrapfst.pyx":4155
+  /* "pywrapfst.pyx":4171
  *       self._osymbols = osymbols._table
  *     self._ssymbols = NULL
  *     if ssymbols is not None:             # <<<<<<<<<<<<<<
@@ -41956,7 +42031,7 @@ static int __pyx_pf_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_9pywrapfst_C
   __pyx_t_4 = (__pyx_t_3 != 0);
   if (__pyx_t_4) {
 
-    /* "pywrapfst.pyx":4156
+    /* "pywrapfst.pyx":4172
  *     self._ssymbols = NULL
  *     if ssymbols is not None:
  *       self._ssymbols = ssymbols._table             # <<<<<<<<<<<<<<
@@ -41965,16 +42040,16 @@ static int __pyx_pf_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_9pywrapfst_C
  */
     if (unlikely(((PyObject *)__pyx_v_ssymbols) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_table");
-      __PYX_ERR(0, 4156, __pyx_L1_error)
+      __PYX_ERR(0, 4172, __pyx_L1_error)
     }
     __pyx_t_5 = __pyx_v_ssymbols->__pyx_base.__pyx_base._table;
     if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_ssymbols");
-      __PYX_ERR(0, 4156, __pyx_L1_error)
+      __PYX_ERR(0, 4172, __pyx_L1_error)
     }
     __pyx_v_self->_ssymbols = __pyx_t_5;
 
-    /* "pywrapfst.pyx":4155
+    /* "pywrapfst.pyx":4171
  *       self._osymbols = osymbols._table
  *     self._ssymbols = NULL
  *     if ssymbols is not None:             # <<<<<<<<<<<<<<
@@ -41983,7 +42058,7 @@ static int __pyx_pf_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_9pywrapfst_C
  */
   }
 
-  /* "pywrapfst.pyx":4157
+  /* "pywrapfst.pyx":4173
  *     if ssymbols is not None:
  *       self._ssymbols = ssymbols._table
  *     self._acceptor = acceptor             # <<<<<<<<<<<<<<
@@ -41992,11 +42067,11 @@ static int __pyx_pf_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_9pywrapfst_C
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_acceptor");
-    __PYX_ERR(0, 4157, __pyx_L1_error)
+    __PYX_ERR(0, 4173, __pyx_L1_error)
   }
   __pyx_v_self->_acceptor = __pyx_v_acceptor;
 
-  /* "pywrapfst.pyx":4158
+  /* "pywrapfst.pyx":4174
  *       self._ssymbols = ssymbols._table
  *     self._acceptor = acceptor
  *     self._keep_isymbols = keep_isymbols             # <<<<<<<<<<<<<<
@@ -42005,11 +42080,11 @@ static int __pyx_pf_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_9pywrapfst_C
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_keep_isymbols");
-    __PYX_ERR(0, 4158, __pyx_L1_error)
+    __PYX_ERR(0, 4174, __pyx_L1_error)
   }
   __pyx_v_self->_keep_isymbols = __pyx_v_keep_isymbols;
 
-  /* "pywrapfst.pyx":4159
+  /* "pywrapfst.pyx":4175
  *     self._acceptor = acceptor
  *     self._keep_isymbols = keep_isymbols
  *     self._keep_osymbols = keep_osymbols             # <<<<<<<<<<<<<<
@@ -42018,11 +42093,11 @@ static int __pyx_pf_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_9pywrapfst_C
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_keep_osymbols");
-    __PYX_ERR(0, 4159, __pyx_L1_error)
+    __PYX_ERR(0, 4175, __pyx_L1_error)
   }
   __pyx_v_self->_keep_osymbols = __pyx_v_keep_osymbols;
 
-  /* "pywrapfst.pyx":4160
+  /* "pywrapfst.pyx":4176
  *     self._keep_isymbols = keep_isymbols
  *     self._keep_osymbols = keep_osymbols
  *     self._keep_state_numbering = keep_state_numbering             # <<<<<<<<<<<<<<
@@ -42031,11 +42106,11 @@ static int __pyx_pf_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_9pywrapfst_C
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_keep_state_numbering");
-    __PYX_ERR(0, 4160, __pyx_L1_error)
+    __PYX_ERR(0, 4176, __pyx_L1_error)
   }
   __pyx_v_self->_keep_state_numbering = __pyx_v_keep_state_numbering;
 
-  /* "pywrapfst.pyx":4161
+  /* "pywrapfst.pyx":4177
  *     self._keep_osymbols = keep_osymbols
  *     self._keep_state_numbering = keep_state_numbering
  *     self._allow_negative_labels = allow_negative_labels             # <<<<<<<<<<<<<<
@@ -42044,11 +42119,11 @@ static int __pyx_pf_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_9pywrapfst_C
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_allow_negative_labels");
-    __PYX_ERR(0, 4161, __pyx_L1_error)
+    __PYX_ERR(0, 4177, __pyx_L1_error)
   }
   __pyx_v_self->_allow_negative_labels = __pyx_v_allow_negative_labels;
 
-  /* "pywrapfst.pyx":4134
+  /* "pywrapfst.pyx":4150
  *   """
  * 
  *   def __cinit__(self,             # <<<<<<<<<<<<<<
@@ -42068,7 +42143,7 @@ static int __pyx_pf_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_9pywrapfst_C
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4163
+/* "pywrapfst.pyx":4179
  *     self._allow_negative_labels = allow_negative_labels
  * 
  *   cpdef _Fst compile(self):             # <<<<<<<<<<<<<<
@@ -42092,7 +42167,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_8Compiler_compile(st
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4163, __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, 4179, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_8Compiler_3compile)) {
       __Pyx_XDECREF(((PyObject *)__pyx_r));
@@ -42108,14 +42183,14 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_8Compiler_compile(st
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4163, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4179, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4163, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4179, __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, 4163, __pyx_L1_error)
+      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__Fst))))) __PYX_ERR(0, 4179, __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;
@@ -42124,7 +42199,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_8Compiler_compile(st
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":4177
+  /* "pywrapfst.pyx":4193
  *       FstOpError: Compilation failed.
  *     """
  *     cdef fst.FstClass *tfst = fst.CompileFstInternal(deref(self._sstrm),             # <<<<<<<<<<<<<<
@@ -42133,31 +42208,31 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_8Compiler_compile(st
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_sstrm");
-    __PYX_ERR(0, 4177, __pyx_L1_error)
+    __PYX_ERR(0, 4193, __pyx_L1_error)
   }
 
-  /* "pywrapfst.pyx":4178
+  /* "pywrapfst.pyx":4194
  *     """
  *     cdef fst.FstClass *tfst = fst.CompileFstInternal(deref(self._sstrm),
  *         "<pywrapfst>", self._fst_type, self._arc_type, self._isymbols,             # <<<<<<<<<<<<<<
  *         self._osymbols, self._ssymbols, self._acceptor, self._keep_isymbols,
  *         self._keep_osymbols, self._keep_state_numbering,
  */
-  __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_kp_b_pywrapfst); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4178, __pyx_L1_error)
+  __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_kp_b_pywrapfst); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4194, __pyx_L1_error)
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst_type");
-    __PYX_ERR(0, 4178, __pyx_L1_error)
+    __PYX_ERR(0, 4194, __pyx_L1_error)
   }
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_arc_type");
-    __PYX_ERR(0, 4178, __pyx_L1_error)
+    __PYX_ERR(0, 4194, __pyx_L1_error)
   }
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_isymbols");
-    __PYX_ERR(0, 4178, __pyx_L1_error)
+    __PYX_ERR(0, 4194, __pyx_L1_error)
   }
 
-  /* "pywrapfst.pyx":4179
+  /* "pywrapfst.pyx":4195
  *     cdef fst.FstClass *tfst = fst.CompileFstInternal(deref(self._sstrm),
  *         "<pywrapfst>", self._fst_type, self._arc_type, self._isymbols,
  *         self._osymbols, self._ssymbols, self._acceptor, self._keep_isymbols,             # <<<<<<<<<<<<<<
@@ -42166,22 +42241,22 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_8Compiler_compile(st
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_osymbols");
-    __PYX_ERR(0, 4179, __pyx_L1_error)
+    __PYX_ERR(0, 4195, __pyx_L1_error)
   }
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_ssymbols");
-    __PYX_ERR(0, 4179, __pyx_L1_error)
+    __PYX_ERR(0, 4195, __pyx_L1_error)
   }
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_acceptor");
-    __PYX_ERR(0, 4179, __pyx_L1_error)
+    __PYX_ERR(0, 4195, __pyx_L1_error)
   }
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_keep_isymbols");
-    __PYX_ERR(0, 4179, __pyx_L1_error)
+    __PYX_ERR(0, 4195, __pyx_L1_error)
   }
 
-  /* "pywrapfst.pyx":4180
+  /* "pywrapfst.pyx":4196
  *         "<pywrapfst>", self._fst_type, self._arc_type, self._isymbols,
  *         self._osymbols, self._ssymbols, self._acceptor, self._keep_isymbols,
  *         self._keep_osymbols, self._keep_state_numbering,             # <<<<<<<<<<<<<<
@@ -42190,14 +42265,14 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_8Compiler_compile(st
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_keep_osymbols");
-    __PYX_ERR(0, 4180, __pyx_L1_error)
+    __PYX_ERR(0, 4196, __pyx_L1_error)
   }
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_keep_state_numbering");
-    __PYX_ERR(0, 4180, __pyx_L1_error)
+    __PYX_ERR(0, 4196, __pyx_L1_error)
   }
 
-  /* "pywrapfst.pyx":4181
+  /* "pywrapfst.pyx":4197
  *         self._osymbols, self._ssymbols, self._acceptor, self._keep_isymbols,
  *         self._keep_osymbols, self._keep_state_numbering,
  *         self._allow_negative_labels)             # <<<<<<<<<<<<<<
@@ -42206,10 +42281,10 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_8Compiler_compile(st
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_allow_negative_labels");
-    __PYX_ERR(0, 4181, __pyx_L1_error)
+    __PYX_ERR(0, 4197, __pyx_L1_error)
   }
 
-  /* "pywrapfst.pyx":4177
+  /* "pywrapfst.pyx":4193
  *       FstOpError: Compilation failed.
  *     """
  *     cdef fst.FstClass *tfst = fst.CompileFstInternal(deref(self._sstrm),             # <<<<<<<<<<<<<<
@@ -42218,7 +42293,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_8Compiler_compile(st
  */
   __pyx_v_tfst = fst::script::CompileFstInternal((*__pyx_v_self->_sstrm), __pyx_t_5, __pyx_v_self->_fst_type, __pyx_v_self->_arc_type, __pyx_v_self->_isymbols, __pyx_v_self->_osymbols, __pyx_v_self->_ssymbols, __pyx_v_self->_acceptor, __pyx_v_self->_keep_isymbols, __pyx_v_self->_keep_osymbols, __pyx_v_self->_keep_state_numbering, __pyx_v_self->_allow_negative_labels);
 
-  /* "pywrapfst.pyx":4182
+  /* "pywrapfst.pyx":4198
  *         self._keep_osymbols, self._keep_state_numbering,
  *         self._allow_negative_labels)
  *     self._sstrm.reset(new stringstream())             # <<<<<<<<<<<<<<
@@ -42227,11 +42302,11 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_8Compiler_compile(st
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_sstrm");
-    __PYX_ERR(0, 4182, __pyx_L1_error)
+    __PYX_ERR(0, 4198, __pyx_L1_error)
   }
   __pyx_v_self->_sstrm.reset(new std::stringstream());
 
-  /* "pywrapfst.pyx":4183
+  /* "pywrapfst.pyx":4199
  *         self._allow_negative_labels)
  *     self._sstrm.reset(new stringstream())
  *     if tfst == NULL:             # <<<<<<<<<<<<<<
@@ -42241,23 +42316,23 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_8Compiler_compile(st
   __pyx_t_6 = ((__pyx_v_tfst == NULL) != 0);
   if (__pyx_t_6) {
 
-    /* "pywrapfst.pyx":4184
+    /* "pywrapfst.pyx":4200
  *     self._sstrm.reset(new stringstream())
  *     if tfst == NULL:
  *       raise FstOpError("Compilation failed")             # <<<<<<<<<<<<<<
  *     return _init_XFst(tfst)
  * 
  */
-    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4184, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4200, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4184, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4200, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 4184, __pyx_L1_error)
+    __PYX_ERR(0, 4200, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":4183
+    /* "pywrapfst.pyx":4199
  *         self._allow_negative_labels)
  *     self._sstrm.reset(new stringstream())
  *     if tfst == NULL:             # <<<<<<<<<<<<<<
@@ -42266,7 +42341,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_8Compiler_compile(st
  */
   }
 
-  /* "pywrapfst.pyx":4185
+  /* "pywrapfst.pyx":4201
  *     if tfst == NULL:
  *       raise FstOpError("Compilation failed")
  *     return _init_XFst(tfst)             # <<<<<<<<<<<<<<
@@ -42274,13 +42349,13 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_8Compiler_compile(st
  *   cpdef void write(self, expression):
  */
   __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4185, __pyx_L1_error)
+  __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4201, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_2);
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":4163
+  /* "pywrapfst.pyx":4179
  *     self._allow_negative_labels = allow_negative_labels
  * 
  *   cpdef _Fst compile(self):             # <<<<<<<<<<<<<<
@@ -42322,7 +42397,7 @@ static PyObject *__pyx_pf_9pywrapfst_8Compiler_2compile(struct __pyx_obj_9pywrap
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("compile", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_8Compiler_compile(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4163, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_8Compiler_compile(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4179, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -42339,7 +42414,7 @@ static PyObject *__pyx_pf_9pywrapfst_8Compiler_2compile(struct __pyx_obj_9pywrap
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4187
+/* "pywrapfst.pyx":4203
  *     return _init_XFst(tfst)
  * 
  *   cpdef void write(self, expression):             # <<<<<<<<<<<<<<
@@ -42361,7 +42436,7 @@ static void __pyx_f_9pywrapfst_8Compiler_write(struct __pyx_obj_9pywrapfst_Compi
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4187, __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, 4203, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_8Compiler_5write)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -42376,13 +42451,13 @@ static void __pyx_f_9pywrapfst_8Compiler_write(struct __pyx_obj_9pywrapfst_Compi
         }
       }
       if (!__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_expression); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4187, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_expression); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4203, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_2);
       } else {
         #if CYTHON_FAST_PYCALL
         if (PyFunction_Check(__pyx_t_3)) {
           PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_expression};
-          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4187, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4203, __pyx_L1_error)
           __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
           __Pyx_GOTREF(__pyx_t_2);
         } else
@@ -42390,19 +42465,19 @@ static void __pyx_f_9pywrapfst_8Compiler_write(struct __pyx_obj_9pywrapfst_Compi
         #if CYTHON_FAST_PYCCALL
         if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
           PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_expression};
-          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4187, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4203, __pyx_L1_error)
           __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
           __Pyx_GOTREF(__pyx_t_2);
         } else
         #endif
         {
-          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4187, __pyx_L1_error)
+          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4203, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_5);
           __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
           __Pyx_INCREF(__pyx_v_expression);
           __Pyx_GIVEREF(__pyx_v_expression);
           PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_expression);
-          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4187, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4203, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_2);
           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
         }
@@ -42415,7 +42490,7 @@ static void __pyx_f_9pywrapfst_8Compiler_write(struct __pyx_obj_9pywrapfst_Compi
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":4203
+  /* "pywrapfst.pyx":4219
  *       expression: A string expression to add to compiler string buffer.
  *     """
  *     deref(self._sstrm) << tostring(expression)             # <<<<<<<<<<<<<<
@@ -42424,12 +42499,12 @@ static void __pyx_f_9pywrapfst_8Compiler_write(struct __pyx_obj_9pywrapfst_Compi
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_sstrm");
-    __PYX_ERR(0, 4203, __pyx_L1_error)
+    __PYX_ERR(0, 4219, __pyx_L1_error)
   }
-  __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_expression, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4203, __pyx_L1_error)
+  __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_expression, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4219, __pyx_L1_error)
   ((*__pyx_v_self->_sstrm) << __pyx_t_6);
 
-  /* "pywrapfst.pyx":4187
+  /* "pywrapfst.pyx":4203
  *     return _init_XFst(tfst)
  * 
  *   cpdef void write(self, expression):             # <<<<<<<<<<<<<<
@@ -42470,7 +42545,7 @@ static PyObject *__pyx_pf_9pywrapfst_8Compiler_4write(struct __pyx_obj_9pywrapfs
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("write", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_8Compiler_write(__pyx_v_self, __pyx_v_expression, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4187, __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, 4203, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -42487,7 +42562,7 @@ static PyObject *__pyx_pf_9pywrapfst_8Compiler_4write(struct __pyx_obj_9pywrapfs
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4228
+/* "pywrapfst.pyx":4244
  *   """
  * 
  *   def __init__(self):             # <<<<<<<<<<<<<<
@@ -42523,28 +42598,28 @@ static int __pyx_pf_9pywrapfst_9FarReader___init__(struct __pyx_obj_9pywrapfst_F
   PyObject *__pyx_t_7 = NULL;
   __Pyx_RefNannySetupContext("__init__", 0);
 
-  /* "pywrapfst.pyx":4229
+  /* "pywrapfst.pyx":4245
  * 
  *   def __init__(self):
  *     raise FstDeletedConstructorError(             # <<<<<<<<<<<<<<
  *         "Cannot construct {}".format(self.__class__.__name__))
  * 
  */
-  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstDeletedConstructorError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4229, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstDeletedConstructorError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4245, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
 
-  /* "pywrapfst.pyx":4230
+  /* "pywrapfst.pyx":4246
  *   def __init__(self):
  *     raise FstDeletedConstructorError(
  *         "Cannot construct {}".format(self.__class__.__name__))             # <<<<<<<<<<<<<<
  * 
  *   def __repr__(self):
  */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Cannot_construct, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4230, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Cannot_construct, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4246, __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, 4230, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4246, __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, 4230, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4246, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __pyx_t_5 = NULL;
@@ -42558,14 +42633,14 @@ static int __pyx_pf_9pywrapfst_9FarReader___init__(struct __pyx_obj_9pywrapfst_F
     }
   }
   if (!__pyx_t_5) {
-    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4230, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4246, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else {
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_4)) {
       PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
-      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4230, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4246, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
@@ -42574,20 +42649,20 @@ static int __pyx_pf_9pywrapfst_9FarReader___init__(struct __pyx_obj_9pywrapfst_F
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
       PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
-      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4230, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4246, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     } else
     #endif
     {
-      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4230, __pyx_L1_error)
+      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4246, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
       __Pyx_GIVEREF(__pyx_t_6);
       PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
       __pyx_t_6 = 0;
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4230, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4246, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
     }
@@ -42604,14 +42679,14 @@ static int __pyx_pf_9pywrapfst_9FarReader___init__(struct __pyx_obj_9pywrapfst_F
     }
   }
   if (!__pyx_t_4) {
-    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4229, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4245, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else {
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_2)) {
       PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
-      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4229, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4245, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -42620,20 +42695,20 @@ static int __pyx_pf_9pywrapfst_9FarReader___init__(struct __pyx_obj_9pywrapfst_F
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
       PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
-      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4229, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4245, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     } else
     #endif
     {
-      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4229, __pyx_L1_error)
+      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4245, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
       __Pyx_GIVEREF(__pyx_t_3);
       PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
       __pyx_t_3 = 0;
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4229, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4245, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
     }
@@ -42641,9 +42716,9 @@ static int __pyx_pf_9pywrapfst_9FarReader___init__(struct __pyx_obj_9pywrapfst_F
   __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, 4229, __pyx_L1_error)
+  __PYX_ERR(0, 4245, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":4228
+  /* "pywrapfst.pyx":4244
  *   """
  * 
  *   def __init__(self):             # <<<<<<<<<<<<<<
@@ -42666,7 +42741,7 @@ static int __pyx_pf_9pywrapfst_9FarReader___init__(struct __pyx_obj_9pywrapfst_F
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4232
+/* "pywrapfst.pyx":4248
  *         "Cannot construct {}".format(self.__class__.__name__))
  * 
  *   def __repr__(self):             # <<<<<<<<<<<<<<
@@ -42699,7 +42774,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_2__repr__(struct __pyx_obj_9pywr
   PyObject *__pyx_t_7 = NULL;
   __Pyx_RefNannySetupContext("__repr__", 0);
 
-  /* "pywrapfst.pyx":4233
+  /* "pywrapfst.pyx":4249
  * 
  *   def __repr__(self):
  *     return "<{} FarReader at 0x{:x}>".format(self.far_type(), id(self))             # <<<<<<<<<<<<<<
@@ -42707,20 +42782,20 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_2__repr__(struct __pyx_obj_9pywr
  *   @classmethod
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_FarReader_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4233, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_FarReader_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4249, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "far_type");
-    __PYX_ERR(0, 4233, __pyx_L1_error)
+    __PYX_ERR(0, 4249, __pyx_L1_error)
   }
-  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->far_type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4233, __pyx_L1_error)
+  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->far_type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4249, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4233, __pyx_L1_error)
+  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4249, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
   PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
-  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4233, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4249, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_t_4 = NULL;
@@ -42738,7 +42813,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_2__repr__(struct __pyx_obj_9pywr
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4233, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4249, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -42748,7 +42823,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_2__repr__(struct __pyx_obj_9pywr
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4233, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4249, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -42756,7 +42831,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_2__repr__(struct __pyx_obj_9pywr
   } else
   #endif
   {
-    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4233, __pyx_L1_error)
+    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4249, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     if (__pyx_t_4) {
       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
@@ -42767,7 +42842,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_2__repr__(struct __pyx_obj_9pywr
     PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
     __pyx_t_3 = 0;
     __pyx_t_5 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4233, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4249, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   }
@@ -42776,7 +42851,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_2__repr__(struct __pyx_obj_9pywr
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":4232
+  /* "pywrapfst.pyx":4248
  *         "Cannot construct {}".format(self.__class__.__name__))
  * 
  *   def __repr__(self):             # <<<<<<<<<<<<<<
@@ -42800,7 +42875,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_2__repr__(struct __pyx_obj_9pywr
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4236
+/* "pywrapfst.pyx":4252
  * 
  *   @classmethod
  *   def open(cls, *filenames):             # <<<<<<<<<<<<<<
@@ -42846,47 +42921,47 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_4open(CYTHON_UNUSED PyTypeObject
   __Pyx_RefNannySetupContext("open", 0);
   __Pyx_INCREF(__pyx_v_filenames);
 
-  /* "pywrapfst.pyx":4254
+  /* "pywrapfst.pyx":4270
  *       FstIOError: Read failed.
  *     """
  *     filenames = [tostring(filename) for filename in filenames]             # <<<<<<<<<<<<<<
  *     cdef fst.FarReaderClass *tfar = fst.FarReaderClass.Open(filenames)
  *     if tfar == NULL:
  */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4254, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4270, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_v_filenames; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
   for (;;) {
     if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-    __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 4254, __pyx_L1_error)
+    __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 4270, __pyx_L1_error)
     #else
-    __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4254, __pyx_L1_error)
+    __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4270, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     #endif
     __Pyx_XDECREF_SET(__pyx_v_filename, __pyx_t_4);
     __pyx_t_4 = 0;
-    __pyx_t_5 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4254, __pyx_L1_error)
-    __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4254, __pyx_L1_error)
+    __pyx_t_5 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4270, __pyx_L1_error)
+    __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4270, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 4254, __pyx_L1_error)
+    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 4270, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   }
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF_SET(__pyx_v_filenames, __pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "pywrapfst.pyx":4255
+  /* "pywrapfst.pyx":4271
  *     """
  *     filenames = [tostring(filename) for filename in filenames]
  *     cdef fst.FarReaderClass *tfar = fst.FarReaderClass.Open(filenames)             # <<<<<<<<<<<<<<
  *     if tfar == NULL:
  *       raise FstIOError("Read failed: {!r}".format(filenames))
  */
-  __pyx_t_6 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_v_filenames); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4255, __pyx_L1_error)
+  __pyx_t_6 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_v_filenames); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4271, __pyx_L1_error)
   __pyx_v_tfar = fst::script::FarReaderClass::Open(__pyx_t_6);
 
-  /* "pywrapfst.pyx":4256
+  /* "pywrapfst.pyx":4272
  *     filenames = [tostring(filename) for filename in filenames]
  *     cdef fst.FarReaderClass *tfar = fst.FarReaderClass.Open(filenames)
  *     if tfar == NULL:             # <<<<<<<<<<<<<<
@@ -42896,16 +42971,16 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_4open(CYTHON_UNUSED PyTypeObject
   __pyx_t_7 = ((__pyx_v_tfar == NULL) != 0);
   if (__pyx_t_7) {
 
-    /* "pywrapfst.pyx":4257
+    /* "pywrapfst.pyx":4273
  *     cdef fst.FarReaderClass *tfar = fst.FarReaderClass.Open(filenames)
  *     if tfar == NULL:
  *       raise FstIOError("Read failed: {!r}".format(filenames))             # <<<<<<<<<<<<<<
  *     cdef FarReader result = FarReader.__new__(FarReader)
  *     result._reader.reset(tfar)
  */
-    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4257, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4273, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4257, __pyx_L1_error)
+    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Read_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4273, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_8);
     __pyx_t_9 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
@@ -42918,13 +42993,13 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_4open(CYTHON_UNUSED PyTypeObject
       }
     }
     if (!__pyx_t_9) {
-      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_filenames); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4257, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_filenames); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4273, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
     } else {
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_8)) {
         PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_filenames};
-        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4257, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4273, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
         __Pyx_GOTREF(__pyx_t_4);
       } else
@@ -42932,19 +43007,19 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_4open(CYTHON_UNUSED PyTypeObject
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
         PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_filenames};
-        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4257, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4273, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
         __Pyx_GOTREF(__pyx_t_4);
       } else
       #endif
       {
-        __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4257, __pyx_L1_error)
+        __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4273, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_10);
         __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL;
         __Pyx_INCREF(__pyx_v_filenames);
         __Pyx_GIVEREF(__pyx_v_filenames);
         PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_filenames);
-        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4257, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4273, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
       }
@@ -42961,14 +43036,14 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_4open(CYTHON_UNUSED PyTypeObject
       }
     }
     if (!__pyx_t_8) {
-      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4257, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4273, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_GOTREF(__pyx_t_1);
     } else {
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_2)) {
         PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_4};
-        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4257, __pyx_L1_error)
+        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4273, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
         __Pyx_GOTREF(__pyx_t_1);
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -42977,20 +43052,20 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_4open(CYTHON_UNUSED PyTypeObject
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
         PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_4};
-        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4257, __pyx_L1_error)
+        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4273, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
         __Pyx_GOTREF(__pyx_t_1);
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else
       #endif
       {
-        __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4257, __pyx_L1_error)
+        __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 4273, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_10);
         __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
         __Pyx_GIVEREF(__pyx_t_4);
         PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_4);
         __pyx_t_4 = 0;
-        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4257, __pyx_L1_error)
+        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4273, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
       }
@@ -42998,9 +43073,9 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_4open(CYTHON_UNUSED PyTypeObject
     __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, 4257, __pyx_L1_error)
+    __PYX_ERR(0, 4273, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":4256
+    /* "pywrapfst.pyx":4272
  *     filenames = [tostring(filename) for filename in filenames]
  *     cdef fst.FarReaderClass *tfar = fst.FarReaderClass.Open(filenames)
  *     if tfar == NULL:             # <<<<<<<<<<<<<<
@@ -43009,20 +43084,20 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_4open(CYTHON_UNUSED PyTypeObject
  */
   }
 
-  /* "pywrapfst.pyx":4258
+  /* "pywrapfst.pyx":4274
  *     if tfar == NULL:
  *       raise FstIOError("Read failed: {!r}".format(filenames))
  *     cdef FarReader result = FarReader.__new__(FarReader)             # <<<<<<<<<<<<<<
  *     result._reader.reset(tfar)
  *     return result
  */
-  __pyx_t_1 = __pyx_tp_new_9pywrapfst_FarReader(((PyTypeObject *)__pyx_ptype_9pywrapfst_FarReader), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4258, __pyx_L1_error)
+  __pyx_t_1 = __pyx_tp_new_9pywrapfst_FarReader(((PyTypeObject *)__pyx_ptype_9pywrapfst_FarReader), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4274, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_FarReader)))) __PYX_ERR(0, 4258, __pyx_L1_error)
+  if (!(likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_9pywrapfst_FarReader)))) __PYX_ERR(0, 4274, __pyx_L1_error)
   __pyx_v_result = ((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "pywrapfst.pyx":4259
+  /* "pywrapfst.pyx":4275
  *       raise FstIOError("Read failed: {!r}".format(filenames))
  *     cdef FarReader result = FarReader.__new__(FarReader)
  *     result._reader.reset(tfar)             # <<<<<<<<<<<<<<
@@ -43031,11 +43106,11 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_4open(CYTHON_UNUSED PyTypeObject
  */
   if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_reader");
-    __PYX_ERR(0, 4259, __pyx_L1_error)
+    __PYX_ERR(0, 4275, __pyx_L1_error)
   }
   __pyx_v_result->_reader.reset(__pyx_v_tfar);
 
-  /* "pywrapfst.pyx":4260
+  /* "pywrapfst.pyx":4276
  *     cdef FarReader result = FarReader.__new__(FarReader)
  *     result._reader.reset(tfar)
  *     return result             # <<<<<<<<<<<<<<
@@ -43047,7 +43122,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_4open(CYTHON_UNUSED PyTypeObject
   __pyx_r = ((PyObject *)__pyx_v_result);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":4236
+  /* "pywrapfst.pyx":4252
  * 
  *   @classmethod
  *   def open(cls, *filenames):             # <<<<<<<<<<<<<<
@@ -43074,7 +43149,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_4open(CYTHON_UNUSED PyTypeObject
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4263
+/* "pywrapfst.pyx":4279
  * 
  *   # This just registers this class as a possible iterator.
  *   def __iter__(self):             # <<<<<<<<<<<<<<
@@ -43100,7 +43175,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_6__iter__(struct __pyx_obj_9pywr
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__iter__", 0);
 
-  /* "pywrapfst.pyx":4264
+  /* "pywrapfst.pyx":4280
  *   # This just registers this class as a possible iterator.
  *   def __iter__(self):
  *     return self             # <<<<<<<<<<<<<<
@@ -43112,7 +43187,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_6__iter__(struct __pyx_obj_9pywr
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":4263
+  /* "pywrapfst.pyx":4279
  * 
  *   # This just registers this class as a possible iterator.
  *   def __iter__(self):             # <<<<<<<<<<<<<<
@@ -43127,7 +43202,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_6__iter__(struct __pyx_obj_9pywr
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4267
+/* "pywrapfst.pyx":4283
  * 
  *   # Magic method used to get a Pythonic API out of the C++ API.
  *   def __next__(self):             # <<<<<<<<<<<<<<
@@ -43158,7 +43233,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_8__next__(struct __pyx_obj_9pywr
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("__next__", 0);
 
-  /* "pywrapfst.pyx":4268
+  /* "pywrapfst.pyx":4284
  *   # Magic method used to get a Pythonic API out of the C++ API.
  *   def __next__(self):
  *     if self.done():             # <<<<<<<<<<<<<<
@@ -43167,12 +43242,12 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_8__next__(struct __pyx_obj_9pywr
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "done");
-    __PYX_ERR(0, 4268, __pyx_L1_error)
+    __PYX_ERR(0, 4284, __pyx_L1_error)
   }
   __pyx_t_1 = (((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->done(__pyx_v_self, 0) != 0);
   if (__pyx_t_1) {
 
-    /* "pywrapfst.pyx":4269
+    /* "pywrapfst.pyx":4285
  *   def __next__(self):
  *     if self.done():
  *       raise StopIteration             # <<<<<<<<<<<<<<
@@ -43180,9 +43255,9 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_8__next__(struct __pyx_obj_9pywr
  *     cdef _MutableFst f = self.get_fst()
  */
     __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-    __PYX_ERR(0, 4269, __pyx_L1_error)
+    __PYX_ERR(0, 4285, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":4268
+    /* "pywrapfst.pyx":4284
  *   # Magic method used to get a Pythonic API out of the C++ API.
  *   def __next__(self):
  *     if self.done():             # <<<<<<<<<<<<<<
@@ -43191,7 +43266,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_8__next__(struct __pyx_obj_9pywr
  */
   }
 
-  /* "pywrapfst.pyx":4270
+  /* "pywrapfst.pyx":4286
  *     if self.done():
  *       raise StopIteration
  *     cdef string k = self.get_key()             # <<<<<<<<<<<<<<
@@ -43200,11 +43275,11 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_8__next__(struct __pyx_obj_9pywr
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get_key");
-    __PYX_ERR(0, 4270, __pyx_L1_error)
+    __PYX_ERR(0, 4286, __pyx_L1_error)
   }
   __pyx_v_k = ((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->get_key(__pyx_v_self, 0);
 
-  /* "pywrapfst.pyx":4271
+  /* "pywrapfst.pyx":4287
  *       raise StopIteration
  *     cdef string k = self.get_key()
  *     cdef _MutableFst f = self.get_fst()             # <<<<<<<<<<<<<<
@@ -43213,15 +43288,15 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_8__next__(struct __pyx_obj_9pywr
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get_fst");
-    __PYX_ERR(0, 4271, __pyx_L1_error)
+    __PYX_ERR(0, 4287, __pyx_L1_error)
   }
-  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->get_fst(__pyx_v_self, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4271, __pyx_L1_error)
+  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->get_fst(__pyx_v_self, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4287, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__MutableFst))))) __PYX_ERR(0, 4271, __pyx_L1_error)
+  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__MutableFst))))) __PYX_ERR(0, 4287, __pyx_L1_error)
   __pyx_v_f = ((struct __pyx_obj_9pywrapfst__MutableFst *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":4272
+  /* "pywrapfst.pyx":4288
  *     cdef string k = self.get_key()
  *     cdef _MutableFst f = self.get_fst()
  *     self.next()             # <<<<<<<<<<<<<<
@@ -43230,11 +43305,11 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_8__next__(struct __pyx_obj_9pywr
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "next");
-    __PYX_ERR(0, 4272, __pyx_L1_error)
+    __PYX_ERR(0, 4288, __pyx_L1_error)
   }
   ((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0);
 
-  /* "pywrapfst.pyx":4273
+  /* "pywrapfst.pyx":4289
  *     cdef _MutableFst f = self.get_fst()
  *     self.next()
  *     return (k, f)             # <<<<<<<<<<<<<<
@@ -43242,9 +43317,9 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_8__next__(struct __pyx_obj_9pywr
  *   cpdef string arc_type(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4273, __pyx_L1_error)
+  __pyx_t_2 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4289, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4273, __pyx_L1_error)
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4289, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_GIVEREF(__pyx_t_2);
   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
@@ -43256,7 +43331,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_8__next__(struct __pyx_obj_9pywr
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":4267
+  /* "pywrapfst.pyx":4283
  * 
  *   # Magic method used to get a Pythonic API out of the C++ API.
  *   def __next__(self):             # <<<<<<<<<<<<<<
@@ -43277,7 +43352,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_8__next__(struct __pyx_obj_9pywr
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4275
+/* "pywrapfst.pyx":4291
  *     return (k, f)
  * 
  *   cpdef string arc_type(self):             # <<<<<<<<<<<<<<
@@ -43299,7 +43374,7 @@ static std::string __pyx_f_9pywrapfst_9FarReader_arc_type(struct __pyx_obj_9pywr
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4275, __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, 4291, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_11arc_type)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -43314,14 +43389,14 @@ static std::string __pyx_f_9pywrapfst_9FarReader_arc_type(struct __pyx_obj_9pywr
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4275, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4291, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4275, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4291, __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, 4275, __pyx_L1_error)
+      __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4291, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __pyx_r = __pyx_t_5;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -43330,7 +43405,7 @@ static std::string __pyx_f_9pywrapfst_9FarReader_arc_type(struct __pyx_obj_9pywr
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":4276
+  /* "pywrapfst.pyx":4292
  * 
  *   cpdef string arc_type(self):
  *     return self._reader.get().ArcType()             # <<<<<<<<<<<<<<
@@ -43339,12 +43414,12 @@ static std::string __pyx_f_9pywrapfst_9FarReader_arc_type(struct __pyx_obj_9pywr
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_reader");
-    __PYX_ERR(0, 4276, __pyx_L1_error)
+    __PYX_ERR(0, 4292, __pyx_L1_error)
   }
   __pyx_r = __pyx_v_self->_reader.get()->ArcType();
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":4275
+  /* "pywrapfst.pyx":4291
  *     return (k, f)
  * 
  *   cpdef string arc_type(self):             # <<<<<<<<<<<<<<
@@ -43383,7 +43458,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_10arc_type(struct __pyx_obj_9pyw
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("arc_type", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarReader_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4275, __pyx_L1_error)
+  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarReader_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4291, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -43400,7 +43475,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_10arc_type(struct __pyx_obj_9pyw
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4278
+/* "pywrapfst.pyx":4294
  *     return self._reader.get().ArcType()
  * 
  *   cpdef bool done(self):             # <<<<<<<<<<<<<<
@@ -43422,7 +43497,7 @@ static bool __pyx_f_9pywrapfst_9FarReader_done(struct __pyx_obj_9pywrapfst_FarRe
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4278, __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, 4294, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_13done)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -43437,14 +43512,14 @@ static bool __pyx_f_9pywrapfst_9FarReader_done(struct __pyx_obj_9pywrapfst_FarRe
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4278, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4294, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4278, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4294, __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, 4278, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4294, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __pyx_r = __pyx_t_5;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -43453,7 +43528,7 @@ static bool __pyx_f_9pywrapfst_9FarReader_done(struct __pyx_obj_9pywrapfst_FarRe
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":4290
+  /* "pywrapfst.pyx":4306
  *       True if the iterator is exhausted, False otherwise.
  *     """
  *     return self._reader.get().Done()             # <<<<<<<<<<<<<<
@@ -43462,12 +43537,12 @@ static bool __pyx_f_9pywrapfst_9FarReader_done(struct __pyx_obj_9pywrapfst_FarRe
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_reader");
-    __PYX_ERR(0, 4290, __pyx_L1_error)
+    __PYX_ERR(0, 4306, __pyx_L1_error)
   }
   __pyx_r = __pyx_v_self->_reader.get()->Done();
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":4278
+  /* "pywrapfst.pyx":4294
  *     return self._reader.get().ArcType()
  * 
  *   cpdef bool done(self):             # <<<<<<<<<<<<<<
@@ -43508,7 +43583,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_12done(struct __pyx_obj_9pywrapf
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("done", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_9FarReader_done(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4278, __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, 4294, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -43525,7 +43600,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_12done(struct __pyx_obj_9pywrapf
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4292
+/* "pywrapfst.pyx":4308
  *     return self._reader.get().Done()
  * 
  *   cpdef bool error(self):             # <<<<<<<<<<<<<<
@@ -43547,7 +43622,7 @@ static bool __pyx_f_9pywrapfst_9FarReader_error(struct __pyx_obj_9pywrapfst_FarR
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4292, __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, 4308, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_15error)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -43562,14 +43637,14 @@ static bool __pyx_f_9pywrapfst_9FarReader_error(struct __pyx_obj_9pywrapfst_FarR
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4292, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4308, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4292, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4308, __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, 4292, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4308, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __pyx_r = __pyx_t_5;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -43578,7 +43653,7 @@ static bool __pyx_f_9pywrapfst_9FarReader_error(struct __pyx_obj_9pywrapfst_FarR
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":4301
+  /* "pywrapfst.pyx":4317
  *       True if the FarReader is in an errorful state, False otherwise.
  *     """
  *     return self._reader.get().Error()             # <<<<<<<<<<<<<<
@@ -43587,12 +43662,12 @@ static bool __pyx_f_9pywrapfst_9FarReader_error(struct __pyx_obj_9pywrapfst_FarR
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_reader");
-    __PYX_ERR(0, 4301, __pyx_L1_error)
+    __PYX_ERR(0, 4317, __pyx_L1_error)
   }
   __pyx_r = __pyx_v_self->_reader.get()->Error();
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":4292
+  /* "pywrapfst.pyx":4308
  *     return self._reader.get().Done()
  * 
  *   cpdef bool error(self):             # <<<<<<<<<<<<<<
@@ -43633,7 +43708,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_14error(struct __pyx_obj_9pywrap
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("error", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_9FarReader_error(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4292, __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, 4308, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -43650,7 +43725,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_14error(struct __pyx_obj_9pywrap
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4303
+/* "pywrapfst.pyx":4319
  *     return self._reader.get().Error()
  * 
  *   cpdef string far_type(self):             # <<<<<<<<<<<<<<
@@ -43672,7 +43747,7 @@ static std::string __pyx_f_9pywrapfst_9FarReader_far_type(struct __pyx_obj_9pywr
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_far_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4303, __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, 4319, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_17far_type)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -43687,14 +43762,14 @@ static std::string __pyx_f_9pywrapfst_9FarReader_far_type(struct __pyx_obj_9pywr
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4303, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4319, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4303, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4319, __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, 4303, __pyx_L1_error)
+      __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4319, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __pyx_r = __pyx_t_5;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -43703,7 +43778,7 @@ static std::string __pyx_f_9pywrapfst_9FarReader_far_type(struct __pyx_obj_9pywr
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":4304
+  /* "pywrapfst.pyx":4320
  * 
  *   cpdef string far_type(self):
  *     return fst.GetFarTypeString(self._reader.get().Type())             # <<<<<<<<<<<<<<
@@ -43712,12 +43787,12 @@ static std::string __pyx_f_9pywrapfst_9FarReader_far_type(struct __pyx_obj_9pywr
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_reader");
-    __PYX_ERR(0, 4304, __pyx_L1_error)
+    __PYX_ERR(0, 4320, __pyx_L1_error)
   }
   __pyx_r = fst::GetFarTypeString(__pyx_v_self->_reader.get()->Type());
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":4303
+  /* "pywrapfst.pyx":4319
  *     return self._reader.get().Error()
  * 
  *   cpdef string far_type(self):             # <<<<<<<<<<<<<<
@@ -43756,7 +43831,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_16far_type(struct __pyx_obj_9pyw
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("far_type", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarReader_far_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4303, __pyx_L1_error)
+  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarReader_far_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4319, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -43773,7 +43848,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_16far_type(struct __pyx_obj_9pyw
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4306
+/* "pywrapfst.pyx":4322
  *     return fst.GetFarTypeString(self._reader.get().Type())
  * 
  *   cpdef bool find(self, key):             # <<<<<<<<<<<<<<
@@ -43797,7 +43872,7 @@ static bool __pyx_f_9pywrapfst_9FarReader_find(struct __pyx_obj_9pywrapfst_FarRe
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_find); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4306, __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, 4322, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_19find)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -43812,13 +43887,13 @@ static bool __pyx_f_9pywrapfst_9FarReader_find(struct __pyx_obj_9pywrapfst_FarRe
         }
       }
       if (!__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4306, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4322, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_2);
       } else {
         #if CYTHON_FAST_PYCALL
         if (PyFunction_Check(__pyx_t_3)) {
           PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
-          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4306, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4322, __pyx_L1_error)
           __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
           __Pyx_GOTREF(__pyx_t_2);
         } else
@@ -43826,25 +43901,25 @@ static bool __pyx_f_9pywrapfst_9FarReader_find(struct __pyx_obj_9pywrapfst_FarRe
         #if CYTHON_FAST_PYCCALL
         if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
           PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
-          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4306, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4322, __pyx_L1_error)
           __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
           __Pyx_GOTREF(__pyx_t_2);
         } else
         #endif
         {
-          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4306, __pyx_L1_error)
+          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4322, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_5);
           __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
           __Pyx_INCREF(__pyx_v_key);
           __Pyx_GIVEREF(__pyx_v_key);
           PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
-          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4306, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4322, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_2);
           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
         }
       }
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4306, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4322, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __pyx_r = __pyx_t_6;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -43853,7 +43928,7 @@ static bool __pyx_f_9pywrapfst_9FarReader_find(struct __pyx_obj_9pywrapfst_FarRe
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":4322
+  /* "pywrapfst.pyx":4338
  *       True if the key was found, False otherwise.
  *     """
  *     return self._reader.get().Find(tostring(key))             # <<<<<<<<<<<<<<
@@ -43862,13 +43937,13 @@ static bool __pyx_f_9pywrapfst_9FarReader_find(struct __pyx_obj_9pywrapfst_FarRe
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_reader");
-    __PYX_ERR(0, 4322, __pyx_L1_error)
+    __PYX_ERR(0, 4338, __pyx_L1_error)
   }
-  __pyx_t_7 = __pyx_f_9pywrapfst_tostring(__pyx_v_key, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4322, __pyx_L1_error)
+  __pyx_t_7 = __pyx_f_9pywrapfst_tostring(__pyx_v_key, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4338, __pyx_L1_error)
   __pyx_r = __pyx_v_self->_reader.get()->Find(__pyx_t_7);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":4306
+  /* "pywrapfst.pyx":4322
  *     return fst.GetFarTypeString(self._reader.get().Type())
  * 
  *   cpdef bool find(self, key):             # <<<<<<<<<<<<<<
@@ -43910,7 +43985,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_18find(struct __pyx_obj_9pywrapf
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("find", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_9FarReader_find(__pyx_v_self, __pyx_v_key, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4306, __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, 4322, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -43927,7 +44002,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_18find(struct __pyx_obj_9pywrapf
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4324
+/* "pywrapfst.pyx":4340
  *     return self._reader.get().Find(tostring(key))
  * 
  *   cpdef _Fst get_fst(self):             # <<<<<<<<<<<<<<
@@ -43949,7 +44024,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_9FarReader_get_fst(s
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_fst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4324, __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, 4340, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_21get_fst)) {
       __Pyx_XDECREF(((PyObject *)__pyx_r));
@@ -43965,14 +44040,14 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_9FarReader_get_fst(s
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4324, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4340, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4324, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4340, __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, 4324, __pyx_L1_error)
+      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_9pywrapfst__Fst))))) __PYX_ERR(0, 4340, __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;
@@ -43981,7 +44056,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_9FarReader_get_fst(s
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":4337
+  /* "pywrapfst.pyx":4353
  *     """
  *     cdef fst.FstClass *tfst = new fst.FstClass(
  *         deref(self._reader.get().GetFstClass()))             # <<<<<<<<<<<<<<
@@ -43990,10 +44065,10 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_9FarReader_get_fst(s
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_reader");
-    __PYX_ERR(0, 4337, __pyx_L1_error)
+    __PYX_ERR(0, 4353, __pyx_L1_error)
   }
 
-  /* "pywrapfst.pyx":4336
+  /* "pywrapfst.pyx":4352
  *       A copy of the FST at the current position.
  *     """
  *     cdef fst.FstClass *tfst = new fst.FstClass(             # <<<<<<<<<<<<<<
@@ -44002,7 +44077,7 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_9FarReader_get_fst(s
  */
   __pyx_v_tfst = new fst::script::FstClass((*__pyx_v_self->_reader.get()->GetFstClass()));
 
-  /* "pywrapfst.pyx":4338
+  /* "pywrapfst.pyx":4354
  *     cdef fst.FstClass *tfst = new fst.FstClass(
  *         deref(self._reader.get().GetFstClass()))
  *     return _init_XFst(tfst)             # <<<<<<<<<<<<<<
@@ -44010,13 +44085,13 @@ static struct __pyx_obj_9pywrapfst__Fst *__pyx_f_9pywrapfst_9FarReader_get_fst(s
  *   cpdef string get_key(self):
  */
   __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4338, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_tfst)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4354, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = ((struct __pyx_obj_9pywrapfst__Fst *)__pyx_t_1);
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":4324
+  /* "pywrapfst.pyx":4340
  *     return self._reader.get().Find(tostring(key))
  * 
  *   cpdef _Fst get_fst(self):             # <<<<<<<<<<<<<<
@@ -44058,7 +44133,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_20get_fst(struct __pyx_obj_9pywr
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("get_fst", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_9FarReader_get_fst(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4324, __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, 4340, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -44075,7 +44150,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_20get_fst(struct __pyx_obj_9pywr
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4340
+/* "pywrapfst.pyx":4356
  *     return _init_XFst(tfst)
  * 
  *   cpdef string get_key(self):             # <<<<<<<<<<<<<<
@@ -44097,7 +44172,7 @@ static std::string __pyx_f_9pywrapfst_9FarReader_get_key(struct __pyx_obj_9pywra
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4340, __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, 4356, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_23get_key)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -44112,14 +44187,14 @@ static std::string __pyx_f_9pywrapfst_9FarReader_get_key(struct __pyx_obj_9pywra
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4340, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4356, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4340, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4356, __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, 4340, __pyx_L1_error)
+      __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4356, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __pyx_r = __pyx_t_5;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -44128,7 +44203,7 @@ static std::string __pyx_f_9pywrapfst_9FarReader_get_key(struct __pyx_obj_9pywra
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":4352
+  /* "pywrapfst.pyx":4368
  *       The string key at the current position.
  *     """
  *     return self._reader.get().GetKey()             # <<<<<<<<<<<<<<
@@ -44137,12 +44212,12 @@ static std::string __pyx_f_9pywrapfst_9FarReader_get_key(struct __pyx_obj_9pywra
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_reader");
-    __PYX_ERR(0, 4352, __pyx_L1_error)
+    __PYX_ERR(0, 4368, __pyx_L1_error)
   }
   __pyx_r = __pyx_v_self->_reader.get()->GetKey();
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":4340
+  /* "pywrapfst.pyx":4356
  *     return _init_XFst(tfst)
  * 
  *   cpdef string get_key(self):             # <<<<<<<<<<<<<<
@@ -44182,7 +44257,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_22get_key(struct __pyx_obj_9pywr
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("get_key", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarReader_get_key(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4340, __pyx_L1_error)
+  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarReader_get_key(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4356, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -44199,7 +44274,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_22get_key(struct __pyx_obj_9pywr
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4354
+/* "pywrapfst.pyx":4370
  *     return self._reader.get().GetKey()
  * 
  *   cpdef void next(self):             # <<<<<<<<<<<<<<
@@ -44219,7 +44294,7 @@ static void __pyx_f_9pywrapfst_9FarReader_next(struct __pyx_obj_9pywrapfst_FarRe
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4354, __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, 4370, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_25next)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -44234,10 +44309,10 @@ static void __pyx_f_9pywrapfst_9FarReader_next(struct __pyx_obj_9pywrapfst_FarRe
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4354, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4370, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4354, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4370, __pyx_L1_error)
       }
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -44248,7 +44323,7 @@ static void __pyx_f_9pywrapfst_9FarReader_next(struct __pyx_obj_9pywrapfst_FarRe
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":4363
+  /* "pywrapfst.pyx":4379
  *     should use the Pythonic API.
  *     """
  *     self._reader.get().Next()             # <<<<<<<<<<<<<<
@@ -44257,11 +44332,11 @@ static void __pyx_f_9pywrapfst_9FarReader_next(struct __pyx_obj_9pywrapfst_FarRe
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_reader");
-    __PYX_ERR(0, 4363, __pyx_L1_error)
+    __PYX_ERR(0, 4379, __pyx_L1_error)
   }
   __pyx_v_self->_reader.get()->Next();
 
-  /* "pywrapfst.pyx":4354
+  /* "pywrapfst.pyx":4370
  *     return self._reader.get().GetKey()
  * 
  *   cpdef void next(self):             # <<<<<<<<<<<<<<
@@ -44301,7 +44376,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_24next(struct __pyx_obj_9pywrapf
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("next", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_9FarReader_next(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4354, __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, 4370, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -44318,7 +44393,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_24next(struct __pyx_obj_9pywrapf
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4365
+/* "pywrapfst.pyx":4381
  *     self._reader.get().Next()
  * 
  *   cpdef void reset(self):             # <<<<<<<<<<<<<<
@@ -44338,7 +44413,7 @@ static void __pyx_f_9pywrapfst_9FarReader_reset(struct __pyx_obj_9pywrapfst_FarR
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4365, __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, 4381, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_9FarReader_27reset)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -44353,10 +44428,10 @@ static void __pyx_f_9pywrapfst_9FarReader_reset(struct __pyx_obj_9pywrapfst_FarR
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4365, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4381, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4365, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4381, __pyx_L1_error)
       }
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -44367,7 +44442,7 @@ static void __pyx_f_9pywrapfst_9FarReader_reset(struct __pyx_obj_9pywrapfst_FarR
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":4374
+  /* "pywrapfst.pyx":4390
  *     should use the Pythonic API.
  *     """
  *     self._reader.get().Reset()             # <<<<<<<<<<<<<<
@@ -44376,11 +44451,11 @@ static void __pyx_f_9pywrapfst_9FarReader_reset(struct __pyx_obj_9pywrapfst_FarR
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_reader");
-    __PYX_ERR(0, 4374, __pyx_L1_error)
+    __PYX_ERR(0, 4390, __pyx_L1_error)
   }
   __pyx_v_self->_reader.get()->Reset();
 
-  /* "pywrapfst.pyx":4365
+  /* "pywrapfst.pyx":4381
  *     self._reader.get().Next()
  * 
  *   cpdef void reset(self):             # <<<<<<<<<<<<<<
@@ -44420,7 +44495,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_26reset(struct __pyx_obj_9pywrap
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("reset", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_9pywrapfst_9FarReader_reset(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4365, __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, 4381, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -44437,7 +44512,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_26reset(struct __pyx_obj_9pywrap
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4377
+/* "pywrapfst.pyx":4393
  * 
  *   # Dictionary-like access by combining `find` and `get_fst`.
  *   def __getitem__(self, key):             # <<<<<<<<<<<<<<
@@ -44466,7 +44541,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_28__getitem__(struct __pyx_obj_9
   PyObject *__pyx_t_3 = NULL;
   __Pyx_RefNannySetupContext("__getitem__", 0);
 
-  /* "pywrapfst.pyx":4378
+  /* "pywrapfst.pyx":4394
  *   # Dictionary-like access by combining `find` and `get_fst`.
  *   def __getitem__(self, key):
  *     if not self.find(key):             # <<<<<<<<<<<<<<
@@ -44475,31 +44550,31 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_28__getitem__(struct __pyx_obj_9
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "find");
-    __PYX_ERR(0, 4378, __pyx_L1_error)
+    __PYX_ERR(0, 4394, __pyx_L1_error)
   }
   __pyx_t_1 = ((!(((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->find(__pyx_v_self, __pyx_v_key, 0) != 0)) != 0);
   if (__pyx_t_1) {
 
-    /* "pywrapfst.pyx":4379
+    /* "pywrapfst.pyx":4395
  *   def __getitem__(self, key):
  *     if not self.find(key):
  *       raise KeyError(key)             # <<<<<<<<<<<<<<
  *     return self.get_fst()
  * 
  */
-    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4379, __pyx_L1_error)
+    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4395, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_v_key);
     __Pyx_GIVEREF(__pyx_v_key);
     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4379, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4395, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __PYX_ERR(0, 4379, __pyx_L1_error)
+    __PYX_ERR(0, 4395, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":4378
+    /* "pywrapfst.pyx":4394
  *   # Dictionary-like access by combining `find` and `get_fst`.
  *   def __getitem__(self, key):
  *     if not self.find(key):             # <<<<<<<<<<<<<<
@@ -44508,7 +44583,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_28__getitem__(struct __pyx_obj_9
  */
   }
 
-  /* "pywrapfst.pyx":4380
+  /* "pywrapfst.pyx":4396
  *     if not self.find(key):
  *       raise KeyError(key)
  *     return self.get_fst()             # <<<<<<<<<<<<<<
@@ -44518,15 +44593,15 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_28__getitem__(struct __pyx_obj_9
   __Pyx_XDECREF(__pyx_r);
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "get_fst");
-    __PYX_ERR(0, 4380, __pyx_L1_error)
+    __PYX_ERR(0, 4396, __pyx_L1_error)
   }
-  __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->get_fst(__pyx_v_self, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4380, __pyx_L1_error)
+  __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->get_fst(__pyx_v_self, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4396, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":4377
+  /* "pywrapfst.pyx":4393
  * 
  *   # Dictionary-like access by combining `find` and `get_fst`.
  *   def __getitem__(self, key):             # <<<<<<<<<<<<<<
@@ -44546,7 +44621,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarReader_28__getitem__(struct __pyx_obj_9
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4403
+/* "pywrapfst.pyx":4419
  *   """
  * 
  *   def __init__(self):             # <<<<<<<<<<<<<<
@@ -44582,28 +44657,28 @@ static int __pyx_pf_9pywrapfst_9FarWriter___init__(struct __pyx_obj_9pywrapfst_F
   PyObject *__pyx_t_7 = NULL;
   __Pyx_RefNannySetupContext("__init__", 0);
 
-  /* "pywrapfst.pyx":4404
+  /* "pywrapfst.pyx":4420
  * 
  *   def __init__(self):
  *     raise FstDeletedConstructorError(             # <<<<<<<<<<<<<<
  *         "Cannot construct {}".format(self.__class__.__name__))
  * 
  */
-  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstDeletedConstructorError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4404, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstDeletedConstructorError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4420, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
 
-  /* "pywrapfst.pyx":4405
+  /* "pywrapfst.pyx":4421
  *   def __init__(self):
  *     raise FstDeletedConstructorError(
  *         "Cannot construct {}".format(self.__class__.__name__))             # <<<<<<<<<<<<<<
  * 
  *   def __repr__(self):
  */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Cannot_construct, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4405, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Cannot_construct, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4421, __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, 4405, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4421, __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, 4405, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4421, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __pyx_t_5 = NULL;
@@ -44617,14 +44692,14 @@ static int __pyx_pf_9pywrapfst_9FarWriter___init__(struct __pyx_obj_9pywrapfst_F
     }
   }
   if (!__pyx_t_5) {
-    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4405, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4421, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_GOTREF(__pyx_t_3);
   } else {
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_4)) {
       PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
-      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4405, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4421, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
@@ -44633,20 +44708,20 @@ static int __pyx_pf_9pywrapfst_9FarWriter___init__(struct __pyx_obj_9pywrapfst_F
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
       PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
-      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4405, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4421, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     } else
     #endif
     {
-      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4405, __pyx_L1_error)
+      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4421, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
       __Pyx_GIVEREF(__pyx_t_6);
       PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
       __pyx_t_6 = 0;
-      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4405, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4421, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
     }
@@ -44663,14 +44738,14 @@ static int __pyx_pf_9pywrapfst_9FarWriter___init__(struct __pyx_obj_9pywrapfst_F
     }
   }
   if (!__pyx_t_4) {
-    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4404, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4420, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else {
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_2)) {
       PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
-      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4404, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4420, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -44679,20 +44754,20 @@ static int __pyx_pf_9pywrapfst_9FarWriter___init__(struct __pyx_obj_9pywrapfst_F
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
       PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
-      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4404, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4420, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     } else
     #endif
     {
-      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4404, __pyx_L1_error)
+      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4420, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
       __Pyx_GIVEREF(__pyx_t_3);
       PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
       __pyx_t_3 = 0;
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4404, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4420, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
     }
@@ -44700,9 +44775,9 @@ static int __pyx_pf_9pywrapfst_9FarWriter___init__(struct __pyx_obj_9pywrapfst_F
   __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, 4404, __pyx_L1_error)
+  __PYX_ERR(0, 4420, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":4403
+  /* "pywrapfst.pyx":4419
  *   """
  * 
  *   def __init__(self):             # <<<<<<<<<<<<<<
@@ -44725,7 +44800,7 @@ static int __pyx_pf_9pywrapfst_9FarWriter___init__(struct __pyx_obj_9pywrapfst_F
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4407
+/* "pywrapfst.pyx":4423
  *         "Cannot construct {}".format(self.__class__.__name__))
  * 
  *   def __repr__(self):             # <<<<<<<<<<<<<<
@@ -44758,7 +44833,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarWriter_2__repr__(struct __pyx_obj_9pywr
   PyObject *__pyx_t_7 = NULL;
   __Pyx_RefNannySetupContext("__repr__", 0);
 
-  /* "pywrapfst.pyx":4408
+  /* "pywrapfst.pyx":4424
  * 
  *   def __repr__(self):
  *     return "<{} FarWriter at 0x{:x}>".format(self.far_type(), id(self))             # <<<<<<<<<<<<<<
@@ -44766,20 +44841,20 @@ static PyObject *__pyx_pf_9pywrapfst_9FarWriter_2__repr__(struct __pyx_obj_9pywr
  *   @classmethod
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_FarWriter_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4408, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_FarWriter_at_0x_x, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4424, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "far_type");
-    __PYX_ERR(0, 4408, __pyx_L1_error)
+    __PYX_ERR(0, 4424, __pyx_L1_error)
   }
-  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_FarWriter *)__pyx_v_self->__pyx_vtab)->far_type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4408, __pyx_L1_error)
+  __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(((struct __pyx_vtabstruct_9pywrapfst_FarWriter *)__pyx_v_self->__pyx_vtab)->far_type(__pyx_v_self, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4424, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4408, __pyx_L1_error)
+  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4424, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
   PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self));
-  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4408, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4424, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_t_4 = NULL;
@@ -44797,7 +44872,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarWriter_2__repr__(struct __pyx_obj_9pywr
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4408, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4424, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -44807,7 +44882,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarWriter_2__repr__(struct __pyx_obj_9pywr
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4408, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4424, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -44815,7 +44890,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarWriter_2__repr__(struct __pyx_obj_9pywr
   } else
   #endif
   {
-    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4408, __pyx_L1_error)
+    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4424, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     if (__pyx_t_4) {
       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
@@ -44826,7 +44901,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarWriter_2__repr__(struct __pyx_obj_9pywr
     PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
     __pyx_t_3 = 0;
     __pyx_t_5 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4408, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4424, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   }
@@ -44835,7 +44910,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarWriter_2__repr__(struct __pyx_obj_9pywr
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":4407
+  /* "pywrapfst.pyx":4423
  *         "Cannot construct {}".format(self.__class__.__name__))
  * 
  *   def __repr__(self):             # <<<<<<<<<<<<<<
@@ -44859,7 +44934,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarWriter_2__repr__(struct __pyx_obj_9pywr
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4411
+/* "pywrapfst.pyx":4427
  * 
  *   @classmethod
  *   def create(cls, filename, arc_type=b"standard", far_type=b"default"):             # <<<<<<<<<<<<<<
@@ -44909,7 +44984,7 @@ static PyObject *__pyx_pw_9pywrapfst_9FarWriter_5create(PyObject *__pyx_v_cls, P
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(0, 4411, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(0, 4427, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -44926,7 +45001,7 @@ static PyObject *__pyx_pw_9pywrapfst_9FarWriter_5create(PyObject *__pyx_v_cls, P
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("create", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4411, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("create", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4427, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("pywrapfst.FarWriter.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -44956,27 +45031,27 @@ static PyObject *__pyx_pf_9pywrapfst_9FarWriter_4create(CYTHON_UNUSED PyTypeObje
   PyObject *__pyx_t_9 = NULL;
   __Pyx_RefNannySetupContext("create", 0);
 
-  /* "pywrapfst.pyx":4432
+  /* "pywrapfst.pyx":4448
  *       FstIOError: Read failed.
  *     """
  *     cdef fst.FarType ft = fst.GetFarType(tostring(far_type))             # <<<<<<<<<<<<<<
  *     cdef fst.FarWriterClass *tfar = fst.FarWriterClass.Create(
  *         tostring(filename), tostring(arc_type), ft)
  */
-  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_far_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4432, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_far_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4448, __pyx_L1_error)
   __pyx_v_ft = fst::script::GetFarType(__pyx_t_1);
 
-  /* "pywrapfst.pyx":4434
+  /* "pywrapfst.pyx":4450
  *     cdef fst.FarType ft = fst.GetFarType(tostring(far_type))
  *     cdef fst.FarWriterClass *tfar = fst.FarWriterClass.Create(
  *         tostring(filename), tostring(arc_type), ft)             # <<<<<<<<<<<<<<
  *     if tfar == NULL:
  *       raise FstIOError("Open failed: {!r}".format(filename))
  */
-  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4434, __pyx_L1_error)
-  __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4434, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_filename, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4450, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4450, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":4433
+  /* "pywrapfst.pyx":4449
  *     """
  *     cdef fst.FarType ft = fst.GetFarType(tostring(far_type))
  *     cdef fst.FarWriterClass *tfar = fst.FarWriterClass.Create(             # <<<<<<<<<<<<<<
@@ -44985,7 +45060,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarWriter_4create(CYTHON_UNUSED PyTypeObje
  */
   __pyx_v_tfar = fst::script::FarWriterClass::Create(__pyx_t_1, __pyx_t_2, __pyx_v_ft);
 
-  /* "pywrapfst.pyx":4435
+  /* "pywrapfst.pyx":4451
  *     cdef fst.FarWriterClass *tfar = fst.FarWriterClass.Create(
  *         tostring(filename), tostring(arc_type), ft)
  *     if tfar == NULL:             # <<<<<<<<<<<<<<
@@ -44995,16 +45070,16 @@ static PyObject *__pyx_pf_9pywrapfst_9FarWriter_4create(CYTHON_UNUSED PyTypeObje
   __pyx_t_3 = ((__pyx_v_tfar == NULL) != 0);
   if (__pyx_t_3) {
 
-    /* "pywrapfst.pyx":4436
+    /* "pywrapfst.pyx":4452
  *         tostring(filename), tostring(arc_type), ft)
  *     if tfar == NULL:
  *       raise FstIOError("Open failed: {!r}".format(filename))             # <<<<<<<<<<<<<<
  *     cdef FarWriter result = FarWriter.__new__(FarWriter)
  *     result._writer.reset(tfar)
  */
-    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4436, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstIOError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4452, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Open_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4436, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Open_failed_r, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4452, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     __pyx_t_8 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
@@ -45017,13 +45092,13 @@ static PyObject *__pyx_pf_9pywrapfst_9FarWriter_4create(CYTHON_UNUSED PyTypeObje
       }
     }
     if (!__pyx_t_8) {
-      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_filename); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4436, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_filename); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4452, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
     } else {
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_7)) {
         PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_filename};
-        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4436, __pyx_L1_error)
+        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4452, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
         __Pyx_GOTREF(__pyx_t_6);
       } else
@@ -45031,19 +45106,19 @@ static PyObject *__pyx_pf_9pywrapfst_9FarWriter_4create(CYTHON_UNUSED PyTypeObje
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
         PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_filename};
-        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4436, __pyx_L1_error)
+        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4452, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
         __Pyx_GOTREF(__pyx_t_6);
       } else
       #endif
       {
-        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4436, __pyx_L1_error)
+        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4452, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_9);
         __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
         __Pyx_INCREF(__pyx_v_filename);
         __Pyx_GIVEREF(__pyx_v_filename);
         PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_filename);
-        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4436, __pyx_L1_error)
+        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4452, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
       }
@@ -45060,14 +45135,14 @@ static PyObject *__pyx_pf_9pywrapfst_9FarWriter_4create(CYTHON_UNUSED PyTypeObje
       }
     }
     if (!__pyx_t_7) {
-      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4436, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4452, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       __Pyx_GOTREF(__pyx_t_4);
     } else {
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_5)) {
         PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
-        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4436, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4452, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
@@ -45076,20 +45151,20 @@ static PyObject *__pyx_pf_9pywrapfst_9FarWriter_4create(CYTHON_UNUSED PyTypeObje
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
         PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
-        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4436, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4452, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       } else
       #endif
       {
-        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4436, __pyx_L1_error)
+        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4452, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_9);
         __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
         __Pyx_GIVEREF(__pyx_t_6);
         PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
         __pyx_t_6 = 0;
-        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4436, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4452, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
       }
@@ -45097,9 +45172,9 @@ static PyObject *__pyx_pf_9pywrapfst_9FarWriter_4create(CYTHON_UNUSED PyTypeObje
     __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, 4436, __pyx_L1_error)
+    __PYX_ERR(0, 4452, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":4435
+    /* "pywrapfst.pyx":4451
  *     cdef fst.FarWriterClass *tfar = fst.FarWriterClass.Create(
  *         tostring(filename), tostring(arc_type), ft)
  *     if tfar == NULL:             # <<<<<<<<<<<<<<
@@ -45108,20 +45183,20 @@ static PyObject *__pyx_pf_9pywrapfst_9FarWriter_4create(CYTHON_UNUSED PyTypeObje
  */
   }
 
-  /* "pywrapfst.pyx":4437
+  /* "pywrapfst.pyx":4453
  *     if tfar == NULL:
  *       raise FstIOError("Open failed: {!r}".format(filename))
  *     cdef FarWriter result = FarWriter.__new__(FarWriter)             # <<<<<<<<<<<<<<
  *     result._writer.reset(tfar)
  *     return result
  */
-  __pyx_t_4 = __pyx_tp_new_9pywrapfst_FarWriter(((PyTypeObject *)__pyx_ptype_9pywrapfst_FarWriter), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4437, __pyx_L1_error)
+  __pyx_t_4 = __pyx_tp_new_9pywrapfst_FarWriter(((PyTypeObject *)__pyx_ptype_9pywrapfst_FarWriter), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4453, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  if (!(likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_9pywrapfst_FarWriter)))) __PYX_ERR(0, 4437, __pyx_L1_error)
+  if (!(likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_9pywrapfst_FarWriter)))) __PYX_ERR(0, 4453, __pyx_L1_error)
   __pyx_v_result = ((struct __pyx_obj_9pywrapfst_FarWriter *)__pyx_t_4);
   __pyx_t_4 = 0;
 
-  /* "pywrapfst.pyx":4438
+  /* "pywrapfst.pyx":4454
  *       raise FstIOError("Open failed: {!r}".format(filename))
  *     cdef FarWriter result = FarWriter.__new__(FarWriter)
  *     result._writer.reset(tfar)             # <<<<<<<<<<<<<<
@@ -45130,11 +45205,11 @@ static PyObject *__pyx_pf_9pywrapfst_9FarWriter_4create(CYTHON_UNUSED PyTypeObje
  */
   if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_writer");
-    __PYX_ERR(0, 4438, __pyx_L1_error)
+    __PYX_ERR(0, 4454, __pyx_L1_error)
   }
   __pyx_v_result->_writer.reset(__pyx_v_tfar);
 
-  /* "pywrapfst.pyx":4439
+  /* "pywrapfst.pyx":4455
  *     cdef FarWriter result = FarWriter.__new__(FarWriter)
  *     result._writer.reset(tfar)
  *     return result             # <<<<<<<<<<<<<<
@@ -45146,7 +45221,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarWriter_4create(CYTHON_UNUSED PyTypeObje
   __pyx_r = ((PyObject *)__pyx_v_result);
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":4411
+  /* "pywrapfst.pyx":4427
  * 
  *   @classmethod
  *   def create(cls, filename, arc_type=b"standard", far_type=b"default"):             # <<<<<<<<<<<<<<
@@ -45171,7 +45246,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarWriter_4create(CYTHON_UNUSED PyTypeObje
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4443
+/* "pywrapfst.pyx":4459
  *   # NB: Invoking this method is DANGEROUS: calling any other method on the
  *   # instance after this is invoked may result in a null dereference.
  *   cdef void _close(self):             # <<<<<<<<<<<<<<
@@ -45183,7 +45258,7 @@ static void __pyx_f_9pywrapfst_9FarWriter__close(struct __pyx_obj_9pywrapfst_Far
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_close", 0);
 
-  /* "pywrapfst.pyx":4444
+  /* "pywrapfst.pyx":4460
  *   # instance after this is invoked may result in a null dereference.
  *   cdef void _close(self):
  *     self._writer.reset()             # <<<<<<<<<<<<<<
@@ -45192,11 +45267,11 @@ static void __pyx_f_9pywrapfst_9FarWriter__close(struct __pyx_obj_9pywrapfst_Far
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_writer");
-    __PYX_ERR(0, 4444, __pyx_L1_error)
+    __PYX_ERR(0, 4460, __pyx_L1_error)
   }
   __pyx_v_self->_writer.reset();
 
-  /* "pywrapfst.pyx":4443
+  /* "pywrapfst.pyx":4459
  *   # NB: Invoking this method is DANGEROUS: calling any other method on the
  *   # instance after this is invoked may result in a null dereference.
  *   cdef void _close(self):             # <<<<<<<<<<<<<<
@@ -45212,7 +45287,7 @@ static void __pyx_f_9pywrapfst_9FarWriter__close(struct __pyx_obj_9pywrapfst_Far
   __Pyx_RefNannyFinishContext();
 }
 
-/* "pywrapfst.pyx":4446
+/* "pywrapfst.pyx":4462
  *     self._writer.reset()
  * 
  *   cpdef void add(self, key, _Fst ifst) except *:             # <<<<<<<<<<<<<<
@@ -45236,7 +45311,7 @@ static void __pyx_f_9pywrapfst_9FarWriter_add(struct __pyx_obj_9pywrapfst_FarWri
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4446, __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, 4462, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_9FarWriter_7add)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -45255,7 +45330,7 @@ static void __pyx_f_9pywrapfst_9FarWriter_add(struct __pyx_obj_9pywrapfst_FarWri
       #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, 4446, __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, 4462, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
         __Pyx_GOTREF(__pyx_t_2);
       } else
@@ -45263,13 +45338,13 @@ static void __pyx_f_9pywrapfst_9FarWriter_add(struct __pyx_obj_9pywrapfst_FarWri
       #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, 4446, __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, 4462, __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, 4446, __pyx_L1_error)
+        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4462, __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;
@@ -45280,7 +45355,7 @@ static void __pyx_f_9pywrapfst_9FarWriter_add(struct __pyx_obj_9pywrapfst_FarWri
         __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, 4446, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4462, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_2);
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       }
@@ -45292,7 +45367,7 @@ static void __pyx_f_9pywrapfst_9FarWriter_add(struct __pyx_obj_9pywrapfst_FarWri
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":4468
+  /* "pywrapfst.pyx":4484
  *     # 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)):             # <<<<<<<<<<<<<<
@@ -45301,33 +45376,33 @@ static void __pyx_f_9pywrapfst_9FarWriter_add(struct __pyx_obj_9pywrapfst_FarWri
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_writer");
-    __PYX_ERR(0, 4468, __pyx_L1_error)
+    __PYX_ERR(0, 4484, __pyx_L1_error)
   }
-  __pyx_t_7 = __pyx_f_9pywrapfst_tostring(__pyx_v_key, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4468, __pyx_L1_error)
+  __pyx_t_7 = __pyx_f_9pywrapfst_tostring(__pyx_v_key, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4484, __pyx_L1_error)
   if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_fst");
-    __PYX_ERR(0, 4468, __pyx_L1_error)
+    __PYX_ERR(0, 4484, __pyx_L1_error)
   }
   __pyx_t_8 = ((!(__pyx_v_self->_writer.get()->Add(__pyx_t_7, (*__pyx_v_ifst->_fst)) != 0)) != 0);
   if (__pyx_t_8) {
 
-    /* "pywrapfst.pyx":4469
+    /* "pywrapfst.pyx":4485
  *     # used by the FAR was initialized to use.
  *     if not self._writer.get().Add(tostring(key), deref(ifst._fst)):
  *       raise FstOpError("Incompatible or invalid arc type")             # <<<<<<<<<<<<<<
  *     # An error here usually indicates a key out of order.
  *     if self._writer.get().Error():
  */
-    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4469, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstOpError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4485, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4469, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4485, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(0, 4469, __pyx_L1_error)
+    __PYX_ERR(0, 4485, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":4468
+    /* "pywrapfst.pyx":4484
  *     # 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)):             # <<<<<<<<<<<<<<
@@ -45336,7 +45411,7 @@ static void __pyx_f_9pywrapfst_9FarWriter_add(struct __pyx_obj_9pywrapfst_FarWri
  */
   }
 
-  /* "pywrapfst.pyx":4471
+  /* "pywrapfst.pyx":4487
  *       raise FstOpError("Incompatible or invalid arc type")
  *     # An error here usually indicates a key out of order.
  *     if self._writer.get().Error():             # <<<<<<<<<<<<<<
@@ -45345,28 +45420,28 @@ static void __pyx_f_9pywrapfst_9FarWriter_add(struct __pyx_obj_9pywrapfst_FarWri
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_writer");
-    __PYX_ERR(0, 4471, __pyx_L1_error)
+    __PYX_ERR(0, 4487, __pyx_L1_error)
   }
   __pyx_t_8 = (__pyx_v_self->_writer.get()->Error() != 0);
   if (__pyx_t_8) {
 
-    /* "pywrapfst.pyx":4472
+    /* "pywrapfst.pyx":4488
  *     # An error here usually indicates a key out of order.
  *     if self._writer.get().Error():
  *       raise FstArgError("Key out of order")             # <<<<<<<<<<<<<<
  * 
  *   cpdef string arc_type(self):
  */
-    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4472, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_FstArgError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4488, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4472, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4488, __pyx_L1_error)
     __Pyx_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, 4472, __pyx_L1_error)
+    __PYX_ERR(0, 4488, __pyx_L1_error)
 
-    /* "pywrapfst.pyx":4471
+    /* "pywrapfst.pyx":4487
  *       raise FstOpError("Incompatible or invalid arc type")
  *     # An error here usually indicates a key out of order.
  *     if self._writer.get().Error():             # <<<<<<<<<<<<<<
@@ -45375,7 +45450,7 @@ static void __pyx_f_9pywrapfst_9FarWriter_add(struct __pyx_obj_9pywrapfst_FarWri
  */
   }
 
-  /* "pywrapfst.pyx":4446
+  /* "pywrapfst.pyx":4462
  *     self._writer.reset()
  * 
  *   cpdef void add(self, key, _Fst ifst) except *:             # <<<<<<<<<<<<<<
@@ -45425,11 +45500,11 @@ static PyObject *__pyx_pw_9pywrapfst_9FarWriter_7add(PyObject *__pyx_v_self, PyO
         case  1:
         if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ifst)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("add", 1, 2, 2, 1); __PYX_ERR(0, 4446, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("add", 1, 2, 2, 1); __PYX_ERR(0, 4462, __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, 4446, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add") < 0)) __PYX_ERR(0, 4462, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -45442,13 +45517,13 @@ static PyObject *__pyx_pw_9pywrapfst_9FarWriter_7add(PyObject *__pyx_v_self, PyO
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("add", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4446, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("add", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 4462, __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, 4446, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_ptype_9pywrapfst__Fst, 1, "ifst", 0))) __PYX_ERR(0, 4462, __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 */
@@ -45466,8 +45541,8 @@ static PyObject *__pyx_pf_9pywrapfst_9FarWriter_6add(struct __pyx_obj_9pywrapfst
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("add", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_f_9pywrapfst_9FarWriter_add(__pyx_v_self, __pyx_v_key, __pyx_v_ifst, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4446, __pyx_L1_error)
-  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4446, __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, 4462, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4462, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -45484,7 +45559,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarWriter_6add(struct __pyx_obj_9pywrapfst
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4474
+/* "pywrapfst.pyx":4490
  *       raise FstArgError("Key out of order")
  * 
  *   cpdef string arc_type(self):             # <<<<<<<<<<<<<<
@@ -45506,7 +45581,7 @@ static std::string __pyx_f_9pywrapfst_9FarWriter_arc_type(struct __pyx_obj_9pywr
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4474, __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, 4490, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_9FarWriter_9arc_type)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -45521,14 +45596,14 @@ static std::string __pyx_f_9pywrapfst_9FarWriter_arc_type(struct __pyx_obj_9pywr
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4474, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4490, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4474, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4490, __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, 4474, __pyx_L1_error)
+      __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4490, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __pyx_r = __pyx_t_5;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -45537,7 +45612,7 @@ static std::string __pyx_f_9pywrapfst_9FarWriter_arc_type(struct __pyx_obj_9pywr
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":4475
+  /* "pywrapfst.pyx":4491
  * 
  *   cpdef string arc_type(self):
  *     return self._writer.get().ArcType()             # <<<<<<<<<<<<<<
@@ -45546,12 +45621,12 @@ static std::string __pyx_f_9pywrapfst_9FarWriter_arc_type(struct __pyx_obj_9pywr
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_writer");
-    __PYX_ERR(0, 4475, __pyx_L1_error)
+    __PYX_ERR(0, 4491, __pyx_L1_error)
   }
   __pyx_r = __pyx_v_self->_writer.get()->ArcType();
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":4474
+  /* "pywrapfst.pyx":4490
  *       raise FstArgError("Key out of order")
  * 
  *   cpdef string arc_type(self):             # <<<<<<<<<<<<<<
@@ -45590,7 +45665,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarWriter_8arc_type(struct __pyx_obj_9pywr
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("arc_type", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarWriter_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4474, __pyx_L1_error)
+  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarWriter_arc_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4490, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -45607,7 +45682,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarWriter_8arc_type(struct __pyx_obj_9pywr
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4477
+/* "pywrapfst.pyx":4493
  *     return self._writer.get().ArcType()
  * 
  *   cpdef bool error(self):             # <<<<<<<<<<<<<<
@@ -45629,7 +45704,7 @@ static bool __pyx_f_9pywrapfst_9FarWriter_error(struct __pyx_obj_9pywrapfst_FarW
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4477, __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, 4493, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_9FarWriter_11error)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -45644,14 +45719,14 @@ static bool __pyx_f_9pywrapfst_9FarWriter_error(struct __pyx_obj_9pywrapfst_FarW
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4477, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4493, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4477, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4493, __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, 4477, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4493, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __pyx_r = __pyx_t_5;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -45660,7 +45735,7 @@ static bool __pyx_f_9pywrapfst_9FarWriter_error(struct __pyx_obj_9pywrapfst_FarW
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":4486
+  /* "pywrapfst.pyx":4502
  *       True if the FarWriter is in an errorful state, False otherwise.
  *     """
  *     return self._writer.get().Error()             # <<<<<<<<<<<<<<
@@ -45669,12 +45744,12 @@ static bool __pyx_f_9pywrapfst_9FarWriter_error(struct __pyx_obj_9pywrapfst_FarW
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_writer");
-    __PYX_ERR(0, 4486, __pyx_L1_error)
+    __PYX_ERR(0, 4502, __pyx_L1_error)
   }
   __pyx_r = __pyx_v_self->_writer.get()->Error();
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":4477
+  /* "pywrapfst.pyx":4493
  *     return self._writer.get().ArcType()
  * 
  *   cpdef bool error(self):             # <<<<<<<<<<<<<<
@@ -45715,7 +45790,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarWriter_10error(struct __pyx_obj_9pywrap
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("error", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_9pywrapfst_9FarWriter_error(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4477, __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, 4493, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -45732,7 +45807,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarWriter_10error(struct __pyx_obj_9pywrap
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4488
+/* "pywrapfst.pyx":4504
  *     return self._writer.get().Error()
  * 
  *   cpdef string far_type(self):             # <<<<<<<<<<<<<<
@@ -45754,7 +45829,7 @@ static std::string __pyx_f_9pywrapfst_9FarWriter_far_type(struct __pyx_obj_9pywr
   if (unlikely(__pyx_skip_dispatch)) ;
   /* Check if overridden in Python */
   else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_far_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4488, __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, 4504, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_9pywrapfst_9FarWriter_13far_type)) {
       __Pyx_INCREF(__pyx_t_1);
@@ -45769,14 +45844,14 @@ static std::string __pyx_f_9pywrapfst_9FarWriter_far_type(struct __pyx_obj_9pywr
         }
       }
       if (__pyx_t_4) {
-        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4488, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4504, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
-        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4488, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4504, __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, 4488, __pyx_L1_error)
+      __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4504, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __pyx_r = __pyx_t_5;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -45785,7 +45860,7 @@ static std::string __pyx_f_9pywrapfst_9FarWriter_far_type(struct __pyx_obj_9pywr
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   }
 
-  /* "pywrapfst.pyx":4489
+  /* "pywrapfst.pyx":4505
  * 
  *   cpdef string far_type(self):
  *     return fst.GetFarTypeString(self._writer.get().Type())             # <<<<<<<<<<<<<<
@@ -45794,12 +45869,12 @@ static std::string __pyx_f_9pywrapfst_9FarWriter_far_type(struct __pyx_obj_9pywr
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "_writer");
-    __PYX_ERR(0, 4489, __pyx_L1_error)
+    __PYX_ERR(0, 4505, __pyx_L1_error)
   }
   __pyx_r = fst::GetFarTypeString(__pyx_v_self->_writer.get()->Type());
   goto __pyx_L0;
 
-  /* "pywrapfst.pyx":4488
+  /* "pywrapfst.pyx":4504
  *     return self._writer.get().Error()
  * 
  *   cpdef string far_type(self):             # <<<<<<<<<<<<<<
@@ -45838,7 +45913,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarWriter_12far_type(struct __pyx_obj_9pyw
   PyObject *__pyx_t_1 = NULL;
   __Pyx_RefNannySetupContext("far_type", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarWriter_far_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4488, __pyx_L1_error)
+  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_f_9pywrapfst_9FarWriter_far_type(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4504, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -45855,7 +45930,7 @@ static PyObject *__pyx_pf_9pywrapfst_9FarWriter_12far_type(struct __pyx_obj_9pyw
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4492
+/* "pywrapfst.pyx":4508
  * 
  *   # Dictionary-like assignment.
  *   def __setitem__(self, key, _Fst fst):             # <<<<<<<<<<<<<<
@@ -45869,7 +45944,7 @@ static int __pyx_pw_9pywrapfst_9FarWriter_15__setitem__(PyObject *__pyx_v_self,
   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, 4492, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fst), __pyx_ptype_9pywrapfst__Fst, 1, "fst", 0))) __PYX_ERR(0, 4508, __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 */
@@ -45886,7 +45961,7 @@ static int __pyx_pf_9pywrapfst_9FarWriter_14__setitem__(struct __pyx_obj_9pywrap
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__setitem__", 0);
 
-  /* "pywrapfst.pyx":4493
+  /* "pywrapfst.pyx":4509
  *   # Dictionary-like assignment.
  *   def __setitem__(self, key, _Fst fst):
  *     self.add(key, fst)             # <<<<<<<<<<<<<<
@@ -45895,11 +45970,11 @@ static int __pyx_pf_9pywrapfst_9FarWriter_14__setitem__(struct __pyx_obj_9pywrap
  */
   if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "add");
-    __PYX_ERR(0, 4493, __pyx_L1_error)
+    __PYX_ERR(0, 4509, __pyx_L1_error)
   }
-  ((struct __pyx_vtabstruct_9pywrapfst_FarWriter *)__pyx_v_self->__pyx_vtab)->add(__pyx_v_self, __pyx_v_key, __pyx_v_fst, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4493, __pyx_L1_error)
+  ((struct __pyx_vtabstruct_9pywrapfst_FarWriter *)__pyx_v_self->__pyx_vtab)->add(__pyx_v_self, __pyx_v_key, __pyx_v_fst, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4509, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":4492
+  /* "pywrapfst.pyx":4508
  * 
  *   # Dictionary-like assignment.
  *   def __setitem__(self, key, _Fst fst):             # <<<<<<<<<<<<<<
@@ -45918,7 +45993,7 @@ static int __pyx_pf_9pywrapfst_9FarWriter_14__setitem__(struct __pyx_obj_9pywrap
   return __pyx_r;
 }
 
-/* "pywrapfst.pyx":4508
+/* "pywrapfst.pyx":4524
  * 
  * @atexit.register
  * def _reset_fst_error_fatal():             # <<<<<<<<<<<<<<
@@ -45947,19 +46022,19 @@ static PyObject *__pyx_pf_9pywrapfst_56_reset_fst_error_fatal(CYTHON_UNUSED PyOb
   bool __pyx_t_2;
   __Pyx_RefNannySetupContext("_reset_fst_error_fatal", 0);
 
-  /* "pywrapfst.pyx":4509
+  /* "pywrapfst.pyx":4525
  * @atexit.register
  * def _reset_fst_error_fatal():
  *   fst.FLAGS_fst_error_fatal = _fst_error_fatal_old             # <<<<<<<<<<<<<<
  * 
  */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_fst_error_fatal_old); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4509, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_fst_error_fatal_old); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4525, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4509, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4525, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   FLAGS_fst_error_fatal = __pyx_t_2;
 
-  /* "pywrapfst.pyx":4508
+  /* "pywrapfst.pyx":4524
  * 
  * @atexit.register
  * def _reset_fst_error_fatal():             # <<<<<<<<<<<<<<
@@ -48540,6 +48615,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_n_s_I_LABEL_INVARIANT_PROPERTIES, __pyx_k_I_LABEL_INVARIANT_PROPERTIES, sizeof(__pyx_k_I_LABEL_INVARIANT_PROPERTIES), 0, 0, 1, 1},
   {&__pyx_n_s_I_LABEL_SORTED, __pyx_k_I_LABEL_SORTED, sizeof(__pyx_k_I_LABEL_SORTED), 0, 0, 1, 1},
   {&__pyx_kp_s_Incompatible_or_invalid_arc_type, __pyx_k_Incompatible_or_invalid_arc_type, sizeof(__pyx_k_Incompatible_or_invalid_arc_type), 0, 0, 1, 0},
+  {&__pyx_kp_s_Incompatible_or_invalid_weight, __pyx_k_Incompatible_or_invalid_weight, sizeof(__pyx_k_Incompatible_or_invalid_weight), 0, 0, 1, 0},
   {&__pyx_kp_s_Incompatible_or_invalid_weight_t, __pyx_k_Incompatible_or_invalid_weight_t, sizeof(__pyx_k_Incompatible_or_invalid_weight_t), 0, 0, 1, 0},
   {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
   {&__pyx_kp_s_Invalid_operator_r, __pyx_k_Invalid_operator_r, sizeof(__pyx_k_Invalid_operator_r), 0, 0, 1, 0},
@@ -48660,12 +48736,14 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__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_fst_error_fatal_old, __pyx_k_fst_error_fatal_old, sizeof(__pyx_k_fst_error_fatal_old), 0, 0, 1, 1},
   {&__pyx_n_s_fst_string, __pyx_k_fst_string, sizeof(__pyx_k_fst_string), 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_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},
@@ -48678,7 +48756,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__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_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
-  {&__pyx_kp_s_incompatible_or_invalid_weight, __pyx_k_incompatible_or_invalid_weight, sizeof(__pyx_k_incompatible_or_invalid_weight), 0, 0, 1, 0},
   {&__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_s_input_symbols, __pyx_k_input_symbols, sizeof(__pyx_k_input_symbols), 0, 0, 1, 1},
@@ -48800,6 +48877,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__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_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_b_unspecified, __pyx_k_unspecified, sizeof(__pyx_k_unspecified), 0, 0, 0, 0},
   {&__pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_k_usr_local_google_home_kbg_scrat, sizeof(__pyx_k_usr_local_google_home_kbg_scrat), 0, 0, 1, 0},
   {&__pyx_n_s_utf8, __pyx_k_utf8, sizeof(__pyx_k_utf8), 0, 0, 1, 1},
@@ -48822,8 +48901,8 @@ static int __Pyx_InitCachedBuiltins(void) {
   __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 131, __pyx_L1_error)
   __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 136, __pyx_L1_error)
   __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 141, __pyx_L1_error)
-  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 2651, __pyx_L1_error)
-  __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 2671, __pyx_L1_error)
+  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 2667, __pyx_L1_error)
+  __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 2687, __pyx_L1_error)
   __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 366, __pyx_L1_error)
   __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 430, __pyx_L1_error)
   __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 722, __pyx_L1_error)
@@ -48848,267 +48927,267 @@ static int __Pyx_InitCachedConstants(void) {
   __Pyx_GOTREF(__pyx_tuple__2);
   __Pyx_GIVEREF(__pyx_tuple__2);
 
-  /* "pywrapfst.pyx":1542
+  /* "pywrapfst.pyx":1545
  *     cdef size_t result = self._fst.get().NumArcs(state)
  *     if result == SIZE_MAX:
  *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
  *     return result
  * 
  */
-  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 1542, __pyx_L1_error)
+  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 1545, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__3);
   __Pyx_GIVEREF(__pyx_tuple__3);
 
-  /* "pywrapfst.pyx":1564
+  /* "pywrapfst.pyx":1567
  *     cdef size_t result = self._fst.get().NumInputEpsilons(state)
  *     if result == SIZE_MAX:
  *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
  *     return result
  * 
  */
-  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 1564, __pyx_L1_error)
+  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 1567, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__4);
   __Pyx_GIVEREF(__pyx_tuple__4);
 
-  /* "pywrapfst.pyx":1586
+  /* "pywrapfst.pyx":1589
  *     cdef size_t result = self._fst.get().NumOutputEpsilons(state)
  *     if result == SIZE_MAX:
  *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
  *     return result
  * 
  */
-  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 1586, __pyx_L1_error)
+  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 1589, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__5);
   __Pyx_GIVEREF(__pyx_tuple__5);
 
-  /* "pywrapfst.pyx":1727
+  /* "pywrapfst.pyx":1730
  *     """
  *     if self._fst.get().Properties(fst.kError, True) == fst.kError:
  *       raise FstOpError("Operation failed")             # <<<<<<<<<<<<<<
  * 
  *   cdef void _add_arc(self, int64 state, Arc arc) except *:
  */
-  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Operation_failed); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 1727, __pyx_L1_error)
+  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Operation_failed); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 1730, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__6);
   __Pyx_GIVEREF(__pyx_tuple__6);
 
-  /* "pywrapfst.pyx":1731
+  /* "pywrapfst.pyx":1734
  *   cdef void _add_arc(self, int64 state, Arc arc) except *:
  *     if not self._fst.get().ValidStateId(state):
  *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
  *     if not self._mfst.get().AddArc(state, deref(arc._arc)):
  *       raise FstOpError("Incompatible or invalid weight type")
  */
-  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 1731, __pyx_L1_error)
+  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 1734, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__7);
   __Pyx_GIVEREF(__pyx_tuple__7);
 
-  /* "pywrapfst.pyx":1733
+  /* "pywrapfst.pyx":1736
  *       raise FstIndexError("State index out of range")
  *     if not self._mfst.get().AddArc(state, deref(arc._arc)):
  *       raise FstOpError("Incompatible or invalid weight type")             # <<<<<<<<<<<<<<
  *     self._check_mutating_imethod()
  * 
  */
-  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Incompatible_or_invalid_weight_t); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 1733, __pyx_L1_error)
+  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Incompatible_or_invalid_weight_t); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 1736, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__8);
   __Pyx_GIVEREF(__pyx_tuple__8);
 
-  /* "pywrapfst.pyx":1898
+  /* "pywrapfst.pyx":1901
  *     if not (self._mfst.get().DeleteArcs(state, n) if n else
  *             self._mfst.get().DeleteArcs(state)):
  *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
  *     self._check_mutating_imethod()
  * 
  */
-  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 1898, __pyx_L1_error)
+  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 1901, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__9);
   __Pyx_GIVEREF(__pyx_tuple__9);
 
-  /* "pywrapfst.pyx":1928
+  /* "pywrapfst.pyx":1931
  *     if states:
  *       if not self._mfst.get().DeleteStates(<const vector[int64]> states):
  *         raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
  *     else:
  *       self._mfst.get().DeleteStates()
  */
-  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 1928, __pyx_L1_error)
+  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 1931, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__10);
   __Pyx_GIVEREF(__pyx_tuple__10);
 
-  /* "pywrapfst.pyx":2183
+  /* "pywrapfst.pyx":2186
  *         _opairs.get().push_back(fst.LabelPair(before, after))
  *     if _ipairs.get().empty() and _opairs.get().empty():
  *       raise FstArgError("No relabeling pairs specified.")             # <<<<<<<<<<<<<<
  *     fst.Relabel(self._mfst.get(), deref(_ipairs), deref(_opairs))
  *     self._check_mutating_imethod()
  */
-  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_No_relabeling_pairs_specified); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 2183, __pyx_L1_error)
+  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_No_relabeling_pairs_specified); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 2186, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__19);
   __Pyx_GIVEREF(__pyx_tuple__19);
 
-  /* "pywrapfst.pyx":2220
+  /* "pywrapfst.pyx":2225
  *                             bool attach_new_osymbols=True) except *:
  *     if new_isymbols is None and new_osymbols is None:
  *       raise FstArgError("No new SymbolTables specified")             # <<<<<<<<<<<<<<
  *     cdef fst.SymbolTable *new_isymbols_ptr = NULL
  *     if new_isymbols is not None:
  */
-  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_No_new_SymbolTables_specified); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 2220, __pyx_L1_error)
+  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_No_new_SymbolTables_specified); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 2225, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__20);
   __Pyx_GIVEREF(__pyx_tuple__20);
 
-  /* "pywrapfst.pyx":2277
+  /* "pywrapfst.pyx":2293
  *   cdef void _reserve_arcs(self, int64 state, size_t n) except *:
  *     if not self._mfst.get().ReserveArcs(state, n):
  *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
  *     self._check_mutating_imethod()
  * 
  */
-  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 2277, __pyx_L1_error)
+  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 2293, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__21);
   __Pyx_GIVEREF(__pyx_tuple__21);
 
-  /* "pywrapfst.pyx":2400
+  /* "pywrapfst.pyx":2416
  *   cdef void _set_final(self, int64 state, weight=None) except *:
  *     if not self._mfst.get().ValidStateId(state):
  *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
  *     cdef fst.WeightClass wc = _get_WeightClass_or_One(self.weight_type(),
  *                                                       weight)
  */
-  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 2400, __pyx_L1_error)
+  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 2416, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__26);
   __Pyx_GIVEREF(__pyx_tuple__26);
 
-  /* "pywrapfst.pyx":2404
+  /* "pywrapfst.pyx":2420
  *                                                       weight)
  *     if not self._mfst.get().SetFinal(state, wc):
- *       raise FstOpError("incompatible or invalid weight")             # <<<<<<<<<<<<<<
+ *       raise FstOpError("Incompatible or invalid weight")             # <<<<<<<<<<<<<<
  *     self._check_mutating_imethod()
  * 
  */
-  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_incompatible_or_invalid_weight); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 2404, __pyx_L1_error)
+  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Incompatible_or_invalid_weight); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 2420, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__27);
   __Pyx_GIVEREF(__pyx_tuple__27);
 
-  /* "pywrapfst.pyx":2449
+  /* "pywrapfst.pyx":2465
  *   cdef void _set_start(self, int64 state) except *:
  *     if not self._mfst.get().SetStart(state):
  *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
  *     self._check_mutating_imethod()
  * 
  */
-  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 2449, __pyx_L1_error)
+  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 2465, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__28);
   __Pyx_GIVEREF(__pyx_tuple__28);
 
-  /* "pywrapfst.pyx":2527
+  /* "pywrapfst.pyx":2543
  *     # TopSort returns False if the FST is cyclic, and thus can't be TopSorted.
  *     if not fst.TopSort(self._mfst.get()):
  *       logging.warning("Cannot topsort cyclic FST.")             # <<<<<<<<<<<<<<
  *     self._check_mutating_imethod()
  * 
  */
-  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Cannot_topsort_cyclic_FST); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 2527, __pyx_L1_error)
+  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Cannot_topsort_cyclic_FST); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 2543, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__29);
   __Pyx_GIVEREF(__pyx_tuple__29);
 
-  /* "pywrapfst.pyx":2596
+  /* "pywrapfst.pyx":2612
  * cdef _Fst _init_Fst(FstClass_ptr tfst):
  *   if tfst.Properties(fst.kError, True):
  *     raise FstOpError("Operation failed")             # <<<<<<<<<<<<<<
  *   cdef _Fst ofst = _Fst.__new__(_Fst)
  *   ofst._fst.reset(<FstClass_ptr> tfst)
  */
-  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Operation_failed); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 2596, __pyx_L1_error)
+  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Operation_failed); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 2612, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__30);
   __Pyx_GIVEREF(__pyx_tuple__30);
 
-  /* "pywrapfst.pyx":2604
+  /* "pywrapfst.pyx":2620
  * cdef _MutableFst _init_MutableFst(MutableFstClass_ptr tfst):
  *   if tfst.Properties(fst.kError, True):
  *     raise FstOpError("Operation failed")             # <<<<<<<<<<<<<<
  *   cdef _MutableFst ofst = _MutableFst.__new__(_MutableFst)
  *   ofst._fst.reset(<MutableFstClass_ptr> tfst)
  */
-  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Operation_failed); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 2604, __pyx_L1_error)
+  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Operation_failed); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 2620, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__31);
   __Pyx_GIVEREF(__pyx_tuple__31);
 
-  /* "pywrapfst.pyx":2862
+  /* "pywrapfst.pyx":2878
  *   def __init__(self, _Fst ifst, int64 state):
  *     if not ifst._fst.get().ValidStateId(state):
  *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
  *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
  *     self._fst = ifst._fst
  */
-  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 2862, __pyx_L1_error)
+  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 2878, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__32);
   __Pyx_GIVEREF(__pyx_tuple__32);
 
-  /* "pywrapfst.pyx":3000
+  /* "pywrapfst.pyx":3016
  *   def __init__(self, _MutableFst ifst, int64 state):
  *     if not ifst._fst.get().ValidStateId(state):
  *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
  *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
  *     self._mfst = ifst._mfst
  */
-  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 3000, __pyx_L1_error)
+  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_State_index_out_of_range); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 3016, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__33);
   __Pyx_GIVEREF(__pyx_tuple__33);
 
-  /* "pywrapfst.pyx":3542
+  /* "pywrapfst.pyx":3558
  *                                     addr(error))
  *   if error:
  *     raise FstOpError("Equivalence test encountered error")             # <<<<<<<<<<<<<<
  *   return result
  * 
  */
-  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_Equivalence_test_encountered_err); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 3542, __pyx_L1_error)
+  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_Equivalence_test_encountered_err); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 3558, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__42);
   __Pyx_GIVEREF(__pyx_tuple__42);
 
-  /* "pywrapfst.pyx":3737
+  /* "pywrapfst.pyx":3753
  *                                         addr(error))
  *   if error:
  *     raise FstOpError("Random equivalence test encountered error")             # <<<<<<<<<<<<<<
  *   return result
  * 
  */
-  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_Random_equivalence_test_encounte); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 3737, __pyx_L1_error)
+  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_Random_equivalence_test_encounte); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 3753, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__49);
   __Pyx_GIVEREF(__pyx_tuple__49);
 
-  /* "pywrapfst.pyx":4184
+  /* "pywrapfst.pyx":4200
  *     self._sstrm.reset(new stringstream())
  *     if tfst == NULL:
  *       raise FstOpError("Compilation failed")             # <<<<<<<<<<<<<<
  *     return _init_XFst(tfst)
  * 
  */
-  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_Compilation_failed); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 4184, __pyx_L1_error)
+  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_Compilation_failed); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 4200, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__61);
   __Pyx_GIVEREF(__pyx_tuple__61);
 
-  /* "pywrapfst.pyx":4469
+  /* "pywrapfst.pyx":4485
  *     # used by the FAR was initialized to use.
  *     if not self._writer.get().Add(tostring(key), deref(ifst._fst)):
  *       raise FstOpError("Incompatible or invalid arc type")             # <<<<<<<<<<<<<<
  *     # An error here usually indicates a key out of order.
  *     if self._writer.get().Error():
  */
-  __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_Incompatible_or_invalid_arc_type); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 4469, __pyx_L1_error)
+  __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_Incompatible_or_invalid_arc_type); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 4485, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__62);
   __Pyx_GIVEREF(__pyx_tuple__62);
 
-  /* "pywrapfst.pyx":4472
+  /* "pywrapfst.pyx":4488
  *     # An error here usually indicates a key out of order.
  *     if self._writer.get().Error():
  *       raise FstArgError("Key out of order")             # <<<<<<<<<<<<<<
  * 
  *   cpdef string arc_type(self):
  */
-  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_Key_out_of_order); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 4472, __pyx_L1_error)
+  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_Key_out_of_order); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 4488, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__63);
   __Pyx_GIVEREF(__pyx_tuple__63);
 
@@ -49160,71 +49239,71 @@ static int __Pyx_InitCachedConstants(void) {
   __Pyx_GIVEREF(__pyx_tuple__70);
   __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_power, 543, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 543, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":2668
+  /* "pywrapfst.pyx":2684
  *    """
  * 
  *    def __new__(cls, arc_type=b"standard"):             # <<<<<<<<<<<<<<
  *     return _create_Fst(arc_type)
  * 
  */
-  __pyx_tuple__72 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_arc_type); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 2668, __pyx_L1_error)
+  __pyx_tuple__72 = PyTuple_Pack(2, __pyx_n_s_cls, __pyx_n_s_arc_type); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 2684, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__72);
   __Pyx_GIVEREF(__pyx_tuple__72);
-  __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_new, 2668, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 2668, __pyx_L1_error)
-  __pyx_tuple__74 = PyTuple_Pack(1, ((PyObject*)__pyx_n_b_standard)); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 2668, __pyx_L1_error)
+  __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_new, 2684, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 2684, __pyx_L1_error)
+  __pyx_tuple__74 = PyTuple_Pack(1, ((PyObject*)__pyx_n_b_standard)); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 2684, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__74);
   __Pyx_GIVEREF(__pyx_tuple__74);
 
-  /* "pywrapfst.pyx":2672
+  /* "pywrapfst.pyx":2688
  * 
  *    @staticmethod
  *    def read(filename, fst_type=None):             # <<<<<<<<<<<<<<
  *      """
  *      read(filename, fst_type=None)
  */
-  __pyx_tuple__75 = PyTuple_Pack(2, __pyx_n_s_filename, __pyx_n_s_fst_type); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 2672, __pyx_L1_error)
+  __pyx_tuple__75 = PyTuple_Pack(2, __pyx_n_s_filename, __pyx_n_s_fst_type); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 2688, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__75);
   __Pyx_GIVEREF(__pyx_tuple__75);
-  __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_read, 2672, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 2672, __pyx_L1_error)
-  __pyx_tuple__77 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 2672, __pyx_L1_error)
+  __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_read, 2688, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 2688, __pyx_L1_error)
+  __pyx_tuple__77 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 2688, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__77);
   __Pyx_GIVEREF(__pyx_tuple__77);
 
-  /* "pywrapfst.pyx":2693
+  /* "pywrapfst.pyx":2709
  * 
  *    @staticmethod
  *    def read_from_string(fst_string, fst_type=None):             # <<<<<<<<<<<<<<
  *      """
  *      read_from_string(fst_string, fst_type=None)
  */
-  __pyx_tuple__78 = PyTuple_Pack(2, __pyx_n_s_fst_string, __pyx_n_s_fst_type); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 2693, __pyx_L1_error)
+  __pyx_tuple__78 = PyTuple_Pack(2, __pyx_n_s_fst_string, __pyx_n_s_fst_type); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 2709, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__78);
   __Pyx_GIVEREF(__pyx_tuple__78);
-  __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_read_from_string, 2693, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 2693, __pyx_L1_error)
-  __pyx_tuple__80 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 2693, __pyx_L1_error)
+  __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_read_from_string, 2709, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 2709, __pyx_L1_error)
+  __pyx_tuple__80 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 2709, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__80);
   __Pyx_GIVEREF(__pyx_tuple__80);
 
-  /* "pywrapfst.pyx":3936
+  /* "pywrapfst.pyx":3952
  * 
  * 
  * def shortestdistance(_Fst ifst,             # <<<<<<<<<<<<<<
  *                      float delta=fst.kDelta,
  *                      int64 nstate=fst.kNoStateId,
  */
-  __pyx_tuple__81 = PyTuple_Pack(9, __pyx_n_s_ifst, __pyx_n_s_delta, __pyx_n_s_nstate, __pyx_n_s_qt, __pyx_n_s_reverse, __pyx_n_s_distance, __pyx_n_s_weight_type, __pyx_n_s_result, __pyx_n_s_it); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 3936, __pyx_L1_error)
+  __pyx_tuple__81 = PyTuple_Pack(9, __pyx_n_s_ifst, __pyx_n_s_delta, __pyx_n_s_nstate, __pyx_n_s_qt, __pyx_n_s_reverse, __pyx_n_s_distance, __pyx_n_s_weight_type, __pyx_n_s_result, __pyx_n_s_it); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 3952, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__81);
   __Pyx_GIVEREF(__pyx_tuple__81);
-  __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(5, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_shortestdistance, 3936, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 3936, __pyx_L1_error)
+  __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(5, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_shortestdistance, 3952, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 3952, __pyx_L1_error)
 
-  /* "pywrapfst.pyx":4508
+  /* "pywrapfst.pyx":4524
  * 
  * @atexit.register
  * def _reset_fst_error_fatal():             # <<<<<<<<<<<<<<
  *   fst.FLAGS_fst_error_fatal = _fst_error_fatal_old
  * 
  */
-  __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_reset_fst_error_fatal, 4508, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 4508, __pyx_L1_error)
+  __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_usr_local_google_home_kbg_scrat, __pyx_n_s_reset_fst_error_fatal, 4524, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 4524, __pyx_L1_error)
   __Pyx_RefNannyFinishContext();
   return 0;
   __pyx_L1_error:;
@@ -49543,17 +49622,17 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
   __pyx_vtable_9pywrapfst__MutableFst._topsort = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *))__pyx_f_9pywrapfst_11_MutableFst__topsort;
   __pyx_vtable_9pywrapfst__MutableFst._union = (void (*)(struct __pyx_obj_9pywrapfst__MutableFst *, struct __pyx_obj_9pywrapfst__Fst *))__pyx_f_9pywrapfst_11_MutableFst__union;
   __pyx_type_9pywrapfst__MutableFst.tp_base = __pyx_ptype_9pywrapfst__Fst;
-  if (PyType_Ready(&__pyx_type_9pywrapfst__MutableFst) < 0) __PYX_ERR(0, 1711, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_9pywrapfst__MutableFst) < 0) __PYX_ERR(0, 1714, __pyx_L1_error)
   __pyx_type_9pywrapfst__MutableFst.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_9pywrapfst__MutableFst.tp_dict, __pyx_vtabptr_9pywrapfst__MutableFst) < 0) __PYX_ERR(0, 1711, __pyx_L1_error)
-  if (PyObject_SetAttrString(__pyx_m, "_MutableFst", (PyObject *)&__pyx_type_9pywrapfst__MutableFst) < 0) __PYX_ERR(0, 1711, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_9pywrapfst__MutableFst.tp_dict, __pyx_vtabptr_9pywrapfst__MutableFst) < 0) __PYX_ERR(0, 1714, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "_MutableFst", (PyObject *)&__pyx_type_9pywrapfst__MutableFst) < 0) __PYX_ERR(0, 1714, __pyx_L1_error)
   __pyx_ptype_9pywrapfst__MutableFst = &__pyx_type_9pywrapfst__MutableFst;
   __pyx_vtabptr_9pywrapfst_Arc = &__pyx_vtable_9pywrapfst_Arc;
   __pyx_vtable_9pywrapfst_Arc.copy = (struct __pyx_obj_9pywrapfst_Arc *(*)(struct __pyx_obj_9pywrapfst_Arc *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_3Arc_copy;
-  if (PyType_Ready(&__pyx_type_9pywrapfst_Arc) < 0) __PYX_ERR(0, 2779, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_9pywrapfst_Arc) < 0) __PYX_ERR(0, 2795, __pyx_L1_error)
   __pyx_type_9pywrapfst_Arc.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_9pywrapfst_Arc.tp_dict, __pyx_vtabptr_9pywrapfst_Arc) < 0) __PYX_ERR(0, 2779, __pyx_L1_error)
-  if (PyObject_SetAttrString(__pyx_m, "Arc", (PyObject *)&__pyx_type_9pywrapfst_Arc) < 0) __PYX_ERR(0, 2779, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_9pywrapfst_Arc.tp_dict, __pyx_vtabptr_9pywrapfst_Arc) < 0) __PYX_ERR(0, 2795, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "Arc", (PyObject *)&__pyx_type_9pywrapfst_Arc) < 0) __PYX_ERR(0, 2795, __pyx_L1_error)
   __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;
@@ -49564,10 +49643,10 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
   __pyx_vtable_9pywrapfst_ArcIterator.seek = (void (*)(struct __pyx_obj_9pywrapfst_ArcIterator *, size_t, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_11ArcIterator_seek;
   __pyx_vtable_9pywrapfst_ArcIterator.set_flags = (void (*)(struct __pyx_obj_9pywrapfst_ArcIterator *, __pyx_t_10basictypes_uint32, __pyx_t_10basictypes_uint32, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_11ArcIterator_set_flags;
   __pyx_vtable_9pywrapfst_ArcIterator.value = (PyObject *(*)(struct __pyx_obj_9pywrapfst_ArcIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_11ArcIterator_value;
-  if (PyType_Ready(&__pyx_type_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 2847, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 2863, __pyx_L1_error)
   __pyx_type_9pywrapfst_ArcIterator.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_9pywrapfst_ArcIterator.tp_dict, __pyx_vtabptr_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 2847, __pyx_L1_error)
-  if (PyObject_SetAttrString(__pyx_m, "ArcIterator", (PyObject *)&__pyx_type_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 2847, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_9pywrapfst_ArcIterator.tp_dict, __pyx_vtabptr_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 2863, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "ArcIterator", (PyObject *)&__pyx_type_9pywrapfst_ArcIterator) < 0) __PYX_ERR(0, 2863, __pyx_L1_error)
   __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;
@@ -49579,28 +49658,28 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
   __pyx_vtable_9pywrapfst_MutableArcIterator.set_flags = (void (*)(struct __pyx_obj_9pywrapfst_MutableArcIterator *, __pyx_t_10basictypes_uint32, __pyx_t_10basictypes_uint32, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_18MutableArcIterator_set_flags;
   __pyx_vtable_9pywrapfst_MutableArcIterator.set_value = (void (*)(struct __pyx_obj_9pywrapfst_MutableArcIterator *, struct __pyx_obj_9pywrapfst_Arc *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_18MutableArcIterator_set_value;
   __pyx_vtable_9pywrapfst_MutableArcIterator.value = (PyObject *(*)(struct __pyx_obj_9pywrapfst_MutableArcIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_18MutableArcIterator_value;
-  if (PyType_Ready(&__pyx_type_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 2984, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3000, __pyx_L1_error)
   __pyx_type_9pywrapfst_MutableArcIterator.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_9pywrapfst_MutableArcIterator.tp_dict, __pyx_vtabptr_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 2984, __pyx_L1_error)
-  if (PyObject_SetAttrString(__pyx_m, "MutableArcIterator", (PyObject *)&__pyx_type_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 2984, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_9pywrapfst_MutableArcIterator.tp_dict, __pyx_vtabptr_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3000, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "MutableArcIterator", (PyObject *)&__pyx_type_9pywrapfst_MutableArcIterator) < 0) __PYX_ERR(0, 3000, __pyx_L1_error)
   __pyx_ptype_9pywrapfst_MutableArcIterator = &__pyx_type_9pywrapfst_MutableArcIterator;
   __pyx_vtabptr_9pywrapfst_StateIterator = &__pyx_vtable_9pywrapfst_StateIterator;
   __pyx_vtable_9pywrapfst_StateIterator.done = (bool (*)(struct __pyx_obj_9pywrapfst_StateIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_13StateIterator_done;
   __pyx_vtable_9pywrapfst_StateIterator.next = (void (*)(struct __pyx_obj_9pywrapfst_StateIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_13StateIterator_next;
   __pyx_vtable_9pywrapfst_StateIterator.reset = (void (*)(struct __pyx_obj_9pywrapfst_StateIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_13StateIterator_reset;
   __pyx_vtable_9pywrapfst_StateIterator.value = (__pyx_t_10basictypes_int64 (*)(struct __pyx_obj_9pywrapfst_StateIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_13StateIterator_value;
-  if (PyType_Ready(&__pyx_type_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3136, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3152, __pyx_L1_error)
   __pyx_type_9pywrapfst_StateIterator.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_9pywrapfst_StateIterator.tp_dict, __pyx_vtabptr_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3136, __pyx_L1_error)
-  if (PyObject_SetAttrString(__pyx_m, "StateIterator", (PyObject *)&__pyx_type_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3136, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_9pywrapfst_StateIterator.tp_dict, __pyx_vtabptr_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3152, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "StateIterator", (PyObject *)&__pyx_type_9pywrapfst_StateIterator) < 0) __PYX_ERR(0, 3152, __pyx_L1_error)
   __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, 4083, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4099, __pyx_L1_error)
   __pyx_type_9pywrapfst_Compiler.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_9pywrapfst_Compiler.tp_dict, __pyx_vtabptr_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4083, __pyx_L1_error)
-  if (PyObject_SetAttrString(__pyx_m, "Compiler", (PyObject *)&__pyx_type_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4083, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_9pywrapfst_Compiler.tp_dict, __pyx_vtabptr_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4099, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "Compiler", (PyObject *)&__pyx_type_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4099, __pyx_L1_error)
   __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;
@@ -49612,10 +49691,10 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
   __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, 4209, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4225, __pyx_L1_error)
   __pyx_type_9pywrapfst_FarReader.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_9pywrapfst_FarReader.tp_dict, __pyx_vtabptr_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4209, __pyx_L1_error)
-  if (PyObject_SetAttrString(__pyx_m, "FarReader", (PyObject *)&__pyx_type_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4209, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_9pywrapfst_FarReader.tp_dict, __pyx_vtabptr_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4225, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "FarReader", (PyObject *)&__pyx_type_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4225, __pyx_L1_error)
   __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;
@@ -49623,10 +49702,10 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
   __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, 4383, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4399, __pyx_L1_error)
   __pyx_type_9pywrapfst_FarWriter.tp_print = 0;
-  if (__Pyx_SetVtable(__pyx_type_9pywrapfst_FarWriter.tp_dict, __pyx_vtabptr_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4383, __pyx_L1_error)
-  if (PyObject_SetAttrString(__pyx_m, "FarWriter", (PyObject *)&__pyx_type_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4383, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_9pywrapfst_FarWriter.tp_dict, __pyx_vtabptr_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4399, __pyx_L1_error)
+  if (PyObject_SetAttrString(__pyx_m, "FarWriter", (PyObject *)&__pyx_type_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 4399, __pyx_L1_error)
   __pyx_ptype_9pywrapfst_FarWriter = &__pyx_type_9pywrapfst_FarWriter;
   /*--- Type import code ---*/
   /*--- Variable import code ---*/
@@ -50103,7 +50182,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_9pywrapfst_SymbolTable);
 
-  /* "pywrapfst.pyx":2001
+  /* "pywrapfst.pyx":2004
  *     return self
  * 
  *   cdef void _minimize(self, float delta=fst.kDelta,             # <<<<<<<<<<<<<<
@@ -50112,7 +50191,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__11 = fst::kDelta;
 
-  /* "pywrapfst.pyx":2007
+  /* "pywrapfst.pyx":2010
  *     self._check_mutating_imethod()
  * 
  *   def minimize(self, float delta=fst.kDelta, bool allow_nondet=False):             # <<<<<<<<<<<<<<
@@ -50121,7 +50200,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__12 = fst::kDelta;
 
-  /* "pywrapfst.pyx":2093
+  /* "pywrapfst.pyx":2096
  *     return self
  * 
  *   cdef void _prune(self, float delta=fst.kDelta, int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
@@ -50131,7 +50210,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
   __pyx_k__13 = fst::kDelta;
   __pyx_k__14 = fst::kNoStateId;
 
-  /* "pywrapfst.pyx":2102
+  /* "pywrapfst.pyx":2105
  * 
  *   def prune(self,
  *             float delta=fst.kDelta,             # <<<<<<<<<<<<<<
@@ -50140,7 +50219,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__15 = fst::kDelta;
 
-  /* "pywrapfst.pyx":2103
+  /* "pywrapfst.pyx":2106
  *   def prune(self,
  *             float delta=fst.kDelta,
  *             int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
@@ -50149,7 +50228,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__16 = fst::kNoStateId;
 
-  /* "pywrapfst.pyx":2130
+  /* "pywrapfst.pyx":2133
  * 
  *   cdef void _push(self,
  *                   float delta=fst.kDelta,             # <<<<<<<<<<<<<<
@@ -50158,7 +50237,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__17 = fst::kDelta;
 
-  /* "pywrapfst.pyx":2138
+  /* "pywrapfst.pyx":2141
  * 
  *   def push(self,
  *            float delta=fst.kDelta,             # <<<<<<<<<<<<<<
@@ -50167,7 +50246,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__18 = fst::kDelta;
 
-  /* "pywrapfst.pyx":2360
+  /* "pywrapfst.pyx":2376
  *   cdef void _rmepsilon(self,
  *                        bool connect=True,
  *                        float delta=fst.kDelta,             # <<<<<<<<<<<<<<
@@ -50176,7 +50255,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__22 = fst::kDelta;
 
-  /* "pywrapfst.pyx":2361
+  /* "pywrapfst.pyx":2377
  *                        bool connect=True,
  *                        float delta=fst.kDelta,
  *                        int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
@@ -50185,7 +50264,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__23 = fst::kNoStateId;
 
-  /* "pywrapfst.pyx":2371
+  /* "pywrapfst.pyx":2387
  *   def rmepsilon(self,
  *                 bool connect=True,
  *                 float delta=fst.kDelta,             # <<<<<<<<<<<<<<
@@ -50194,7 +50273,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__24 = fst::kDelta;
 
-  /* "pywrapfst.pyx":2372
+  /* "pywrapfst.pyx":2388
  *                 bool connect=True,
  *                 float delta=fst.kDelta,
  *                 int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
@@ -50203,806 +50282,806 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__25 = fst::kNoStateId;
 
-  /* "pywrapfst.pyx":2651
+  /* "pywrapfst.pyx":2667
  *   return _init_XFst(ofst)
  * 
  * class Fst(object):             # <<<<<<<<<<<<<<
  * 
  *    """
  */
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2651, __pyx_L1_error)
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2667, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_INCREF(__pyx_builtin_object);
   __Pyx_GIVEREF(__pyx_builtin_object);
   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_object);
-  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2651, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2667, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Fst, __pyx_n_s_Fst, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, __pyx_kp_s_Fst_arc_type_standard_Construct); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2651, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Fst, __pyx_n_s_Fst, (PyObject *) NULL, __pyx_n_s_pywrapfst_2, __pyx_kp_s_Fst_arc_type_standard_Construct); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2667, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
 
-  /* "pywrapfst.pyx":2668
+  /* "pywrapfst.pyx":2684
  *    """
  * 
  *    def __new__(cls, arc_type=b"standard"):             # <<<<<<<<<<<<<<
  *     return _create_Fst(arc_type)
  * 
  */
-  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9pywrapfst_3Fst_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Fst___new, NULL, __pyx_n_s_pywrapfst_2, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2668, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9pywrapfst_3Fst_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Fst___new, NULL, __pyx_n_s_pywrapfst_2, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2684, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__74);
-  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_new, __pyx_t_4) < 0) __PYX_ERR(0, 2668, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_new, __pyx_t_4) < 0) __PYX_ERR(0, 2684, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-  /* "pywrapfst.pyx":2672
+  /* "pywrapfst.pyx":2688
  * 
  *    @staticmethod
  *    def read(filename, fst_type=None):             # <<<<<<<<<<<<<<
  *      """
  *      read(filename, fst_type=None)
  */
-  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9pywrapfst_3Fst_3read, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Fst_read, NULL, __pyx_n_s_pywrapfst_2, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2672, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9pywrapfst_3Fst_3read, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Fst_read, NULL, __pyx_n_s_pywrapfst_2, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2688, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__77);
 
-  /* "pywrapfst.pyx":2671
+  /* "pywrapfst.pyx":2687
  *     return _create_Fst(arc_type)
  * 
  *    @staticmethod             # <<<<<<<<<<<<<<
  *    def read(filename, fst_type=None):
  *      """
  */
-  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2671, __pyx_L1_error)
+  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2687, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_GIVEREF(__pyx_t_4);
   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
   __pyx_t_4 = 0;
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_staticmethod, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2671, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_staticmethod, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2687, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_read, __pyx_t_4) < 0) __PYX_ERR(0, 2672, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_read, __pyx_t_4) < 0) __PYX_ERR(0, 2688, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-  /* "pywrapfst.pyx":2693
+  /* "pywrapfst.pyx":2709
  * 
  *    @staticmethod
  *    def read_from_string(fst_string, fst_type=None):             # <<<<<<<<<<<<<<
  *      """
  *      read_from_string(fst_string, fst_type=None)
  */
-  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9pywrapfst_3Fst_5read_from_string, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Fst_read_from_string, NULL, __pyx_n_s_pywrapfst_2, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2693, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9pywrapfst_3Fst_5read_from_string, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Fst_read_from_string, NULL, __pyx_n_s_pywrapfst_2, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2709, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__80);
 
-  /* "pywrapfst.pyx":2692
+  /* "pywrapfst.pyx":2708
  *      return _read_Fst(filename, fst_type)
  * 
  *    @staticmethod             # <<<<<<<<<<<<<<
  *    def read_from_string(fst_string, fst_type=None):
  *      """
  */
-  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2692, __pyx_L1_error)
+  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2708, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_GIVEREF(__pyx_t_4);
   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
   __pyx_t_4 = 0;
-  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_staticmethod, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2692, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_staticmethod, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2708, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_read_from_string, __pyx_t_4) < 0) __PYX_ERR(0, 2693, __pyx_L1_error)
+  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_read_from_string, __pyx_t_4) < 0) __PYX_ERR(0, 2709, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-  /* "pywrapfst.pyx":2651
+  /* "pywrapfst.pyx":2667
  *   return _init_XFst(ofst)
  * 
  * class Fst(object):             # <<<<<<<<<<<<<<
  * 
  *    """
  */
-  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Fst, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2651, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Fst, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2667, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Fst, __pyx_t_4) < 0) __PYX_ERR(0, 2651, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Fst, __pyx_t_4) < 0) __PYX_ERR(0, 2667, __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":2716
+  /* "pywrapfst.pyx":2732
  * 
  * 
  * EXPANDED = fst.kExpanded             # <<<<<<<<<<<<<<
  * MUTABLE = fst.kMutable
  * ERROR = fst.kError
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kExpanded); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2716, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kExpanded); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2732, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXPANDED, __pyx_t_2) < 0) __PYX_ERR(0, 2716, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXPANDED, __pyx_t_2) < 0) __PYX_ERR(0, 2732, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2717
+  /* "pywrapfst.pyx":2733
  * 
  * EXPANDED = fst.kExpanded
  * MUTABLE = fst.kMutable             # <<<<<<<<<<<<<<
  * ERROR = fst.kError
  * ACCEPTOR = fst.kAcceptor
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kMutable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2717, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kMutable); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2733, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MUTABLE, __pyx_t_2) < 0) __PYX_ERR(0, 2717, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MUTABLE, __pyx_t_2) < 0) __PYX_ERR(0, 2733, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2718
+  /* "pywrapfst.pyx":2734
  * EXPANDED = fst.kExpanded
  * MUTABLE = fst.kMutable
  * ERROR = fst.kError             # <<<<<<<<<<<<<<
  * ACCEPTOR = fst.kAcceptor
  * NOT_ACCEPTOR = fst.kNotAcceptor
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2718, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2734, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR, __pyx_t_2) < 0) __PYX_ERR(0, 2718, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR, __pyx_t_2) < 0) __PYX_ERR(0, 2734, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2719
+  /* "pywrapfst.pyx":2735
  * MUTABLE = fst.kMutable
  * ERROR = fst.kError
  * ACCEPTOR = fst.kAcceptor             # <<<<<<<<<<<<<<
  * NOT_ACCEPTOR = fst.kNotAcceptor
  * I_DETERMINISTIC = fst.kIDeterministic
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kAcceptor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2719, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kAcceptor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2735, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACCEPTOR, __pyx_t_2) < 0) __PYX_ERR(0, 2719, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACCEPTOR, __pyx_t_2) < 0) __PYX_ERR(0, 2735, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2720
+  /* "pywrapfst.pyx":2736
  * ERROR = fst.kError
  * ACCEPTOR = fst.kAcceptor
  * NOT_ACCEPTOR = fst.kNotAcceptor             # <<<<<<<<<<<<<<
  * I_DETERMINISTIC = fst.kIDeterministic
  * NON_I_DETERMINISTIC = fst.kNonIDeterministic
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotAcceptor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2720, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotAcceptor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2736, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_ACCEPTOR, __pyx_t_2) < 0) __PYX_ERR(0, 2720, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_ACCEPTOR, __pyx_t_2) < 0) __PYX_ERR(0, 2736, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2721
+  /* "pywrapfst.pyx":2737
  * ACCEPTOR = fst.kAcceptor
  * NOT_ACCEPTOR = fst.kNotAcceptor
  * I_DETERMINISTIC = fst.kIDeterministic             # <<<<<<<<<<<<<<
  * NON_I_DETERMINISTIC = fst.kNonIDeterministic
  * O_DETERMINISTIC = fst.kODeterministic
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kIDeterministic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2721, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kIDeterministic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2737, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_DETERMINISTIC, __pyx_t_2) < 0) __PYX_ERR(0, 2721, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_DETERMINISTIC, __pyx_t_2) < 0) __PYX_ERR(0, 2737, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2722
+  /* "pywrapfst.pyx":2738
  * NOT_ACCEPTOR = fst.kNotAcceptor
  * I_DETERMINISTIC = fst.kIDeterministic
  * NON_I_DETERMINISTIC = fst.kNonIDeterministic             # <<<<<<<<<<<<<<
  * O_DETERMINISTIC = fst.kODeterministic
  * NON_O_DETERMINISTIC = fst.kNonODeterministic
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNonIDeterministic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2722, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNonIDeterministic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2738, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NON_I_DETERMINISTIC, __pyx_t_2) < 0) __PYX_ERR(0, 2722, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NON_I_DETERMINISTIC, __pyx_t_2) < 0) __PYX_ERR(0, 2738, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2723
+  /* "pywrapfst.pyx":2739
  * I_DETERMINISTIC = fst.kIDeterministic
  * NON_I_DETERMINISTIC = fst.kNonIDeterministic
  * O_DETERMINISTIC = fst.kODeterministic             # <<<<<<<<<<<<<<
  * NON_O_DETERMINISTIC = fst.kNonODeterministic
  * EPSILONS = fst.kEpsilons
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kODeterministic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2723, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kODeterministic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2739, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_DETERMINISTIC, __pyx_t_2) < 0) __PYX_ERR(0, 2723, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_DETERMINISTIC, __pyx_t_2) < 0) __PYX_ERR(0, 2739, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2724
+  /* "pywrapfst.pyx":2740
  * NON_I_DETERMINISTIC = fst.kNonIDeterministic
  * O_DETERMINISTIC = fst.kODeterministic
  * NON_O_DETERMINISTIC = fst.kNonODeterministic             # <<<<<<<<<<<<<<
  * EPSILONS = fst.kEpsilons
  * NO_EPSILONS = fst.kNoEpsilons
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNonODeterministic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2724, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNonODeterministic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2740, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NON_O_DETERMINISTIC, __pyx_t_2) < 0) __PYX_ERR(0, 2724, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NON_O_DETERMINISTIC, __pyx_t_2) < 0) __PYX_ERR(0, 2740, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2725
+  /* "pywrapfst.pyx":2741
  * O_DETERMINISTIC = fst.kODeterministic
  * NON_O_DETERMINISTIC = fst.kNonODeterministic
  * EPSILONS = fst.kEpsilons             # <<<<<<<<<<<<<<
  * NO_EPSILONS = fst.kNoEpsilons
  * I_EPSILONS = fst.kIEpsilons
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2725, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2741, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2725, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2741, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2726
+  /* "pywrapfst.pyx":2742
  * NON_O_DETERMINISTIC = fst.kNonODeterministic
  * EPSILONS = fst.kEpsilons
  * NO_EPSILONS = fst.kNoEpsilons             # <<<<<<<<<<<<<<
  * I_EPSILONS = fst.kIEpsilons
  * NO_I_EPSILONS = fst.kNoIEpsilons
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNoEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2726, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNoEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2742, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2726, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2742, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2727
+  /* "pywrapfst.pyx":2743
  * EPSILONS = fst.kEpsilons
  * NO_EPSILONS = fst.kNoEpsilons
  * I_EPSILONS = fst.kIEpsilons             # <<<<<<<<<<<<<<
  * NO_I_EPSILONS = fst.kNoIEpsilons
  * O_EPSILONS = fst.kOEpsilons
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kIEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2727, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kIEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2743, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2727, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2743, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2728
+  /* "pywrapfst.pyx":2744
  * NO_EPSILONS = fst.kNoEpsilons
  * I_EPSILONS = fst.kIEpsilons
  * NO_I_EPSILONS = fst.kNoIEpsilons             # <<<<<<<<<<<<<<
  * O_EPSILONS = fst.kOEpsilons
  * NO_O_EPSILONS = fst.kNoOEpsilons
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNoIEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2728, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNoIEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2744, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_I_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2728, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_I_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2744, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2729
+  /* "pywrapfst.pyx":2745
  * I_EPSILONS = fst.kIEpsilons
  * NO_I_EPSILONS = fst.kNoIEpsilons
  * O_EPSILONS = fst.kOEpsilons             # <<<<<<<<<<<<<<
  * NO_O_EPSILONS = fst.kNoOEpsilons
  * I_LABEL_SORTED = fst.kILabelSorted
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kOEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2729, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kOEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2745, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2729, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2745, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2730
+  /* "pywrapfst.pyx":2746
  * NO_I_EPSILONS = fst.kNoIEpsilons
  * O_EPSILONS = fst.kOEpsilons
  * NO_O_EPSILONS = fst.kNoOEpsilons             # <<<<<<<<<<<<<<
  * I_LABEL_SORTED = fst.kILabelSorted
  * NOT_I_LABEL_SORTED = fst.kNotILabelSorted
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNoOEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2730, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNoOEpsilons); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2746, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_O_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2730, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NO_O_EPSILONS, __pyx_t_2) < 0) __PYX_ERR(0, 2746, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2731
+  /* "pywrapfst.pyx":2747
  * O_EPSILONS = fst.kOEpsilons
  * NO_O_EPSILONS = fst.kNoOEpsilons
  * I_LABEL_SORTED = fst.kILabelSorted             # <<<<<<<<<<<<<<
  * NOT_I_LABEL_SORTED = fst.kNotILabelSorted
  * O_LABEL_SORTED = fst.kOLabelSorted
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kILabelSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2731, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kILabelSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2747, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_LABEL_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 2731, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_LABEL_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 2747, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2732
+  /* "pywrapfst.pyx":2748
  * NO_O_EPSILONS = fst.kNoOEpsilons
  * I_LABEL_SORTED = fst.kILabelSorted
  * NOT_I_LABEL_SORTED = fst.kNotILabelSorted             # <<<<<<<<<<<<<<
  * O_LABEL_SORTED = fst.kOLabelSorted
  * NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotILabelSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2732, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotILabelSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2748, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_I_LABEL_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 2732, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_I_LABEL_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 2748, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2733
+  /* "pywrapfst.pyx":2749
  * I_LABEL_SORTED = fst.kILabelSorted
  * NOT_I_LABEL_SORTED = fst.kNotILabelSorted
  * O_LABEL_SORTED = fst.kOLabelSorted             # <<<<<<<<<<<<<<
  * NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
  * WEIGHTED = fst.kWeighted
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kOLabelSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2733, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kOLabelSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2749, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_LABEL_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 2733, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_LABEL_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 2749, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2734
+  /* "pywrapfst.pyx":2750
  * NOT_I_LABEL_SORTED = fst.kNotILabelSorted
  * O_LABEL_SORTED = fst.kOLabelSorted
  * NOT_O_LABEL_SORTED = fst.kNotOLabelSorted             # <<<<<<<<<<<<<<
  * WEIGHTED = fst.kWeighted
  * UNWEIGHTED = fst.kUnweighted
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotOLabelSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2734, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotOLabelSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2750, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_O_LABEL_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 2734, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_O_LABEL_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 2750, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2735
+  /* "pywrapfst.pyx":2751
  * O_LABEL_SORTED = fst.kOLabelSorted
  * NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
  * WEIGHTED = fst.kWeighted             # <<<<<<<<<<<<<<
  * UNWEIGHTED = fst.kUnweighted
  * CYCLIC = fst.kCyclic
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kWeighted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2735, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kWeighted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2751, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHTED, __pyx_t_2) < 0) __PYX_ERR(0, 2735, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHTED, __pyx_t_2) < 0) __PYX_ERR(0, 2751, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2736
+  /* "pywrapfst.pyx":2752
  * NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
  * WEIGHTED = fst.kWeighted
  * UNWEIGHTED = fst.kUnweighted             # <<<<<<<<<<<<<<
  * CYCLIC = fst.kCyclic
  * ACYCLIC = fst.kAcyclic
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kUnweighted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2736, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kUnweighted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2752, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNWEIGHTED, __pyx_t_2) < 0) __PYX_ERR(0, 2736, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNWEIGHTED, __pyx_t_2) < 0) __PYX_ERR(0, 2752, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2737
+  /* "pywrapfst.pyx":2753
  * WEIGHTED = fst.kWeighted
  * UNWEIGHTED = fst.kUnweighted
  * CYCLIC = fst.kCyclic             # <<<<<<<<<<<<<<
  * ACYCLIC = fst.kAcyclic
  * INITIAL_CYCLIC = fst.kInitialCyclic
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kCyclic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2737, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kCyclic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2753, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CYCLIC, __pyx_t_2) < 0) __PYX_ERR(0, 2737, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CYCLIC, __pyx_t_2) < 0) __PYX_ERR(0, 2753, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2738
+  /* "pywrapfst.pyx":2754
  * UNWEIGHTED = fst.kUnweighted
  * CYCLIC = fst.kCyclic
  * ACYCLIC = fst.kAcyclic             # <<<<<<<<<<<<<<
  * INITIAL_CYCLIC = fst.kInitialCyclic
  * INITIAL_ACYCLIC = fst.kInitialAcyclic
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kAcyclic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2738, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kAcyclic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2754, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACYCLIC, __pyx_t_2) < 0) __PYX_ERR(0, 2738, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACYCLIC, __pyx_t_2) < 0) __PYX_ERR(0, 2754, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2739
+  /* "pywrapfst.pyx":2755
  * CYCLIC = fst.kCyclic
  * ACYCLIC = fst.kAcyclic
  * INITIAL_CYCLIC = fst.kInitialCyclic             # <<<<<<<<<<<<<<
  * INITIAL_ACYCLIC = fst.kInitialAcyclic
  * TOP_SORTED = fst.kTopSorted
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kInitialCyclic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2739, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kInitialCyclic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2755, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_INITIAL_CYCLIC, __pyx_t_2) < 0) __PYX_ERR(0, 2739, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_INITIAL_CYCLIC, __pyx_t_2) < 0) __PYX_ERR(0, 2755, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2740
+  /* "pywrapfst.pyx":2756
  * ACYCLIC = fst.kAcyclic
  * INITIAL_CYCLIC = fst.kInitialCyclic
  * INITIAL_ACYCLIC = fst.kInitialAcyclic             # <<<<<<<<<<<<<<
  * TOP_SORTED = fst.kTopSorted
  * NOT_TOP_SORTED = fst.kNotTopSorted
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kInitialAcyclic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2740, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kInitialAcyclic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2756, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_INITIAL_ACYCLIC, __pyx_t_2) < 0) __PYX_ERR(0, 2740, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_INITIAL_ACYCLIC, __pyx_t_2) < 0) __PYX_ERR(0, 2756, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2741
+  /* "pywrapfst.pyx":2757
  * INITIAL_CYCLIC = fst.kInitialCyclic
  * INITIAL_ACYCLIC = fst.kInitialAcyclic
  * TOP_SORTED = fst.kTopSorted             # <<<<<<<<<<<<<<
  * NOT_TOP_SORTED = fst.kNotTopSorted
  * ACCESSIBLE = fst.kAccessible
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kTopSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2741, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kTopSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2757, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_TOP_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 2741, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_TOP_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 2757, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2742
+  /* "pywrapfst.pyx":2758
  * INITIAL_ACYCLIC = fst.kInitialAcyclic
  * TOP_SORTED = fst.kTopSorted
  * NOT_TOP_SORTED = fst.kNotTopSorted             # <<<<<<<<<<<<<<
  * ACCESSIBLE = fst.kAccessible
  * NOT_ACCESSIBLE = fst.kNotAccessible
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotTopSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2742, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotTopSorted); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2758, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_TOP_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 2742, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_TOP_SORTED, __pyx_t_2) < 0) __PYX_ERR(0, 2758, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2743
+  /* "pywrapfst.pyx":2759
  * TOP_SORTED = fst.kTopSorted
  * NOT_TOP_SORTED = fst.kNotTopSorted
  * ACCESSIBLE = fst.kAccessible             # <<<<<<<<<<<<<<
  * NOT_ACCESSIBLE = fst.kNotAccessible
  * COACCESSIBLE = fst.kCoAccessible
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kAccessible); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2743, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kAccessible); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2759, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACCESSIBLE, __pyx_t_2) < 0) __PYX_ERR(0, 2743, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ACCESSIBLE, __pyx_t_2) < 0) __PYX_ERR(0, 2759, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2744
+  /* "pywrapfst.pyx":2760
  * NOT_TOP_SORTED = fst.kNotTopSorted
  * ACCESSIBLE = fst.kAccessible
  * NOT_ACCESSIBLE = fst.kNotAccessible             # <<<<<<<<<<<<<<
  * COACCESSIBLE = fst.kCoAccessible
  * NOT_COACCESSIBLE = fst.kNotCoAccessible
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotAccessible); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2744, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotAccessible); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2760, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_ACCESSIBLE, __pyx_t_2) < 0) __PYX_ERR(0, 2744, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_ACCESSIBLE, __pyx_t_2) < 0) __PYX_ERR(0, 2760, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2745
+  /* "pywrapfst.pyx":2761
  * ACCESSIBLE = fst.kAccessible
  * NOT_ACCESSIBLE = fst.kNotAccessible
  * COACCESSIBLE = fst.kCoAccessible             # <<<<<<<<<<<<<<
  * NOT_COACCESSIBLE = fst.kNotCoAccessible
  * STRING = fst.kString
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kCoAccessible); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2745, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kCoAccessible); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2761, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_COACCESSIBLE, __pyx_t_2) < 0) __PYX_ERR(0, 2745, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_COACCESSIBLE, __pyx_t_2) < 0) __PYX_ERR(0, 2761, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2746
+  /* "pywrapfst.pyx":2762
  * NOT_ACCESSIBLE = fst.kNotAccessible
  * COACCESSIBLE = fst.kCoAccessible
  * NOT_COACCESSIBLE = fst.kNotCoAccessible             # <<<<<<<<<<<<<<
  * STRING = fst.kString
  * NOT_STRING = fst.kNotString
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotCoAccessible); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2746, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotCoAccessible); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2762, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_COACCESSIBLE, __pyx_t_2) < 0) __PYX_ERR(0, 2746, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_COACCESSIBLE, __pyx_t_2) < 0) __PYX_ERR(0, 2762, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2747
+  /* "pywrapfst.pyx":2763
  * COACCESSIBLE = fst.kCoAccessible
  * NOT_COACCESSIBLE = fst.kNotCoAccessible
  * STRING = fst.kString             # <<<<<<<<<<<<<<
  * NOT_STRING = fst.kNotString
  * WEIGHTED_CYCLES = fst.kWeightedCycles
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kString); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2747, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kString); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2763, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_STRING, __pyx_t_2) < 0) __PYX_ERR(0, 2747, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_STRING, __pyx_t_2) < 0) __PYX_ERR(0, 2763, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2748
+  /* "pywrapfst.pyx":2764
  * NOT_COACCESSIBLE = fst.kNotCoAccessible
  * STRING = fst.kString
  * NOT_STRING = fst.kNotString             # <<<<<<<<<<<<<<
  * WEIGHTED_CYCLES = fst.kWeightedCycles
  * UNWEIGHTED_CYCLES = fst.kUnweightedCycles
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotString); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2748, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNotString); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2764, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_STRING, __pyx_t_2) < 0) __PYX_ERR(0, 2748, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOT_STRING, __pyx_t_2) < 0) __PYX_ERR(0, 2764, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2749
+  /* "pywrapfst.pyx":2765
  * STRING = fst.kString
  * NOT_STRING = fst.kNotString
  * WEIGHTED_CYCLES = fst.kWeightedCycles             # <<<<<<<<<<<<<<
  * UNWEIGHTED_CYCLES = fst.kUnweightedCycles
  * NULL_PROPERTIES = fst.kNullProperties
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kWeightedCycles); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2749, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kWeightedCycles); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2765, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHTED_CYCLES, __pyx_t_2) < 0) __PYX_ERR(0, 2749, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHTED_CYCLES, __pyx_t_2) < 0) __PYX_ERR(0, 2765, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2750
+  /* "pywrapfst.pyx":2766
  * NOT_STRING = fst.kNotString
  * WEIGHTED_CYCLES = fst.kWeightedCycles
  * UNWEIGHTED_CYCLES = fst.kUnweightedCycles             # <<<<<<<<<<<<<<
  * NULL_PROPERTIES = fst.kNullProperties
  * COPY_PROPERTIES = fst.kCopyProperties
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kUnweightedCycles); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2750, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kUnweightedCycles); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2766, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNWEIGHTED_CYCLES, __pyx_t_2) < 0) __PYX_ERR(0, 2750, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNWEIGHTED_CYCLES, __pyx_t_2) < 0) __PYX_ERR(0, 2766, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2751
+  /* "pywrapfst.pyx":2767
  * WEIGHTED_CYCLES = fst.kWeightedCycles
  * UNWEIGHTED_CYCLES = fst.kUnweightedCycles
  * NULL_PROPERTIES = fst.kNullProperties             # <<<<<<<<<<<<<<
  * COPY_PROPERTIES = fst.kCopyProperties
  * INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNullProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2751, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNullProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2767, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NULL_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2751, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NULL_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2767, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2752
+  /* "pywrapfst.pyx":2768
  * UNWEIGHTED_CYCLES = fst.kUnweightedCycles
  * NULL_PROPERTIES = fst.kNullProperties
  * COPY_PROPERTIES = fst.kCopyProperties             # <<<<<<<<<<<<<<
  * INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
  * EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kCopyProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2752, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kCopyProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2768, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_COPY_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2752, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_COPY_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2768, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2753
+  /* "pywrapfst.pyx":2769
  * NULL_PROPERTIES = fst.kNullProperties
  * COPY_PROPERTIES = fst.kCopyProperties
  * INTRINSIC_PROPERTIES = fst.kIntrinsicProperties             # <<<<<<<<<<<<<<
  * EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
  * SET_START_PROPERTIES = fst.kSetStartProperties
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kIntrinsicProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2753, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kIntrinsicProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2769, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_INTRINSIC_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2753, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_INTRINSIC_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2769, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2754
+  /* "pywrapfst.pyx":2770
  * COPY_PROPERTIES = fst.kCopyProperties
  * INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
  * EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties             # <<<<<<<<<<<<<<
  * SET_START_PROPERTIES = fst.kSetStartProperties
  * SET_FINAL_PROPERTIES = fst.kSetFinalProperties
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kExtrinsicProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2754, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kExtrinsicProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2770, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXTRINSIC_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2754, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EXTRINSIC_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2770, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2755
+  /* "pywrapfst.pyx":2771
  * INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
  * EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
  * SET_START_PROPERTIES = fst.kSetStartProperties             # <<<<<<<<<<<<<<
  * SET_FINAL_PROPERTIES = fst.kSetFinalProperties
  * ADD_STATE_PROPERTIES = fst.kAddStateProperties
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kSetStartProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2755, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kSetStartProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2771, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_START_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2755, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_START_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2771, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2756
+  /* "pywrapfst.pyx":2772
  * EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
  * SET_START_PROPERTIES = fst.kSetStartProperties
  * SET_FINAL_PROPERTIES = fst.kSetFinalProperties             # <<<<<<<<<<<<<<
  * ADD_STATE_PROPERTIES = fst.kAddStateProperties
  * ADD_ARC_PROPERTIES = fst.kAddArcProperties
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kSetFinalProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2756, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kSetFinalProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2772, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_FINAL_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2756, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_FINAL_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2772, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2757
+  /* "pywrapfst.pyx":2773
  * SET_START_PROPERTIES = fst.kSetStartProperties
  * SET_FINAL_PROPERTIES = fst.kSetFinalProperties
  * ADD_STATE_PROPERTIES = fst.kAddStateProperties             # <<<<<<<<<<<<<<
  * ADD_ARC_PROPERTIES = fst.kAddArcProperties
  * SET_ARC_PROPERTIES = fst.kSetArcProperties
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kAddStateProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2757, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kAddStateProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2773, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_STATE_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2757, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_STATE_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2773, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2758
+  /* "pywrapfst.pyx":2774
  * SET_FINAL_PROPERTIES = fst.kSetFinalProperties
  * ADD_STATE_PROPERTIES = fst.kAddStateProperties
  * ADD_ARC_PROPERTIES = fst.kAddArcProperties             # <<<<<<<<<<<<<<
  * SET_ARC_PROPERTIES = fst.kSetArcProperties
  * DELETE_STATE_PROPERTIES = fst.kDeleteStatesProperties
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kAddArcProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2758, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kAddArcProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2774, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_ARC_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2758, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_ARC_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2774, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2759
+  /* "pywrapfst.pyx":2775
  * ADD_STATE_PROPERTIES = fst.kAddStateProperties
  * ADD_ARC_PROPERTIES = fst.kAddArcProperties
  * SET_ARC_PROPERTIES = fst.kSetArcProperties             # <<<<<<<<<<<<<<
  * DELETE_STATE_PROPERTIES = fst.kDeleteStatesProperties
  * DELETE_ARC_PROPERTIES = fst.kDeleteArcsProperties
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kSetArcProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2759, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kSetArcProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2775, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_ARC_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2759, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SET_ARC_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2775, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2760
+  /* "pywrapfst.pyx":2776
  * ADD_ARC_PROPERTIES = fst.kAddArcProperties
  * SET_ARC_PROPERTIES = fst.kSetArcProperties
  * DELETE_STATE_PROPERTIES = fst.kDeleteStatesProperties             # <<<<<<<<<<<<<<
  * DELETE_ARC_PROPERTIES = fst.kDeleteArcsProperties
  * STATE_SORT_PROPERTIES = fst.kStateSortProperties
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kDeleteStatesProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2760, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kDeleteStatesProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2776, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DELETE_STATE_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2760, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DELETE_STATE_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2776, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2761
+  /* "pywrapfst.pyx":2777
  * SET_ARC_PROPERTIES = fst.kSetArcProperties
  * DELETE_STATE_PROPERTIES = fst.kDeleteStatesProperties
  * DELETE_ARC_PROPERTIES = fst.kDeleteArcsProperties             # <<<<<<<<<<<<<<
  * STATE_SORT_PROPERTIES = fst.kStateSortProperties
  * ARC_SORT_PROPERTIES = fst.kArcSortProperties
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kDeleteArcsProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2761, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kDeleteArcsProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2777, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DELETE_ARC_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2761, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DELETE_ARC_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2777, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2762
+  /* "pywrapfst.pyx":2778
  * DELETE_STATE_PROPERTIES = fst.kDeleteStatesProperties
  * DELETE_ARC_PROPERTIES = fst.kDeleteArcsProperties
  * STATE_SORT_PROPERTIES = fst.kStateSortProperties             # <<<<<<<<<<<<<<
  * ARC_SORT_PROPERTIES = fst.kArcSortProperties
  * I_LABEL_INVARIANT_PROPERTIES = fst.kILabelInvariantProperties
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kStateSortProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2762, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kStateSortProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2778, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_STATE_SORT_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2762, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_STATE_SORT_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2778, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2763
+  /* "pywrapfst.pyx":2779
  * DELETE_ARC_PROPERTIES = fst.kDeleteArcsProperties
  * STATE_SORT_PROPERTIES = fst.kStateSortProperties
  * ARC_SORT_PROPERTIES = fst.kArcSortProperties             # <<<<<<<<<<<<<<
  * I_LABEL_INVARIANT_PROPERTIES = fst.kILabelInvariantProperties
  * O_LABEL_INVARIANT_PROPERTIES = fst.kOLabelInvariantProperties
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kArcSortProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2763, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kArcSortProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2779, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_SORT_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2763, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ARC_SORT_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2779, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2764
+  /* "pywrapfst.pyx":2780
  * STATE_SORT_PROPERTIES = fst.kStateSortProperties
  * ARC_SORT_PROPERTIES = fst.kArcSortProperties
  * I_LABEL_INVARIANT_PROPERTIES = fst.kILabelInvariantProperties             # <<<<<<<<<<<<<<
  * O_LABEL_INVARIANT_PROPERTIES = fst.kOLabelInvariantProperties
  * WEIGHT_INVARIANT_PROPERTIES = fst.kWeightInvariantProperties
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kILabelInvariantProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2764, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kILabelInvariantProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2780, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_LABEL_INVARIANT_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2764, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_I_LABEL_INVARIANT_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2780, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2765
+  /* "pywrapfst.pyx":2781
  * ARC_SORT_PROPERTIES = fst.kArcSortProperties
  * I_LABEL_INVARIANT_PROPERTIES = fst.kILabelInvariantProperties
  * O_LABEL_INVARIANT_PROPERTIES = fst.kOLabelInvariantProperties             # <<<<<<<<<<<<<<
  * WEIGHT_INVARIANT_PROPERTIES = fst.kWeightInvariantProperties
  * ADD_SUPERFINAL_PROPERTIES = fst.kAddSuperFinalProperties
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kOLabelInvariantProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2765, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kOLabelInvariantProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2781, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_LABEL_INVARIANT_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2765, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_O_LABEL_INVARIANT_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2781, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2766
+  /* "pywrapfst.pyx":2782
  * I_LABEL_INVARIANT_PROPERTIES = fst.kILabelInvariantProperties
  * O_LABEL_INVARIANT_PROPERTIES = fst.kOLabelInvariantProperties
  * WEIGHT_INVARIANT_PROPERTIES = fst.kWeightInvariantProperties             # <<<<<<<<<<<<<<
  * ADD_SUPERFINAL_PROPERTIES = fst.kAddSuperFinalProperties
  * RM_SUPERFINAL_PROPERTIES = fst.kRmSuperFinalProperties
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kWeightInvariantProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2766, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kWeightInvariantProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2782, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHT_INVARIANT_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2766, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_WEIGHT_INVARIANT_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2782, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2767
+  /* "pywrapfst.pyx":2783
  * O_LABEL_INVARIANT_PROPERTIES = fst.kOLabelInvariantProperties
  * WEIGHT_INVARIANT_PROPERTIES = fst.kWeightInvariantProperties
  * ADD_SUPERFINAL_PROPERTIES = fst.kAddSuperFinalProperties             # <<<<<<<<<<<<<<
  * RM_SUPERFINAL_PROPERTIES = fst.kRmSuperFinalProperties
  * BINARY_PROPERTIES = fst.kBinaryProperties
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kAddSuperFinalProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2767, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kAddSuperFinalProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2783, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_SUPERFINAL_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2767, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ADD_SUPERFINAL_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2783, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2768
+  /* "pywrapfst.pyx":2784
  * WEIGHT_INVARIANT_PROPERTIES = fst.kWeightInvariantProperties
  * ADD_SUPERFINAL_PROPERTIES = fst.kAddSuperFinalProperties
  * RM_SUPERFINAL_PROPERTIES = fst.kRmSuperFinalProperties             # <<<<<<<<<<<<<<
  * BINARY_PROPERTIES = fst.kBinaryProperties
  * TRINARY_PROPERTIES = fst.kTrinaryProperties
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kRmSuperFinalProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2768, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kRmSuperFinalProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2784, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_RM_SUPERFINAL_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2768, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_RM_SUPERFINAL_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2784, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2769
+  /* "pywrapfst.pyx":2785
  * ADD_SUPERFINAL_PROPERTIES = fst.kAddSuperFinalProperties
  * RM_SUPERFINAL_PROPERTIES = fst.kRmSuperFinalProperties
  * BINARY_PROPERTIES = fst.kBinaryProperties             # <<<<<<<<<<<<<<
  * TRINARY_PROPERTIES = fst.kTrinaryProperties
  * POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kBinaryProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2769, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kBinaryProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2785, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BINARY_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2769, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BINARY_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2785, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2770
+  /* "pywrapfst.pyx":2786
  * RM_SUPERFINAL_PROPERTIES = fst.kRmSuperFinalProperties
  * BINARY_PROPERTIES = fst.kBinaryProperties
  * TRINARY_PROPERTIES = fst.kTrinaryProperties             # <<<<<<<<<<<<<<
  * POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
  * NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kTrinaryProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2770, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kTrinaryProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2786, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_TRINARY_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2770, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_TRINARY_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2786, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2771
+  /* "pywrapfst.pyx":2787
  * BINARY_PROPERTIES = fst.kBinaryProperties
  * TRINARY_PROPERTIES = fst.kTrinaryProperties
  * POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties             # <<<<<<<<<<<<<<
  * NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties
  * FST_PROPERTIES = fst.kFstProperties
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kPosTrinaryProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2771, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kPosTrinaryProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2787, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_POS_TRINARY_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2771, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_POS_TRINARY_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2787, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2772
+  /* "pywrapfst.pyx":2788
  * TRINARY_PROPERTIES = fst.kTrinaryProperties
  * POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
  * NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties             # <<<<<<<<<<<<<<
  * FST_PROPERTIES = fst.kFstProperties
  * 
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNegTrinaryProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2772, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kNegTrinaryProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2788, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NEG_TRINARY_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2772, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NEG_TRINARY_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2788, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":2773
+  /* "pywrapfst.pyx":2789
  * POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
  * NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties
  * FST_PROPERTIES = fst.kFstProperties             # <<<<<<<<<<<<<<
  * 
  * 
  */
-  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kFstProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2773, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_uint64_t(fst::kFstProperties); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2789, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FST_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2773, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FST_PROPERTIES, __pyx_t_2) < 0) __PYX_ERR(0, 2789, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":3218
+  /* "pywrapfst.pyx":3234
  * 
  * cdef _Fst _map(_Fst ifst,
  *                float delta=fst.kDelta,             # <<<<<<<<<<<<<<
@@ -51011,7 +51090,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__34 = fst::kDelta;
 
-  /* "pywrapfst.pyx":3231
+  /* "pywrapfst.pyx":3247
  * 
  * cpdef _Fst arcmap(_Fst ifst,
  *                   float delta=fst.kDelta,             # <<<<<<<<<<<<<<
@@ -51020,7 +51099,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__35 = fst::kDelta;
 
-  /* "pywrapfst.pyx":3230
+  /* "pywrapfst.pyx":3246
  * 
  * 
  * cpdef _Fst arcmap(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -51029,7 +51108,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__35 = fst::kDelta;
 
-  /* "pywrapfst.pyx":3334
+  /* "pywrapfst.pyx":3350
  * 
  * cpdef _MutableFst determinize(_Fst ifst,
  *                               float delta=fst.kDelta,             # <<<<<<<<<<<<<<
@@ -51038,7 +51117,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__36 = fst::kDelta;
 
-  /* "pywrapfst.pyx":3336
+  /* "pywrapfst.pyx":3352
  *                               float delta=fst.kDelta,
  *                               dt=b"functional",
  *                               int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
@@ -51047,7 +51126,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__37 = fst::kNoStateId;
 
-  /* "pywrapfst.pyx":3334
+  /* "pywrapfst.pyx":3350
  * 
  * cpdef _MutableFst determinize(_Fst ifst,
  *                               float delta=fst.kDelta,             # <<<<<<<<<<<<<<
@@ -51056,7 +51135,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__36 = fst::kDelta;
 
-  /* "pywrapfst.pyx":3336
+  /* "pywrapfst.pyx":3352
  *                               float delta=fst.kDelta,
  *                               dt=b"functional",
  *                               int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
@@ -51065,7 +51144,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__37 = fst::kNoStateId;
 
-  /* "pywrapfst.pyx":3423
+  /* "pywrapfst.pyx":3439
  * 
  * cpdef _MutableFst disambiguate(_Fst ifst,
  *                                float delta=fst.kDelta,             # <<<<<<<<<<<<<<
@@ -51074,7 +51153,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__38 = fst::kDelta;
 
-  /* "pywrapfst.pyx":3424
+  /* "pywrapfst.pyx":3440
  * cpdef _MutableFst disambiguate(_Fst ifst,
  *                                float delta=fst.kDelta,
  *                                int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
@@ -51083,7 +51162,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__39 = fst::kNoStateId;
 
-  /* "pywrapfst.pyx":3423
+  /* "pywrapfst.pyx":3439
  * 
  * cpdef _MutableFst disambiguate(_Fst ifst,
  *                                float delta=fst.kDelta,             # <<<<<<<<<<<<<<
@@ -51092,7 +51171,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__38 = fst::kDelta;
 
-  /* "pywrapfst.pyx":3424
+  /* "pywrapfst.pyx":3440
  * cpdef _MutableFst disambiguate(_Fst ifst,
  *                                float delta=fst.kDelta,
  *                                int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
@@ -51101,7 +51180,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__39 = fst::kNoStateId;
 
-  /* "pywrapfst.pyx":3492
+  /* "pywrapfst.pyx":3508
  * 
  * 
  * cpdef bool equal(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta):             # <<<<<<<<<<<<<<
@@ -51111,7 +51190,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
   __pyx_k__40 = fst::kDelta;
   __pyx_k__40 = fst::kDelta;
 
-  /* "pywrapfst.pyx":3515
+  /* "pywrapfst.pyx":3531
  * 
  * 
  * cpdef bool equivalent(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta) except *:             # <<<<<<<<<<<<<<
@@ -51121,7 +51200,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
   __pyx_k__41 = fst::kDelta;
   __pyx_k__41 = fst::kDelta;
 
-  /* "pywrapfst.pyx":3577
+  /* "pywrapfst.pyx":3593
  * 
  * 
  * cpdef bool isomorphic(_Fst ifst1, _Fst ifst2, float delta=fst.kDelta):             # <<<<<<<<<<<<<<
@@ -51131,7 +51210,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
   __pyx_k__43 = fst::kDelta;
   __pyx_k__43 = fst::kDelta;
 
-  /* "pywrapfst.pyx":3604
+  /* "pywrapfst.pyx":3620
  * 
  * cpdef _MutableFst prune(_Fst ifst,
  *                         float delta=fst.kDelta,             # <<<<<<<<<<<<<<
@@ -51140,7 +51219,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__44 = fst::kDelta;
 
-  /* "pywrapfst.pyx":3605
+  /* "pywrapfst.pyx":3621
  * cpdef _MutableFst prune(_Fst ifst,
  *                         float delta=fst.kDelta,
  *                         int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
@@ -51149,7 +51228,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__45 = fst::kNoStateId;
 
-  /* "pywrapfst.pyx":3604
+  /* "pywrapfst.pyx":3620
  * 
  * cpdef _MutableFst prune(_Fst ifst,
  *                         float delta=fst.kDelta,             # <<<<<<<<<<<<<<
@@ -51158,7 +51237,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__44 = fst::kDelta;
 
-  /* "pywrapfst.pyx":3605
+  /* "pywrapfst.pyx":3621
  * cpdef _MutableFst prune(_Fst ifst,
  *                         float delta=fst.kDelta,
  *                         int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
@@ -51167,7 +51246,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__45 = fst::kNoStateId;
 
-  /* "pywrapfst.pyx":3636
+  /* "pywrapfst.pyx":3652
  * 
  * cpdef _MutableFst push(_Fst ifst,
  *                        float delta=fst.kDelta,             # <<<<<<<<<<<<<<
@@ -51176,7 +51255,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__46 = fst::kDelta;
 
-  /* "pywrapfst.pyx":3635
+  /* "pywrapfst.pyx":3651
  * 
  * 
  * cpdef _MutableFst push(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -51185,7 +51264,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__46 = fst::kDelta;
 
-  /* "pywrapfst.pyx":3690
+  /* "pywrapfst.pyx":3706
  *                           _Fst ifst2,
  *                           int32 npath=1,
  *                           float delta=fst.kDelta,             # <<<<<<<<<<<<<<
@@ -51194,7 +51273,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__47 = fst::kDelta;
 
-  /* "pywrapfst.pyx":3693
+  /* "pywrapfst.pyx":3709
  *                           time_t seed=0,
  *                           select=b"uniform",
  *                           int32 max_length=INT32_MAX) except *:             # <<<<<<<<<<<<<<
@@ -51203,7 +51282,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__48 = INT32_MAX;
 
-  /* "pywrapfst.pyx":3690
+  /* "pywrapfst.pyx":3706
  *                           _Fst ifst2,
  *                           int32 npath=1,
  *                           float delta=fst.kDelta,             # <<<<<<<<<<<<<<
@@ -51212,7 +51291,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__47 = fst::kDelta;
 
-  /* "pywrapfst.pyx":3693
+  /* "pywrapfst.pyx":3709
  *                           time_t seed=0,
  *                           select=b"uniform",
  *                           int32 max_length=INT32_MAX) except *:             # <<<<<<<<<<<<<<
@@ -51221,7 +51300,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__48 = INT32_MAX;
 
-  /* "pywrapfst.pyx":3745
+  /* "pywrapfst.pyx":3761
  *                           time_t seed=0,
  *                           select=b"uniform",
  *                           int32 max_length=INT32_MAX,             # <<<<<<<<<<<<<<
@@ -51230,7 +51309,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__50 = INT32_MAX;
 
-  /* "pywrapfst.pyx":3741
+  /* "pywrapfst.pyx":3757
  * 
  * 
  * cpdef _MutableFst randgen(_Fst ifst,             # <<<<<<<<<<<<<<
@@ -51239,7 +51318,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__50 = INT32_MAX;
 
-  /* "pywrapfst.pyx":3878
+  /* "pywrapfst.pyx":3894
  * cpdef _MutableFst rmepsilon(_Fst ifst,
  *                             bool connect=True,
  *                             float delta=fst.kDelta,             # <<<<<<<<<<<<<<
@@ -51248,7 +51327,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__51 = fst::kDelta;
 
-  /* "pywrapfst.pyx":3879
+  /* "pywrapfst.pyx":3895
  *                             bool connect=True,
  *                             float delta=fst.kDelta,
  *                             int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
@@ -51257,7 +51336,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__52 = fst::kNoStateId;
 
-  /* "pywrapfst.pyx":3878
+  /* "pywrapfst.pyx":3894
  * cpdef _MutableFst rmepsilon(_Fst ifst,
  *                             bool connect=True,
  *                             float delta=fst.kDelta,             # <<<<<<<<<<<<<<
@@ -51266,7 +51345,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__51 = fst::kDelta;
 
-  /* "pywrapfst.pyx":3879
+  /* "pywrapfst.pyx":3895
  *                             bool connect=True,
  *                             float delta=fst.kDelta,
  *                             int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
@@ -51275,7 +51354,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__52 = fst::kNoStateId;
 
-  /* "pywrapfst.pyx":3919
+  /* "pywrapfst.pyx":3935
  * 
  * cdef vector[fst.WeightClass] *_shortestdistance(_Fst ifst,
  *     float delta=fst.kDelta, int64 nstate=fst.kNoStateId, qt=b"auto",             # <<<<<<<<<<<<<<
@@ -51285,7 +51364,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
   __pyx_k__53 = fst::kDelta;
   __pyx_k__54 = fst::kNoStateId;
 
-  /* "pywrapfst.pyx":3937
+  /* "pywrapfst.pyx":3953
  * 
  * def shortestdistance(_Fst ifst,
  *                      float delta=fst.kDelta,             # <<<<<<<<<<<<<<
@@ -51294,7 +51373,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__55 = fst::kDelta;
 
-  /* "pywrapfst.pyx":3938
+  /* "pywrapfst.pyx":3954
  * def shortestdistance(_Fst ifst,
  *                      float delta=fst.kDelta,
  *                      int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
@@ -51303,19 +51382,19 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__56 = fst::kNoStateId;
 
-  /* "pywrapfst.pyx":3936
+  /* "pywrapfst.pyx":3952
  * 
  * 
  * def shortestdistance(_Fst ifst,             # <<<<<<<<<<<<<<
  *                      float delta=fst.kDelta,
  *                      int64 nstate=fst.kNoStateId,
  */
-  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_49shortestdistance, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3936, __pyx_L1_error)
+  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_49shortestdistance, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3952, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_shortestdistance, __pyx_t_2) < 0) __PYX_ERR(0, 3936, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_shortestdistance, __pyx_t_2) < 0) __PYX_ERR(0, 3952, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":3981
+  /* "pywrapfst.pyx":3997
  * 
  * cpdef _MutableFst shortestpath(_Fst ifst,
  *                                float delta=fst.kDelta,             # <<<<<<<<<<<<<<
@@ -51324,7 +51403,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__57 = fst::kDelta;
 
-  /* "pywrapfst.pyx":3983
+  /* "pywrapfst.pyx":3999
  *                                float delta=fst.kDelta,
  *                                int32 nshortest=1,
  *                                int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
@@ -51333,7 +51412,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__58 = fst::kNoStateId;
 
-  /* "pywrapfst.pyx":3981
+  /* "pywrapfst.pyx":3997
  * 
  * cpdef _MutableFst shortestpath(_Fst ifst,
  *                                float delta=fst.kDelta,             # <<<<<<<<<<<<<<
@@ -51342,7 +51421,7 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__57 = fst::kDelta;
 
-  /* "pywrapfst.pyx":3983
+  /* "pywrapfst.pyx":3999
  *                                float delta=fst.kDelta,
  *                                int32 nshortest=1,
  *                                int64 nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
@@ -51351,87 +51430,87 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   __pyx_k__58 = fst::kNoStateId;
 
-  /* "pywrapfst.pyx":4135
+  /* "pywrapfst.pyx":4151
  * 
  *   def __cinit__(self,
  *                 string fst_type=b"vector",             # <<<<<<<<<<<<<<
  *                 string arc_type=b"standard",
  *                 SymbolTable isymbols=None,
  */
-  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_vector); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4135, __pyx_L1_error)
+  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_vector); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4151, __pyx_L1_error)
   __pyx_k__59 = __pyx_t_6;
 
-  /* "pywrapfst.pyx":4136
+  /* "pywrapfst.pyx":4152
  *   def __cinit__(self,
  *                 string fst_type=b"vector",
  *                 string arc_type=b"standard",             # <<<<<<<<<<<<<<
  *                 SymbolTable isymbols=None,
  *                 SymbolTable osymbols=None,
  */
-  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_standard); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4136, __pyx_L1_error)
+  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_standard); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4152, __pyx_L1_error)
   __pyx_k__60 = __pyx_t_6;
 
-  /* "pywrapfst.pyx":4236
+  /* "pywrapfst.pyx":4252
  * 
  *   @classmethod
  *   def open(cls, *filenames):             # <<<<<<<<<<<<<<
  *     """
  *     FarReader.open(*filenames)
  */
-  __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_FarReader, __pyx_n_s_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4236, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_FarReader, __pyx_n_s_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4252, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
 
-  /* "pywrapfst.pyx":4235
+  /* "pywrapfst.pyx":4251
  *     return "<{} FarReader at 0x{:x}>".format(self.far_type(), id(self))
  * 
  *   @classmethod             # <<<<<<<<<<<<<<
  *   def open(cls, *filenames):
  *     """
  */
-  __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4235, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4251, __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, 4236, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_FarReader->tp_dict, __pyx_n_s_open, __pyx_t_1) < 0) __PYX_ERR(0, 4252, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_9pywrapfst_FarReader);
 
-  /* "pywrapfst.pyx":4411
+  /* "pywrapfst.pyx":4427
  * 
  *   @classmethod
  *   def create(cls, filename, arc_type=b"standard", far_type=b"default"):             # <<<<<<<<<<<<<<
  *     """
  *     FarWriter.
  */
-  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_FarWriter, __pyx_n_s_create); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4411, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_9pywrapfst_FarWriter, __pyx_n_s_create); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4427, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
 
-  /* "pywrapfst.pyx":4410
+  /* "pywrapfst.pyx":4426
  *     return "<{} FarWriter at 0x{:x}>".format(self.far_type(), id(self))
  * 
  *   @classmethod             # <<<<<<<<<<<<<<
  *   def create(cls, filename, arc_type=b"standard", far_type=b"default"):
  *     """
  */
-  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4410, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4426, __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, 4411, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_9pywrapfst_FarWriter->tp_dict, __pyx_n_s_create, __pyx_t_2) < 0) __PYX_ERR(0, 4427, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_9pywrapfst_FarWriter);
 
-  /* "pywrapfst.pyx":4503
+  /* "pywrapfst.pyx":4519
  * 
  * 
  * _fst_error_fatal_old = fst.FLAGS_fst_error_fatal             # <<<<<<<<<<<<<<
  * fst.FLAGS_fst_error_fatal = False
  * 
  */
-  __pyx_t_2 = __Pyx_PyBool_FromLong(FLAGS_fst_error_fatal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4503, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyBool_FromLong(FLAGS_fst_error_fatal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4519, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_fst_error_fatal_old, __pyx_t_2) < 0) __PYX_ERR(0, 4503, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_fst_error_fatal_old, __pyx_t_2) < 0) __PYX_ERR(0, 4519, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "pywrapfst.pyx":4504
+  /* "pywrapfst.pyx":4520
  * 
  * _fst_error_fatal_old = fst.FLAGS_fst_error_fatal
  * fst.FLAGS_fst_error_fatal = False             # <<<<<<<<<<<<<<
@@ -51440,27 +51519,27 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
  */
   FLAGS_fst_error_fatal = 0;
 
-  /* "pywrapfst.pyx":4507
+  /* "pywrapfst.pyx":4523
  * 
  * 
  * @atexit.register             # <<<<<<<<<<<<<<
  * def _reset_fst_error_fatal():
  *   fst.FLAGS_fst_error_fatal = _fst_error_fatal_old
  */
-  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_atexit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4507, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_atexit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4523, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_register); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4507, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_register); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4523, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "pywrapfst.pyx":4508
+  /* "pywrapfst.pyx":4524
  * 
  * @atexit.register
  * def _reset_fst_error_fatal():             # <<<<<<<<<<<<<<
  *   fst.FLAGS_fst_error_fatal = _fst_error_fatal_old
  * 
  */
-  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_57_reset_fst_error_fatal, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4508, __pyx_L1_error)
+  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pywrapfst_57_reset_fst_error_fatal, NULL, __pyx_n_s_pywrapfst_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4524, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_4 = NULL;
   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
@@ -51473,14 +51552,14 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
     }
   }
   if (!__pyx_t_4) {
-    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4507, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4523, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else {
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_3)) {
       PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_1};
-      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4507, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4523, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -51489,26 +51568,26 @@ PyMODINIT_FUNC PyInit_pywrapfst(void)
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
       PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_1};
-      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4507, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4523, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     } else
     #endif
     {
-      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4507, __pyx_L1_error)
+      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4523, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
       __Pyx_GIVEREF(__pyx_t_1);
       PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_1);
       __pyx_t_1 = 0;
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4507, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4523, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     }
   }
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reset_fst_error_fatal, __pyx_t_2) < 0) __PYX_ERR(0, 4508, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reset_fst_error_fatal, __pyx_t_2) < 0) __PYX_ERR(0, 4524, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "pywrapfst.pyx":1
index 23c7d39..60f7730 100644 (file)
@@ -215,7 +215,8 @@ cdef class _Fst(object):
                   bool acceptor=?, title=?, double width=?,
                   double height=?, bool portrait=?, bool vertical=?,
                   double ranksep=?, double nodesep=?, int32 fontsize=?,
-                  int32 precision=?, bool show_weight_one=?)
+                  int32 precision=?, float_format=?,
+                  bool show_weight_one=?)
 
   cpdef Weight final(self, int64 state)
 
@@ -294,9 +295,10 @@ cdef class _MutableFst(_Fst):
   cdef void _relabel_pairs(self, ipairs=?, opairs=?) except *
 
   cdef void _relabel_tables(self, _SymbolTable old_isymbols=?,
-      _SymbolTable new_isymbols=?, bool attach_new_isymbols=?,
+      _SymbolTable new_isymbols=?, unknown_isymbol=?,
+      bool attach_new_isymbols=?,
       _SymbolTable old_osymbols=?, _SymbolTable new_osymbols=?,
-      bool attach_new_osymbols=?) except *
+      unknown_osymbol=?, bool attach_new_osymbols=?) except *
 
   cdef void _reserve_arcs(self, int64 state, size_t n) except *
 
index e51e3da..9445a47 100644 (file)
@@ -1364,7 +1364,7 @@ cdef class _Fst(object):
                 self._fst.get().OutputSymbols(), NULL,
                 self._fst.get().Properties(fst.kAcceptor, True) ==
                 fst.kAcceptor,
-                b"", 8.5, 11, True, False, 0.4, 0.25, 14, 5, False,
+                b"", 8.5, 11, True, False, 0.4, 0.25, 14, 5, b"g", False,
                 addr(sstrm), b"_repr_svg")
     (sout, serr) = proc.communicate(sstrm.str())
     if proc.returncode != 0:  # Just to be explicit.
@@ -1428,12 +1428,13 @@ cdef class _Fst(object):
                   double nodesep=0.25,
                   int32 fontsize=14,
                   int32 precision=5,
+                  float_format=b"g",
                   bool show_weight_one=False):
     """
     draw(self, filename, isymbols=None, osymbols=None, ssymbols=None,
          acceptor=False, title="", width=8.5, height=11, portrait=False,
          vertical=False, ranksep=0.4, nodesep=0.25, fontsize=14,
-         precision=5, show_weight_one=False):
+         precision=5, float_format="g", show_weight_one=False):
 
     Writes out the FST in Graphviz text format.
 
@@ -1457,6 +1458,7 @@ cdef class _Fst(object):
       nodesep: The minimum separation between nodes, in inches.
       fontsize: Font size, in points.
       precision: Numeric precision for floats, in number of chars.
+      float_format: One of: 'e', 'f' or 'g'.
       show_weight_one: Should weights equivalent to semiring One be printed?
 
     For more information about the rendering options, see `man dot`.
@@ -1475,8 +1477,9 @@ cdef class _Fst(object):
         self._fst.get().OutputSymbols() if osymbols is None
         else osymbols._table,
         ssymbols_ptr, acceptor, tostring(title), width, height, portrait,
-        vertical, ranksep, nodesep, fontsize, precision, show_weight_one,
-        ostrm.get(), filename_string)
+        vertical, ranksep, nodesep, fontsize, precision,
+        tostring(float_format), show_weight_one, ostrm.get(),
+        filename_string)
 
   cpdef Weight final(self, int64 state):
     """
@@ -2198,9 +2201,11 @@ cdef class _MutableFst(_Fst):
   cdef void _relabel_tables(self,
                             _SymbolTable old_isymbols=None,
                             _SymbolTable new_isymbols=None,
+                            unknown_isymbol=b"",
                             bool attach_new_isymbols=True,
                             _SymbolTable old_osymbols=None,
                             _SymbolTable new_osymbols=None,
+                            unknown_osymbol=b"",
                             bool attach_new_osymbols=True) except *:
     if new_isymbols is None and new_osymbols is None:
       raise FstArgError("No new SymbolTables specified")
@@ -2212,22 +2217,27 @@ cdef class _MutableFst(_Fst):
       new_osymbols_ptr = new_osymbols._table
     fst.Relabel(self._mfst.get(),
         self._fst.get().InputSymbols() if old_isymbols is None else
-        old_isymbols._table, new_isymbols_ptr, attach_new_isymbols,
+        old_isymbols._table, new_isymbols_ptr, tostring(unknown_isymbol),
+        attach_new_isymbols,
         self._fst.get().OutputSymbols() if old_osymbols is None else
-        old_osymbols._table, new_osymbols_ptr, attach_new_osymbols)
+        old_osymbols._table, new_osymbols_ptr, tostring(unknown_osymbol),
+        attach_new_osymbols)
     self._check_mutating_imethod()
 
   def relabel_tables(self,
                      _SymbolTable old_isymbols=None,
-                    _SymbolTable new_isymbols=None,
-                    bool attach_new_isymbols=True,
-                    _SymbolTable old_osymbols=None,
-                    _SymbolTable new_osymbols=None,
-                    bool attach_new_osymbols=True):
+                     _SymbolTable new_isymbols=None,
+                     unknown_isymbol=b"",
+                     bool attach_new_isymbols=True,
+                     _SymbolTable old_osymbols=None,
+                     _SymbolTable new_osymbols=None,
+                     unknown_osymbol=b"",
+                     bool attach_new_osymbols=True):
     """
     relabel_tables(self, old_isymbols=None, new_isymbols=None,
-                   attach_new_isymbols=True, old_osymbols=None,
-                   new_osymbols=None, attach_new_osymbols=True)
+                   unknown_isymbol="", attach_new_isymbols=True,
+                   old_osymbols=None, new_osymbols=None,
+                   unknown_osymbol="", attach_new_osymbols=True)
 
     Replaces input and/or output labels using SymbolTables.
 
@@ -2238,11 +2248,15 @@ cdef class _MutableFst(_Fst):
        old_isymbols: The old SymbolTable for input labels, defaulting to the
           FST's input symbol table.
        new_isymbols: A SymbolTable used to relabel the input labels
+       unknown_isymbol: Input symbol to use to relabel OOVs (if empty,
+          OOVs raise an exception)
        attach_new_isymbols: Should new_isymbols be made the FST's input symbol
           table?
        old_osymbols: The old SymbolTable for output labels, defaulting to the
           FST's output symbol table.
        new_osymbols: A SymbolTable used to relabel the output labels.
+       unknown_osymbol: Outnput symbol to use to relabel OOVs (if empty,
+          OOVs raise an exception)
        attach_new_isymbols: Should new_osymbols be made the FST's output symbol
           table?
 
@@ -2254,8 +2268,10 @@ cdef class _MutableFst(_Fst):
 
     See also: `decode`, `encode`, `project`, `relabel_pairs`.
     """
-    self._relabel_tables(old_isymbols, new_isymbols, attach_new_isymbols,
-                         old_osymbols, new_osymbols, attach_new_osymbols)
+    self._relabel_tables(old_isymbols, new_isymbols,
+                         unknown_isymbol, attach_new_isymbols,
+                         old_osymbols, new_osymbols,
+                         unknown_osymbol, attach_new_osymbols)
     return self
 
   cdef void _reserve_arcs(self, int64 state, size_t n) except *:
@@ -2387,7 +2403,7 @@ cdef class _MutableFst(_Fst):
     cdef fst.WeightClass wc = _get_WeightClass_or_One(self.weight_type(),
                                                       weight)
     if not self._mfst.get().SetFinal(state, wc):
-      raise FstOpError("incompatible or invalid weight")
+      raise FstOpError("Incompatible or invalid weight")
     self._check_mutating_imethod()
 
   def set_final(self, int64 state, weight=None):
@@ -2403,7 +2419,7 @@ cdef class _MutableFst(_Fst):
 
     Raises:
       FstIndexError: State index out of range.
-      FstOpError: incompatible or invalid weight.
+      FstOpError: Incompatible or invalid weight.
 
     See also: `set_start`.
     """
index 64df7ed..7c4a2e6 100644 (file)
@@ -16,7 +16,7 @@ libfst_LTLIBRARIES = phi-fst.la rho-fst.la sigma-fst.la
 lib_LTLIBRARIES = libfstspecial.la
 
 libfstspecial_la_SOURCES = phi-fst.cc rho-fst.cc sigma-fst.cc
-libfstspecial_la_LDFLAGS = -version-info 6:0:0 -lm $(DL_LIBS)
+libfstspecial_la_LDFLAGS = -version-info 7:0:0 -lm $(DL_LIBS)
 libfstspecial_la_LIBADD = ../../lib/libfst.la -lm $(DL_LIBS)
 
 phi_fst_la_SOURCES = phi-fst.cc
index b75c844..103911a 100644 (file)
@@ -378,7 +378,7 @@ AM_CPPFLAGS = -I$(srcdir)/../../include $(ICU_CPPFLAGS)
 libfst_LTLIBRARIES = phi-fst.la rho-fst.la sigma-fst.la
 lib_LTLIBRARIES = libfstspecial.la
 libfstspecial_la_SOURCES = phi-fst.cc rho-fst.cc sigma-fst.cc
-libfstspecial_la_LDFLAGS = -version-info 6:0:0 -lm $(DL_LIBS)
+libfstspecial_la_LDFLAGS = -version-info 7:0:0 -lm $(DL_LIBS)
 libfstspecial_la_LIBADD = ../../lib/libfst.la -lm $(DL_LIBS)
 phi_fst_la_SOURCES = phi-fst.cc
 phi_fst_la_LDFLAGS = -module
index 273b832..b18d37f 100644 (file)
@@ -11,6 +11,8 @@
 #include <unordered_map>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/arcfilter.h>
 #include <fst/arcsort.h>
 #include <fst/dfs-visit.h>
@@ -518,12 +520,7 @@ class CacheLogAccumulator {
       }
       return sum;
     } else {
-      if (weights_->size() <= end) {
-        for (aiter->Seek(weights_->size() - 1); weights_->size() <= end;
-             aiter->Next()) {
-          weights_->push_back(LogPlus(weights_->back(), aiter->Value().weight));
-        }
-      }
+      Extend(end, aiter);
       const auto &f1 = (*weights_)[end];
       const auto &f2 = (*weights_)[begin];
       if (f1 < f2) {
@@ -544,20 +541,24 @@ class CacheLogAccumulator {
     }
   }
 
-  // Arc iterator position determines beginning point of lower bound.
+  // Returns first position from aiter->Position() whose accumulated
+  // value is greater or equal to w (w.r.t. Zero() < One()). The
+  // iterator may be repositioned.
   template <class ArcIter>
-  size_t LowerBound(double w, ArcIter *aiter) {
+  size_t LowerBound(Weight w, ArcIter *aiter) {
+    const auto f = to_log_weight_(w).Value();
+    auto pos = aiter->Position();
     if (weights_) {
-      auto pos = aiter->Position();
-      return std::lower_bound(weights_->begin() + pos + 1, weights_->end(), w,
-                              std::greater<double>()) -
-             weights_->begin() - 1;
+      Extend(fst_->NumArcs(s_), aiter);
+      return std::lower_bound(weights_->begin() + pos + 1, weights_->end(),
+                              f, std::greater<double>()) -
+          weights_->begin() - 1;
     } else {
       auto n = 0;
       auto x = FloatLimits<double>::PosInfinity();
-      for (; !aiter->Done(); aiter->Next(), ++n) {
+      for (aiter->Reset(); !aiter->Done(); aiter->Next(), ++n) {
         x = LogPlus(x, aiter->Value().weight);
-        if (x < w) break;
+        if (n >= pos && x <= f) break;
       }
       return n;
     }
@@ -606,6 +607,18 @@ class CacheLogAccumulator {
     }
   }
 
+  // Extends weights up to index 'end'.
+  template <class ArcIter>
+  void Extend(ssize_t end, ArcIter *aiter) {
+    if (weights_->size() <= end) {
+      for (aiter->Seek(weights_->size() - 1); weights_->size() <= end;
+           aiter->Next()) {
+        weights_->push_back(LogPlus(weights_->back(), aiter->Value().weight));
+      }
+    }
+  }
+
+
   WeightConvert<Weight, Log64Weight> to_log_weight_;
   WeightConvert<Log64Weight, Weight> to_weight_;
   ssize_t arc_limit_;                    // Minimum # of arcs to cache a state.
index e7e7262..36195a2 100644 (file)
@@ -13,6 +13,8 @@
 #include <string>
 #include <utility>
 
+#include <fst/log.h>
+
 #include <fst/fst.h>
 
 
index 61b3645..bc54e18 100644 (file)
@@ -12,6 +12,8 @@
 #include <unordered_map>
 #include <utility>
 
+#include <fst/log.h>
+
 #include <fst/cache.h>
 #include <fst/mutable-fst.h>
 
@@ -577,11 +579,11 @@ class StateIterator<ArcMapFst<A, B, C>> : public StateIteratorBase<B> {
     CheckSuperfinal();
   }
 
-  bool Done() const override { return siter_.Done() && !superfinal_; }
+  bool Done() const final { return siter_.Done() && !superfinal_; }
 
-  StateId Value() const override { return s_; }
+  StateId Value() const final { return s_; }
 
-  void Next() override {
+  void Next() final {
     ++s_;
     if (!siter_.Done()) {
       siter_.Next();
@@ -591,7 +593,7 @@ class StateIterator<ArcMapFst<A, B, C>> : public StateIteratorBase<B> {
     }
   }
 
-  void Reset() override {
+  void Reset() final {
     s_ = 0;
     siter_.Reset();
     superfinal_ = impl_->final_action_ == MAP_REQUIRE_SUPERFINAL;
@@ -737,16 +739,22 @@ class SuperFinalMapper {
 };
 
 // Mapper that leaves labels and nextstate unchanged and constructs a new weight
-// from the underlying value of the arc weight. Requires that there is a
-// WeightConvert class specialization that converts the weights.
-template <class A, class B>
+// from the underlying value of the arc weight. If no weight converter is
+// explictly specified, requires that there is a WeightConvert class
+// specialization that converts the weights.
+template <class A, class B,
+          class C = WeightConvert<typename A::Weight, typename B::Weight>>
 class WeightConvertMapper {
  public:
   using FromArc = A;
   using ToArc = B;
+  using Converter = C;
   using FromWeight = typename FromArc::Weight;
   using ToWeight = typename ToArc::Weight;
 
+  explicit WeightConvertMapper(const Converter &c = Converter())
+      : convert_weight_(c) {}
+
   ToArc operator()(const FromArc &arc) const {
     return ToArc(arc.ilabel, arc.olabel, convert_weight_(arc.weight),
                  arc.nextstate);
@@ -765,7 +773,7 @@ class WeightConvertMapper {
   uint64 Properties(uint64 props) const { return props; }
 
  private:
-  WeightConvert<FromWeight, ToWeight> convert_weight_;
+  Converter convert_weight_;
 };
 
 // Non-precision-changing weight conversions; consider using more efficient
@@ -965,7 +973,7 @@ class GallicToNewSymbolsMapper {
         StringWeightIterator<Label, GALLIC_STRING_TYPE(G)> iter1(w1);
         StateId n;
         string s;
-        for (auto i = 0, p = state_; i < w1.Size();
+        for (size_t i = 0, p = state_; i < w1.Size();
              ++i, iter1.Next(), p = n) {
           n = i == w1.Size() - 1 ? state_ : fst_->AddState();
           fst_->AddArc(p, ToArc(i ? 0 : l, iter1.Value(), AW::One(), n));
index ad036b1..c1a18d0 100644 (file)
@@ -14,6 +14,7 @@
 #include <unordered_set>
 #include <vector>
 
+#include <fst/log.h>
 #include <fst/memory.h>
 
 namespace fst {
index 4643fbb..ed993e9 100644 (file)
@@ -13,6 +13,8 @@ using std::unordered_multimap;
 #include <list>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/vector-fst.h>
 
 
@@ -1106,7 +1108,7 @@ class CacheStateIterator : public StateIteratorBase<typename FST::Arc> {
     fst_.Start();  // Forces start state.
   }
 
-  bool Done() const override {
+  bool Done() const final {
     if (s_ < impl_->NumKnownStates()) return false;
     for (StateId u = impl_->MinUnexpandedState(); u < impl_->NumKnownStates();
          u = impl_->MinUnexpandedState()) {
@@ -1122,11 +1124,11 @@ class CacheStateIterator : public StateIteratorBase<typename FST::Arc> {
     return true;
   }
 
-  StateId Value() const override { return s_; }
+  StateId Value() const final { return s_; }
 
-  void Next() override { ++s_; }
+  void Next() final { ++s_; }
 
-  void Reset() override { s_ = 0; }
+  void Reset() final { s_ = 0; }
 
  private:
   const FST &fst_;
@@ -1179,7 +1181,7 @@ class CacheArcIterator {
 };
 
 // Use this to make a mutable arc iterator for a CacheBaseImpl-derived FST,
-// which must have types 'Arc' and 'Store' defined.
+// which must have types Arc and Store defined.
 template <class FST>
 class CacheMutableArcIterator
     : public MutableArcIteratorBase<typename FST::Arc> {
@@ -1200,23 +1202,23 @@ class CacheMutableArcIterator
 
   ~CacheMutableArcIterator() override { state_->DecrRefCount(); }
 
-  bool Done() const override { return i_ >= state_->NumArcs(); }
+  bool Done() const final { return i_ >= state_->NumArcs(); }
 
-  const Arc &Value() const override { return state_->GetArc(i_); }
+  const Arc &Value() const final { return state_->GetArc(i_); }
 
-  void Next() override { ++i_; }
+  void Next() final { ++i_; }
 
-  size_t Position() const override { return i_; }
+  size_t Position() const final { return i_; }
 
-  void Reset() override { i_ = 0; }
+  void Reset() final { i_ = 0; }
 
-  void Seek(size_t a) override { i_ = a; }
+  void Seek(size_t a) final { i_ = a; }
 
-  void SetValue(const Arc &arc) override { state_->SetArc(arc, i_); }
+  void SetValue(const Arc &arc) final { state_->SetArc(arc, i_); }
 
-  constexpr uint32 Flags() const override { return kArcValueFlags; }
+  constexpr uint32 Flags() const final { return kArcValueFlags; }
 
-  void SetFlags(uint32, uint32) override {}
+  void SetFlags(uint32, uint32) final {}
 
  private:
   size_t i_;
index c044f5b..cc8babf 100644 (file)
@@ -11,6 +11,8 @@
 #include <utility>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/cache.h>
 #include <fst/expanded-fst.h>
 #include <fst/fst-decl.h>  // For optional argument declarations
index 50931f7..9bd2e81 100644 (file)
@@ -9,6 +9,7 @@
 #include <algorithm>
 #include <string>
 #include <vector>
+#include <fst/log.h>
 
 #include <fst/fst.h>
 #include <fst/test-properties.h>
@@ -162,23 +163,23 @@ const typename Arc::Label ComplementFst<Arc>::kRhoLabel;
 
 // Specialization for ComplementFst.
 template <class Arc>
-class StateIterator<ComplementFst<Arc>> final : public StateIteratorBase<Arc> {
+class StateIterator<ComplementFst<Arc>> : public StateIteratorBase<Arc> {
  public:
   using StateId = typename Arc::StateId;
 
   explicit StateIterator(const ComplementFst<Arc> &fst)
       : siter_(*fst.GetImpl()->fst_), s_(0) {}
 
-  bool Done() const override { return s_ > 0 && siter_.Done(); }
+  bool Done() const final { return s_ > 0 && siter_.Done(); }
 
-  StateId Value() const override { return s_; }
+  StateId Value() const final { return s_; }
 
-  void Next() override {
+  void Next() final {
     if (s_ != 0) siter_.Next();
     ++s_;
   }
 
-  void Reset() override {
+  void Reset() final {
     siter_.Reset();
     s_ = 0;
   }
@@ -190,8 +191,7 @@ class StateIterator<ComplementFst<Arc>> final : public StateIteratorBase<Arc> {
 
 // Specialization for ComplementFst.
 template <class Arc>
-class ArcIterator<ComplementFst<Arc>> final
-    : public fst::ArcIteratorBase<Arc> {
+class ArcIterator<ComplementFst<Arc>> : public ArcIteratorBase<Arc> {
  public:
   using StateId = typename Arc::StateId;
   using Weight = typename Arc::Weight;
@@ -202,7 +202,7 @@ class ArcIterator<ComplementFst<Arc>> final
     }
   }
 
-  bool Done() const override {
+  bool Done() const final {
     if (s_ != 0) {
       return pos_ > 0 && aiter_->Done();
     } else {
@@ -211,7 +211,7 @@ class ArcIterator<ComplementFst<Arc>> final
   }
 
   // Adds the ρ-label to the ρ destination state.
-  const Arc &Value() const override {
+  const Arc &Value() const final {
     if (pos_ == 0) {
       arc_.ilabel = arc_.olabel = ComplementFst<Arc>::kRhoLabel;
       arc_.weight = Weight::One();
@@ -223,19 +223,19 @@ class ArcIterator<ComplementFst<Arc>> final
     return arc_;
   }
 
-  void Next() override {
+  void Next() final {
     if (s_ != 0 && pos_ > 0) aiter_->Next();
     ++pos_;
   }
 
-  size_t Position() const override { return pos_; }
+  size_t Position() const final { return pos_; }
 
-  void Reset() override {
+  void Reset() final {
     if (s_ != 0) aiter_->Reset();
     pos_ = 0;
   }
 
-  void Seek(size_t a) override {
+  void Seek(size_t a) final {
     if (s_ != 0) {
       if (a == 0) {
         aiter_->Reset();
@@ -246,9 +246,9 @@ class ArcIterator<ComplementFst<Arc>> final
     pos_ = a;
   }
 
-  constexpr uint32 Flags() const override { return kArcValueFlags; }
+  constexpr uint32 Flags() const final { return kArcValueFlags; }
 
-  void SetFlags(uint32, uint32) override {}
+  void SetFlags(uint32, uint32) final {}
 
  private:
   std::unique_ptr<ArcIterator<Fst<Arc>>> aiter_;
index 0397e54..5707569 100644 (file)
@@ -8,6 +8,8 @@
 
 #include <algorithm>
 
+#include <fst/log.h>
+
 #include <fst/cache.h>
 #include <fst/compose-filter.h>
 #include <fst/fst-decl.h>  // For optional argument declarations
@@ -710,7 +712,7 @@ inline void ComposeFst<Arc, CacheStore>::InitStateIterator(
 // iff the underlying matchers for the two FSTS being composed support
 // MATCH_INPUT or MATCH_OUTPUT, respectively.
 template <class CacheStore, class Filter, class StateTable>
-class ComposeFstMatcher final : public MatcherBase<typename CacheStore::Arc> {
+class ComposeFstMatcher : public MatcherBase<typename CacheStore::Arc> {
  public:
   using Arc = typename CacheStore::Arc;
   using Label = typename Arc::Label;
@@ -791,12 +793,55 @@ class ComposeFstMatcher final : public MatcherBase<typename CacheStore::Arc> {
     return outprops;
   }
 
+  void SetState(StateId s) final {
+    if (s_ == s) return;
+    s_ = s;
+    const auto &tuple = impl_->state_table_->Tuple(s);
+    matcher1_->SetState(tuple.StateId1());
+    matcher2_->SetState(tuple.StateId2());
+    loop_.nextstate = s_;
+  }
+
+  bool Find(Label label) final {
+    bool found = false;
+    current_loop_ = false;
+    if (label == 0) {
+      current_loop_ = true;
+      found = true;
+    }
+    if (match_type_ == MATCH_INPUT) {
+      found = found || FindLabel(label, matcher1_.get(), matcher2_.get());
+    } else {  // match_type_ == MATCH_OUTPUT
+      found = found || FindLabel(label, matcher2_.get(), matcher1_.get());
+    }
+    return found;
+  }
+
+  bool Done() const final {
+    return !current_loop_ && matcher1_->Done() && matcher2_->Done();
+  }
+
+  const Arc &Value() const final { return current_loop_ ? loop_ : arc_; }
+
+  void Next() final {
+    if (current_loop_) {
+      current_loop_ = false;
+    } else if (match_type_ == MATCH_INPUT) {
+      FindNext(matcher1_.get(), matcher2_.get());
+    } else {  // match_type_ == MATCH_OUTPUT
+      FindNext(matcher2_.get(), matcher1_.get());
+    }
+  }
+
+  ssize_t Priority(StateId s) final { return fst_.NumArcs(s); }
+
  private:
   // Processes a match with the filter and creates resulting arc.
-  bool MatchArc(StateId s, Arc arc1, Arc arc2) {
+  bool MatchArc(StateId s, Arc arc1,
+                Arc arc2) {  // FIXME(kbg): copy but not assignment.
     const auto &fs = impl_->filter_->FilterArc(&arc1, &arc2);
     if (fs == FilterState::NoState()) return false;
-    StateTuple tuple(arc1.nextstate, arc2.nextstate, fs);
+    const StateTuple tuple(arc1.nextstate, arc2.nextstate, fs);
     arc_.ilabel = arc1.ilabel;
     arc_.olabel = arc2.olabel;
     arc_.weight = Times(arc1.weight, arc2.weight);
@@ -857,49 +902,6 @@ class ComposeFstMatcher final : public MatcherBase<typename CacheStore::Arc> {
     // Both 'matchera' and 'matcherb' are done, no more match to analyse.
     return false;
   }
-
-  void SetState_(StateId s) override {
-    if (s_ == s) return;
-    s_ = s;
-    const auto tuple = impl_->state_table_->Tuple(s);
-    matcher1_->SetState(tuple.StateId1());
-    matcher2_->SetState(tuple.StateId2());
-    loop_.nextstate = s_;
-  }
-
-  bool Find_(Label label) override {
-    bool found = false;
-    current_loop_ = false;
-    if (label == 0) {
-      current_loop_ = true;
-      found = true;
-    }
-    if (match_type_ == MATCH_INPUT) {
-      found = found || FindLabel(label, matcher1_.get(), matcher2_.get());
-    } else {  // match_type_ == MATCH_OUTPUT
-      found = found || FindLabel(label, matcher2_.get(), matcher1_.get());
-    }
-    return found;
-  }
-
-  bool Done_() const override {
-    return !current_loop_ && matcher1_->Done() && matcher2_->Done();
-  }
-
-  const Arc &Value_() const override { return current_loop_ ? loop_ : arc_; }
-
-  void Next_() override {
-    if (current_loop_) {
-      current_loop_ = false;
-    } else if (match_type_ == MATCH_INPUT) {
-      FindNext(matcher1_.get(), matcher2_.get());
-    } else {  // match_type_ == MATCH_OUTPUT
-      FindNext(matcher2_.get(), matcher1_.get());
-    }
-  }
-
-  ssize_t Priority_(StateId s) override { return fst_.NumArcs(s); }
-
   const ComposeFst<Arc, CacheStore> &fst_;
   const internal::ComposeFstImpl<CacheStore, Filter, StateTable> *impl_;
   StateId s_;
index dbb5486..698326d 100644 (file)
@@ -10,6 +10,8 @@
 #include <string>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/expanded-fst.h>
 #include <fst/fst-decl.h>
 #include <fst/mapped-file.h>
index e579768..adc7280 100644 (file)
@@ -13,6 +13,8 @@
 #include <string>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/arc-map.h>
 #include <fst/bi-table.h>
 #include <fst/cache.h>
index 1d994ba..58f3563 100644 (file)
@@ -29,6 +29,8 @@
 #include <unordered_map>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/cache.h>
 
 
index ddc0468..a9d6313 100644 (file)
@@ -13,6 +13,7 @@
 #include <utility>
 #include <vector>
 
+#include <fst/log.h>
 #include <fstream>
 
 #include <fst/arc-map.h>
index 0605664..06c93d0 100644 (file)
@@ -6,6 +6,8 @@
 #ifndef FST_LIB_EQUAL_H_
 #define FST_LIB_EQUAL_H_
 
+#include <fst/log.h>
+
 #include <fst/fst.h>
 #include <fst/test-properties.h>
 
index 462caff..42a81ec 100644 (file)
@@ -11,6 +11,7 @@
 #include <unordered_map>
 #include <utility>
 #include <vector>
+#include <fst/log.h>
 
 #include <fst/encode.h>
 #include <fst/push.h>
index 08a647b..87c031e 100644 (file)
@@ -10,6 +10,7 @@
 #include <istream>
 #include <string>
 
+#include <fst/log.h>
 #include <fstream>
 
 #include <fst/fst.h>
index b2de6d5..8ffb996 100644 (file)
@@ -19,6 +19,8 @@
 
 #include <string>
 
+#include <fst/log.h>
+
 #include <fst/pair-weight.h>
 #include <fst/product-weight.h>
 
index f2580c4..cd5fedd 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <fst/extensions/compress/compress.h>
 
+#include <fst/log.h>
 #include <fst/util.h>
 #include <fst/script/arg-packs.h>
 #include <fst/script/fst-class.h>
index 7d0056b..34e18f7 100644 (file)
@@ -80,12 +80,11 @@ class FarReaderClassImpl : public FarReaderImplBase {
 
 class FarReaderClass;
 
-typedef args::WithReturnValue<FarReaderClass *, const string &>
-    OpenFarReaderClassArgs1;
-
-typedef args::WithReturnValue<FarReaderClass *, const std::vector<string> &>
-    OpenFarReaderClassArgs2;
+using OpenFarReaderClassArgs1 =
+    args::WithReturnValue<FarReaderClass *, const string &>;
 
+using OpenFarReaderClassArgs2 =
+    args::WithReturnValue<FarReaderClass *, const std::vector<string> &>;
 
 // Untemplated user-facing class holding a templated pimpl.
 class FarReaderClass {
@@ -208,11 +207,10 @@ class FarWriterClassImpl : public FarWriterImplBase {
 
 class FarWriterClass;
 
-typedef args::Package<const string &, FarType> CreateFarWriterClassInnerArgs;
-
-typedef args::WithReturnValue<FarWriterClass *, CreateFarWriterClassInnerArgs>
-    CreateFarWriterClassArgs;
+using CreateFarWriterClassInnerArgs = args::Package<const string &, FarType>;
 
+using CreateFarWriterClassArgs =
+    args::WithReturnValue<FarWriterClass *, CreateFarWriterClassInnerArgs>;
 
 // Untemplated user-facing class holding a templated pimpl.
 class FarWriterClass {
index 49759a5..d883510 100644 (file)
@@ -9,6 +9,7 @@
 #include <iostream>
 #include <sstream>
 
+#include <fst/log.h>
 #include <fst/extensions/far/stlist.h>
 #include <fst/extensions/far/sttable.h>
 #include <fst/fst.h>
 namespace fst {
 
 enum FarEntryType { FET_LINE, FET_FILE };
+
 enum FarTokenType { FTT_SYMBOL, FTT_BYTE, FTT_UTF8 };
 
 inline bool IsFst(const string &filename) {
-  std::ifstream strm(filename.c_str(),
-                          std::ios_base::in | std::ios_base::binary);
+  std::ifstream strm(filename, std::ios_base::in | std::ios_base::binary);
   if (!strm) return false;
   return IsFstHeader(strm, filename);
 }
@@ -30,9 +31,10 @@ inline bool IsFst(const string &filename) {
 // FST archive header class
 class FarHeader {
  public:
-  const string &FarType() const { return fartype_; }
   const string &ArcType() const { return arctype_; }
 
+  const string &FarType() const { return fartype_; }
+
   bool Read(const string &filename) {
     FstHeader fsthdr;
     if (filename.empty()) {
@@ -40,18 +42,18 @@ class FarHeader {
       fartype_ = "stlist";
       arctype_ = "standard";
       return true;
-    } else if (IsSTTable(filename)) {  // Check if STTable
+    } else if (IsSTTable(filename)) {  // Checks if STTable.
       ReadSTTableHeader(filename, &fsthdr);
       fartype_ = "sttable";
       arctype_ = fsthdr.ArcType().empty() ? "unknown" : fsthdr.ArcType();
       return true;
-    } else if (IsSTList(filename)) {  // Check if STList
+    } else if (IsSTList(filename)) {  // Checks if STList.
       ReadSTListHeader(filename, &fsthdr);
       fartype_ = "stlist";
       arctype_ = fsthdr.ArcType().empty() ? "unknown" : fsthdr.ArcType();
       return true;
-    } else if (IsFst(filename)) {  // Check if Fst
-      std::ifstream istrm(filename.c_str(),
+    } else if (IsFst(filename)) {  // Checks if FST.
+      std::ifstream istrm(filename,
                                std::ios_base::in | std::ios_base::binary);
       fsthdr.Read(istrm, filename);
       fartype_ = "fst";
@@ -77,14 +79,14 @@ enum FarType {
 template <class A>
 class FarWriter {
  public:
-  typedef A Arc;
+  using Arc = A;
 
   // Creates a new (empty) FST archive; returns null on error.
   static FarWriter *Create(const string &filename, FarType type = FAR_DEFAULT);
 
   // Adds an FST to the end of an archive. Keys must be non-empty and
   // in lexicographic order. FSTs must have a suitable write method.
-  virtual void Add(const string &key, const Fst<A> &fst) = 0;
+  virtual void Add(const string &key, const Fst<Arc> &fst) = 0;
 
   virtual FarType Type() const = 0;
 
@@ -100,7 +102,7 @@ class FarWriter {
 template <class A>
 class FarReader {
  public:
-  typedef A Arc;
+  using Arc = A;
 
   // Opens an existing FST archive in a single file; returns null on error.
   // Sets current position to the beginning of the achive.
@@ -128,7 +130,7 @@ class FarReader {
 
   // Returns pointer to FST at the current position. This is invalidated if
   // the current position in the archive is changed.
-  virtual const Fst<A> *GetFst() const = 0;
+  virtual const Fst<Arc> *GetFst() const = 0;
 
   virtual FarType Type() const = 0;
 
@@ -140,10 +142,10 @@ class FarReader {
   FarReader() {}
 };
 
-template <class A>
+template <class Arc>
 class FstWriter {
  public:
-  void operator()(std::ostream &strm, const Fst<A> &fst) const {
+  void operator()(std::ostream &strm, const Fst<Arc> &fst) const {
     fst.Write(strm, FstWriteOptions());
   }
 };
@@ -151,15 +153,14 @@ class FstWriter {
 template <class A>
 class STTableFarWriter : public FarWriter<A> {
  public:
-  typedef A Arc;
+  using Arc = A;
 
   static STTableFarWriter *Create(const string &filename) {
-    STTableWriter<Fst<A>, FstWriter<A>> *writer =
-        STTableWriter<Fst<A>, FstWriter<A>>::Create(filename);
+    auto *writer = STTableWriter<Fst<Arc>, FstWriter<Arc>>::Create(filename);
     return new STTableFarWriter(writer);
   }
 
-  void Add(const string &key, const Fst<A> &fst) override {
+  void Add(const string &key, const Fst<Arc> &fst) override {
     writer_->Add(key, fst);
   }
 
@@ -168,42 +169,41 @@ class STTableFarWriter : public FarWriter<A> {
   bool Error() const override { return writer_->Error(); }
 
  private:
-  explicit STTableFarWriter(STTableWriter<Fst<A>, FstWriter<A>> *writer)
+  explicit STTableFarWriter(STTableWriter<Fst<Arc>, FstWriter<Arc>> *writer)
       : writer_(writer) {}
 
-  std::unique_ptr<STTableWriter<Fst<A>, FstWriter<A>>> writer_;
+  std::unique_ptr<STTableWriter<Fst<Arc>, FstWriter<Arc>>> writer_;
 };
 
 template <class A>
 class STListFarWriter : public FarWriter<A> {
  public:
-  typedef A Arc;
+  using Arc = A;
 
   static STListFarWriter *Create(const string &filename) {
-    STListWriter<Fst<A>, FstWriter<A>> *writer =
-        STListWriter<Fst<A>, FstWriter<A>>::Create(filename);
+    auto *writer = STListWriter<Fst<Arc>, FstWriter<Arc>>::Create(filename);
     return new STListFarWriter(writer);
   }
 
-  void Add(const string &key, const Fst<A> &fst) override {
+  void Add(const string &key, const Fst<Arc> &fst) override {
     writer_->Add(key, fst);
   }
 
-  FarType Type() const override { return FAR_STLIST; }
+  constexpr FarType Type() const override { return FAR_STLIST; }
 
   bool Error() const override { return writer_->Error(); }
 
  private:
-  explicit STListFarWriter(STListWriter<Fst<A>, FstWriter<A>> *writer)
+  explicit STListFarWriter(STListWriter<Fst<Arc>, FstWriter<Arc>> *writer)
       : writer_(writer) {}
 
-  std::unique_ptr<STListWriter<Fst<A>, FstWriter<A>>> writer_;
+  std::unique_ptr<STListWriter<Fst<Arc>, FstWriter<Arc>>> writer_;
 };
 
 template <class A>
 class FstFarWriter : public FarWriter<A> {
  public:
-  typedef A Arc;
+  using Arc = A;
 
   explicit FstFarWriter(const string &filename)
       : filename_(filename), error_(false), written_(false) {}
@@ -214,7 +214,7 @@ class FstFarWriter : public FarWriter<A> {
 
   void Add(const string &key, const Fst<A> &fst) override {
     if (written_) {
-      LOG(WARNING) << "FstFarWriter::Add: only one Fst supported,"
+      LOG(WARNING) << "FstFarWriter::Add: only one FST supported,"
                    << " subsequent entries discarded.";
     } else {
       error_ = !fst.Write(filename_);
@@ -222,7 +222,7 @@ class FstFarWriter : public FarWriter<A> {
     }
   }
 
-  FarType Type() const override { return FAR_FST; }
+  constexpr FarType Type() const override { return FAR_FST; }
 
   bool Error() const override { return error_; }
 
@@ -234,47 +234,45 @@ class FstFarWriter : public FarWriter<A> {
   bool written_;
 };
 
-template <class A>
-FarWriter<A> *FarWriter<A>::Create(const string &filename, FarType type) {
+template <class Arc>
+FarWriter<Arc> *FarWriter<Arc>::Create(const string &filename, FarType type) {
   switch (type) {
     case FAR_DEFAULT:
-      if (filename.empty()) return STListFarWriter<A>::Create(filename);
+      if (filename.empty()) return STListFarWriter<Arc>::Create(filename);
     case FAR_STTABLE:
-      return STTableFarWriter<A>::Create(filename);
+      return STTableFarWriter<Arc>::Create(filename);
     case FAR_STLIST:
-      return STListFarWriter<A>::Create(filename);
+      return STListFarWriter<Arc>::Create(filename);
     case FAR_FST:
-      return FstFarWriter<A>::Create(filename);
+      return FstFarWriter<Arc>::Create(filename);
     default:
       LOG(ERROR) << "FarWriter::Create: Unknown FAR type";
       return nullptr;
   }
 }
 
-template <class A>
+template <class Arc>
 class FstReader {
  public:
-  Fst<A> *operator()(std::istream &strm) const {
-    return Fst<A>::Read(strm, FstReadOptions());
+  Fst<Arc> *operator()(std::istream &strm) const {
+    return Fst<Arc>::Read(strm, FstReadOptions());
   }
 };
 
 template <class A>
 class STTableFarReader : public FarReader<A> {
  public:
-  typedef A Arc;
+  using Arc = A;
 
   static STTableFarReader *Open(const string &filename) {
-    STTableReader<Fst<A>, FstReader<A>> *reader =
-        STTableReader<Fst<A>, FstReader<A>>::Open(filename);
-    // TODO: error check
+    auto *reader = STTableReader<Fst<Arc>, FstReader<Arc>>::Open(filename);
+    if (!reader || reader->Error()) return nullptr;
     return new STTableFarReader(reader);
   }
 
   static STTableFarReader *Open(const std::vector<string> &filenames) {
-    STTableReader<Fst<A>, FstReader<A>> *reader =
-        STTableReader<Fst<A>, FstReader<A>>::Open(filenames);
-    // TODO: error check
+    auto *reader = STTableReader<Fst<Arc>, FstReader<Arc>>::Open(filenames);
+    if (!reader || reader->Error()) return nullptr;
     return new STTableFarReader(reader);
   }
 
@@ -288,35 +286,33 @@ class STTableFarReader : public FarReader<A> {
 
   const string &GetKey() const override { return reader_->GetKey(); }
 
-  const Fst<A> *GetFst() const override { return reader_->GetEntry(); }
+  const Fst<Arc> *GetFst() const override { return reader_->GetEntry(); }
 
-  FarType Type() const override { return FAR_STTABLE; }
+  constexpr FarType Type() const override { return FAR_STTABLE; }
 
   bool Error() const override { return reader_->Error(); }
 
  private:
-  explicit STTableFarReader(STTableReader<Fst<A>, FstReader<A>> *reader)
+  explicit STTableFarReader(STTableReader<Fst<Arc>, FstReader<Arc>> *reader)
       : reader_(reader) {}
 
-  std::unique_ptr<STTableReader<Fst<A>, FstReader<A>>> reader_;
+  std::unique_ptr<STTableReader<Fst<Arc>, FstReader<Arc>>> reader_;
 };
 
 template <class A>
 class STListFarReader : public FarReader<A> {
  public:
-  typedef A Arc;
+  using Arc = A;
 
   static STListFarReader *Open(const string &filename) {
-    STListReader<Fst<A>, FstReader<A>> *reader =
-        STListReader<Fst<A>, FstReader<A>>::Open(filename);
-    // TODO: error check
+    auto *reader = STListReader<Fst<Arc>, FstReader<Arc>>::Open(filename);
+    if (!reader || reader->Error()) return nullptr;
     return new STListFarReader(reader);
   }
 
   static STListFarReader *Open(const std::vector<string> &filenames) {
-    STListReader<Fst<A>, FstReader<A>> *reader =
-        STListReader<Fst<A>, FstReader<A>>::Open(filenames);
-    // TODO: error check
+    auto *reader = STListReader<Fst<Arc>, FstReader<Arc>>::Open(filenames);
+    if (!reader || reader->Error()) return nullptr;
     return new STListFarReader(reader);
   }
 
@@ -330,32 +326,32 @@ class STListFarReader : public FarReader<A> {
 
   const string &GetKey() const override { return reader_->GetKey(); }
 
-  const Fst<A> *GetFst() const override { return reader_->GetEntry(); }
+  const Fst<Arc> *GetFst() const override { return reader_->GetEntry(); }
 
-  FarType Type() const override { return FAR_STLIST; }
+  constexpr FarType Type() const override { return FAR_STLIST; }
 
   bool Error() const override { return reader_->Error(); }
 
  private:
-  explicit STListFarReader(STListReader<Fst<A>, FstReader<A>> *reader)
+  explicit STListFarReader(STListReader<Fst<Arc>, FstReader<Arc>> *reader)
       : reader_(reader) {}
 
-  std::unique_ptr<STListReader<Fst<A>, FstReader<A>>> reader_;
+  std::unique_ptr<STListReader<Fst<Arc>, FstReader<Arc>>> reader_;
 };
 
 template <class A>
 class FstFarReader : public FarReader<A> {
  public:
-  typedef A Arc;
+  using Arc = A;
 
   static FstFarReader *Open(const string &filename) {
     std::vector<string> filenames;
     filenames.push_back(filename);
-    return new FstFarReader<A>(filenames);
+    return new FstFarReader<Arc>(filenames);
   }
 
   static FstFarReader *Open(const std::vector<string> &filenames) {
-    return new FstFarReader<A>(filenames);
+    return new FstFarReader<Arc>(filenames);
   }
 
   explicit FstFarReader(const std::vector<string> &filenames)
@@ -369,14 +365,14 @@ class FstFarReader : public FarReader<A> {
           // sources_[i] = "stdin";
           has_stdin_ = true;
         } else {
-          FSTERROR() << "FstFarReader::FstFarReader: stdin should only "
-                     << "appear once in the input file list.";
+          FSTERROR() << "FstFarReader::FstFarReader: standard input should "
+                        "only appear once in the input file list";
           error_ = true;
           return;
         }
       } else {
         streams_[i] = new std::ifstream(
-            keys_[i].c_str(), std::ios_base::in | std::ios_base::binary);
+            keys_[i], std::ios_base::in | std::ios_base::binary);
       }
     }
     if (pos_ >= keys_.size()) return;
@@ -385,7 +381,8 @@ class FstFarReader : public FarReader<A> {
 
   void Reset() override {
     if (has_stdin_) {
-      FSTERROR() << "FstFarReader::Reset: Operation not supported on stdin";
+      FSTERROR()
+          << "FstFarReader::Reset: Operation not supported on standard input";
       error_ = true;
       return;
     }
@@ -395,7 +392,8 @@ class FstFarReader : public FarReader<A> {
 
   bool Find(const string &key) override {
     if (has_stdin_) {
-      FSTERROR() << "FstFarReader::Find: Operation not supported on stdin";
+      FSTERROR()
+          << "FstFarReader::Find: Operation not supported on standard input";
       error_ = true;
       return false;
     }
@@ -413,9 +411,9 @@ class FstFarReader : public FarReader<A> {
 
   const string &GetKey() const override { return keys_[pos_]; }
 
-  const Fst<A> *GetFst() const override { return fst_.get(); }
+  const Fst<Arc> *GetFst() const override { return fst_.get(); }
 
-  FarType Type() const override { return FAR_FST; }
+  constexpr FarType Type() const override { return FAR_FST; }
 
   bool Error() const override { return error_; }
 
@@ -432,7 +430,7 @@ class FstFarReader : public FarReader<A> {
     fst_.reset();
     if (pos_ >= keys_.size()) return;
     streams_[pos_]->seekg(0);
-    fst_.reset(Fst<A>::Read(*streams_[pos_], FstReadOptions()));
+    fst_.reset(Fst<Arc>::Read(*streams_[pos_], FstReadOptions()));
     if (!fst_) {
       FSTERROR() << "FstFarReader: Error reading Fst from: " << keys_[pos_];
       error_ = true;
@@ -443,33 +441,33 @@ class FstFarReader : public FarReader<A> {
   std::vector<std::istream *> streams_;
   bool has_stdin_;
   size_t pos_;
-  mutable std::unique_ptr<Fst<A>> fst_;
+  mutable std::unique_ptr<Fst<Arc>> fst_;
   mutable bool error_;
 };
 
-template <class A>
-FarReader<A> *FarReader<A>::Open(const string &filename) {
+template <class Arc>
+FarReader<Arc> *FarReader<Arc>::Open(const string &filename) {
   if (filename.empty())
-    return STListFarReader<A>::Open(filename);
+    return STListFarReader<Arc>::Open(filename);
   else if (IsSTTable(filename))
-    return STTableFarReader<A>::Open(filename);
+    return STTableFarReader<Arc>::Open(filename);
   else if (IsSTList(filename))
-    return STListFarReader<A>::Open(filename);
+    return STListFarReader<Arc>::Open(filename);
   else if (IsFst(filename))
-    return FstFarReader<A>::Open(filename);
+    return FstFarReader<Arc>::Open(filename);
   return nullptr;
 }
 
-template <class A>
-FarReader<A> *FarReader<A>::Open(const std::vector<string> &filenames) {
+template <class Arc>
+FarReader<Arc> *FarReader<Arc>::Open(const std::vector<string> &filenames) {
   if (!filenames.empty() && filenames[0].empty())
-    return STListFarReader<A>::Open(filenames);
+    return STListFarReader<Arc>::Open(filenames);
   else if (!filenames.empty() && IsSTTable(filenames[0]))
-    return STTableFarReader<A>::Open(filenames);
+    return STTableFarReader<Arc>::Open(filenames);
   else if (!filenames.empty() && IsSTList(filenames[0]))
-    return STListFarReader<A>::Open(filenames);
+    return STListFarReader<Arc>::Open(filenames);
   else if (!filenames.empty() && IsFst(filenames[0]))
-    return FstFarReader<A>::Open(filenames);
+    return FstFarReader<Arc>::Open(filenames);
   return nullptr;
 }
 
index 5e28916..fcb80d0 100644 (file)
 
 namespace fst {
 
-static const int32 kSTListMagicNumber = 5656924;
-static const int32 kSTListFileVersion = 1;
+static constexpr int32 kSTListMagicNumber = 5656924;
+static constexpr int32 kSTListFileVersion = 1;
 
 // String-type list writing class for object of type T using a functor Writer.
-// Write must provide at least the following interface:
+// The Writer functor must provide at least the following interface:
 //
 //   struct Writer {
 //     void operator()(std::ostream &, const T &) const;
@@ -37,7 +37,7 @@ class STListWriter {
  public:
   explicit STListWriter(const string &filename)
       : stream_(filename.empty() ? &std::cout : new std::ofstream(
-                                                    filename.c_str(),
+                                                    filename,
                                                     std::ios_base::out |
                                                         std::ios_base::binary)),
         error_(false) {
@@ -76,7 +76,7 @@ class STListWriter {
   }
 
  private:
-  Writer entry_writer_;   // Write functor.
+  Writer entry_writer_;
   std::ostream *stream_;  // Output stream.
   string last_key_;       // Last key.
   bool error_;
@@ -112,10 +112,11 @@ class STListReader {
         }
       } else {
         streams_[i] = new std::ifstream(
-            filenames[i].c_str(), std::ios_base::in | std::ios_base::binary);
+            filenames[i], std::ios_base::in | std::ios_base::binary);
       }
-      int32 magic_number = 0, file_version = 0;
+      int32 magic_number = 0;
       ReadType(*streams_[i], &magic_number);
+      int32 file_version = 0;
       ReadType(*streams_[i], &file_version);
       if (magic_number != kSTListMagicNumber) {
         FSTERROR() << "STListReader::STListReader: Wrong file type: "
@@ -165,13 +166,12 @@ class STListReader {
   }
 
   void Reset() {
-    FSTERROR()
-        << "STListReader::Reset: stlist does not support reset operation";
+    FSTERROR() << "STListReader::Reset: Operation not supported";
     error_ = true;
   }
 
   bool Find(const string &key) {
-    FSTERROR() << "STListReader::Find: stlist does not support find operation";
+    FSTERROR() << "STListReader::Find: Operation not supported";
     error_ = true;
     return false;
   }
@@ -221,25 +221,26 @@ class STListReader {
   STListReader &operator=(const STListReader &) = delete;
 };
 
-// String-type list header reading function template on the entry header
-// type Header having a member function:
+// String-type list header reading function, templated on the entry header type.
+// The Header type must provide at least the following interface:
 //
-//   Read(std::istream &strm, const string &filename);
-//
-// Checks that the input filename is an STList and calls Header::Read() on the
-// last
-// entry in the STList. Reading from standard input is not supported.
+//  struct Header {
+//    void Read(std::istream &strm, const string &filename);
+//  };
 template <class Header>
 bool ReadSTListHeader(const string &filename, Header *header) {
   if (filename.empty()) {
     LOG(ERROR) << "ReadSTListHeader: Can't read header from standard input";
     return false;
   }
-  std::ifstream strm(filename.c_str(),
-                          std::ios_base::in | std::ios_base::binary);
+  std::ifstream strm(filename, std::ios_base::in | std::ios_base::binary);
+  if (!strm) {
+    LOG(ERROR) << "ReadSTListHeader: Could not open file: " << filename;
+    return false;
+  }
   int32 magic_number = 0;
-  int32 file_version = 0;
   ReadType(strm, &magic_number);
+  int32 file_version = 0;
   ReadType(strm, &file_version);
   if (magic_number != kSTListMagicNumber) {
     LOG(ERROR) << "ReadSTListHeader: Wrong file type: " << filename;
index 14a3426..41f3475 100644 (file)
 
 namespace fst {
 
-static const int32 kSTTableMagicNumber = 2125656924;
-static const int32 kSTTableFileVersion = 1;
+static constexpr int32 kSTTableMagicNumber = 2125656924;
+static constexpr int32 kSTTableFileVersion = 1;
 
-// String-to-type table writing class for object of type 'T' using functor 'W'
-// to write an object of type 'T' from a stream. 'W' must conform to the
-// following interface:
+// String-type table writing class for an object of type T using a functor
+// Writer. The Writer functor must provide at least the following interface:
 //
 //   struct Writer {
 //     void operator()(std::ostream &, const T &) const;
 //   };
-//
-template <class T, class W>
+template <class T, class Writer>
 class STTableWriter {
  public:
-  typedef T EntryType;
-  typedef W EntryWriter;
-
   explicit STTableWriter(const string &filename)
-      : stream_(filename.c_str(), std::ios_base::out | std::ios_base::binary),
+      : stream_(filename, std::ios_base::out | std::ios_base::binary),
         error_(false) {
     WriteType(stream_, kSTTableMagicNumber);
     WriteType(stream_, kSTTableFileVersion);
@@ -48,12 +43,12 @@ class STTableWriter {
     }
   }
 
-  static STTableWriter<T, W> *Create(const string &filename) {
+  static STTableWriter<T, Writer> *Create(const string &filename) {
     if (filename.empty()) {
       LOG(ERROR) << "STTableWriter: Writing to standard out unsupported.";
       return nullptr;
     }
-    return new STTableWriter<T, W>(filename);
+    return new STTableWriter<T, Writer>(filename);
   }
 
   void Add(const string &key, const T &t) {
@@ -79,30 +74,26 @@ class STTableWriter {
   }
 
  private:
-  EntryWriter entry_writer_;      // Write functor for 'EntryType'
-  std::ofstream stream_;    // Output stream
-  std::vector<int64> positions_;  // Position in file of each key-entry pair
-  string last_key_;               // Last key
+  Writer entry_writer_;
+  std::ofstream stream_;
+  std::vector<int64> positions_;  // Position in file of each key-entry pair.
+  string last_key_;               // Last key.
   bool error_;
 
   STTableWriter(const STTableWriter &) = delete;
   STTableWriter &operator=(const STTableWriter &) = delete;
 };
 
-// String-to-type table reading class for object of type 'T' using functor 'R'
-// to read an object of type 'T' form a stream. 'R' must conform to the
-// following interface:
+// String-type table reading class for object of type T using a functor Reader.
+// Reader must provide at least the following interface:
 //
 //   struct Reader {
 //     T *operator()(std::istream &) const;
 //   };
 //
-template <class T, class R>
+template <class T, class Reader>
 class STTableReader {
  public:
-  typedef T EntryType;
-  typedef R EntryReader;
-
   explicit STTableReader(const std::vector<string> &filenames)
       : sources_(filenames), error_(false) {
     compare_.reset(new Compare(&keys_));
@@ -111,9 +102,10 @@ class STTableReader {
     positions_.resize(filenames.size());
     for (size_t i = 0; i < filenames.size(); ++i) {
       streams_[i] = new std::ifstream(
-          filenames[i].c_str(), std::ios_base::in | std::ios_base::binary);
-      int32 magic_number = 0, file_version = 0;
+          filenames[i], std::ios_base::in | std::ios_base::binary);
+      int32 magic_number = 0;
       ReadType(*streams_[i], &magic_number);
+      int32 file_version = 0;
       ReadType(*streams_[i], &file_version);
       if (magic_number != kSTTableMagicNumber) {
         FSTERROR() << "STTableReader::STTableReader: Wrong file type: "
@@ -128,14 +120,15 @@ class STTableReader {
         return;
       }
       int64 num_entries;
-      streams_[i]->seekg(-static_cast<int>(sizeof(int64)), ios_base::end);
+      streams_[i]->seekg(-static_cast<int>(sizeof(int64)), std::ios_base::end);
       ReadType(*streams_[i], &num_entries);
       if (num_entries > 0) {
         streams_[i]->seekg(-static_cast<int>(sizeof(int64)) * (num_entries + 1),
-                           ios_base::end);
+                           std::ios_base::end);
         positions_[i].resize(num_entries);
-        for (size_t j = 0; (j < num_entries) && (!streams_[i]->fail()); ++j)
+        for (size_t j = 0; (j < num_entries) && (!streams_[i]->fail()); ++j) {
           ReadType(*streams_[i], &(positions_[i][j]));
+        }
         streams_[i]->seekg(positions_[i][0]);
         if (streams_[i]->fail()) {
           FSTERROR() << "STTableReader::STTableReader: Error reading file: "
@@ -149,21 +142,21 @@ class STTableReader {
   }
 
   ~STTableReader() {
-    for (size_t i = 0; i < streams_.size(); ++i) delete streams_[i];
+    for (auto &stream : streams_) delete stream;
   }
 
-  static STTableReader<T, R> *Open(const string &filename) {
+  static STTableReader<T, Reader> *Open(const string &filename) {
     if (filename.empty()) {
-      LOG(ERROR) << "STTableReader: operation not supported on stdin";
+      LOG(ERROR) << "STTableReader: Operation not supported on standard input";
       return nullptr;
     }
     std::vector<string> filenames;
     filenames.push_back(filename);
-    return new STTableReader<T, R>(filenames);
+    return new STTableReader<T, Reader>(filenames);
   }
 
-  static STTableReader<T, R> *Open(const std::vector<string> &filenames) {
-    return new STTableReader<T, R>(filenames);
+  static STTableReader<T, Reader> *Open(const std::vector<string> &filenames) {
+    return new STTableReader<T, Reader>(filenames);
   }
 
   void Reset() {
@@ -202,14 +195,14 @@ class STTableReader {
 
   const string &GetKey() const { return keys_[current_]; }
 
-  const EntryType *GetEntry() const { return entry_.get(); }
+  const T *GetEntry() const { return entry_.get(); }
 
   bool Error() const { return error_; }
 
  private:
-  // Comparison functor used to compare stream IDs in the heap
+  // Comparison functor used to compare stream IDs in the heap.
   struct Compare {
-    explicit Compare(const std::vector<string> *k) : keys(k) {}
+    explicit Compare(const std::vector<string> *keys) : keys(keys) {}
 
     bool operator()(size_t i, size_t j) const {
       return (*keys)[i] > (*keys)[j];
@@ -219,15 +212,14 @@ class STTableReader {
     const std::vector<string> *keys;
   };
 
-  // Position the stream with ID 'id' at the position corresponding
-  // to the lower bound for key 'find_key'
+  // Positions the stream at the position corresponding to the lower bound for
+  // the specified key.
   void LowerBound(size_t id, const string &find_key) {
-    std::istream *strm = streams_[id];
-    const std::vector<int64> &positions = positions_[id];
+    auto *strm = streams_[id];
+    const auto &positions = positions_[id];
     if (positions.empty()) return;
     size_t low = 0;
     size_t high = positions.size() - 1;
-
     while (low < high) {
       size_t mid = (low + high) / 2;
       strm->seekg(positions[mid]);
@@ -253,7 +245,7 @@ class STTableReader {
     strm->seekg(positions[low]);
   }
 
-  // Add all streams to the heap
+  // Adds all streams to the heap.
   void MakeHeap() {
     heap_.clear();
     for (size_t i = 0; i < streams_.size(); ++i) {
@@ -271,9 +263,9 @@ class STTableReader {
     PopHeap();
   }
 
-  // Position the stream with the lowest key at the top
-  // of the heap, set 'current_' to the ID of that stream
-  // and read the current entry from that stream
+  // Positions the stream with the lowest key at the top of the heap, sets
+  // current_ to the ID of that stream, and reads the current entry from that
+  // stream.
   void PopHeap() {
     std::pop_heap(heap_.begin(), heap_.end(), *compare_);
     current_ = heap_.back();
@@ -286,29 +278,38 @@ class STTableReader {
     }
   }
 
-  EntryReader entry_reader_;                   // Read functor for 'EntryType'
-  std::vector<std::istream *> streams_;        // Input streams
-  std::vector<string> sources_;                // and corresponding file names
-  std::vector<std::vector<int64>> positions_;  // Index of positions
-  std::vector<string> keys_;  // Lowest unread key for each stream
-  std::vector<int64> heap_;   // Heap containing ID of streams with unread keys
-  int64 current_;             // Id of current stream to be read
-  std::unique_ptr<Compare> compare_;          // Functor comparing stream IDs
-  mutable std::unique_ptr<EntryType> entry_;  // the currently read entry
+  Reader entry_reader_;
+  std::vector<std::istream *> streams_;        // Input streams.
+  std::vector<string> sources_;                // Corresponding file names.
+  std::vector<std::vector<int64>> positions_;  // Index of positions.
+  std::vector<string> keys_;  // Lowest unread key for each stream.
+  std::vector<int64> heap_;   // Heap containing ID of streams with unread keys.
+  int64 current_;             // ID of current stream to be read.
+  std::unique_ptr<Compare> compare_;  // Functor comparing stream IDs.
+  mutable std::unique_ptr<T> entry_;  // The currently read entry.
   bool error_;
 };
 
-// String-to-type table header reading function template on the entry header
-// type 'H' having a member function:
-//   Read(std::istream &strm, const string &filename);
-// Checks that 'filename' is an STTable and call the H::Read() on the last
-// entry in the STTable.
-template <class H>
-bool ReadSTTableHeader(const string &filename, H *header) {
-  std::ifstream strm(filename);
+// String-type table header reading function template on the entry header type.
+// The Header type must provide at least the following interface:
+//
+//   struct Header {
+//     void Read(std::istream &istrm, const string &filename);
+//   };
+template <class Header>
+bool ReadSTTableHeader(const string &filename, Header *header) {
+  if (filename.empty()) {
+    LOG(ERROR) << "ReadSTTable: Can't read header from standard input";
+    return false;
+  }
+  std::ifstream strm(filename, std::ios_base::in | std::ios_base::binary);
+  if (!strm) {
+    LOG(ERROR) << "ReadSTTableHeader: Could not open file: " << filename;
+    return false;
+  }
   int32 magic_number = 0;
-  int32 file_version = 0;
   ReadType(strm, &magic_number);
+  int32 file_version = 0;
   ReadType(strm, &file_version);
   if (magic_number != kSTTableMagicNumber) {
     LOG(ERROR) << "ReadSTTableHeader: Wrong file type: " << filename;
@@ -319,15 +320,15 @@ bool ReadSTTableHeader(const string &filename, H *header) {
     return false;
   }
   int64 i = -1;
-  strm.seekg(-static_cast<int>(sizeof(int64)), ios_base::end);
-  ReadType(strm, &i);  // Read number of entries
+  strm.seekg(-static_cast<int>(sizeof(int64)), std::ios_base::end);
+  ReadType(strm, &i);  // Reads number of entries
   if (strm.fail()) {
     LOG(ERROR) << "ReadSTTableHeader: Error reading file: " << filename;
     return false;
   }
-  if (i == 0) return true;  // No entry header to read
-  strm.seekg(-2 * static_cast<int>(sizeof(int64)), ios_base::end);
-  ReadType(strm, &i);  // Read position for last entry in file
+  if (i == 0) return true;  // No entry header to read.
+  strm.seekg(-2 * static_cast<int>(sizeof(int64)), std::ios_base::end);
+  ReadType(strm, &i);  // Reads position for last entry in file.
   strm.seekg(i);
   string key;
   ReadType(strm, &key);
index 2774074..a6ac727 100644 (file)
@@ -13,6 +13,7 @@
 #include <vector>
 
 #include <fst/compat.h>
+#include <fst/log.h>
 #include <fst/fst.h>
 #include <fst/symbol-table.h>
 #include <fst/util.h>
index f347656..a837087 100644 (file)
@@ -12,6 +12,7 @@
 #include <vector>
 
 #include <fst/compat.h>
+#include <fst/log.h>
 #include <fst/extensions/pdt/collection.h>
 #include <fst/bi-table.h>
 #include <fst/cache.h>
@@ -1079,7 +1080,7 @@ class LinearFstMatcherTpl : public MatcherBase<typename F::Arc> {
     return match_type_ == MATCH_INPUT ? match_type_ : MATCH_NONE;
   }
 
-  void SetState(StateId s) {
+  void SetState(StateId s) final {
     if (s_ == s) return;
     s_ = s;
     // `MATCH_INPUT` is the only valid type
@@ -1090,7 +1091,7 @@ class LinearFstMatcherTpl : public MatcherBase<typename F::Arc> {
     loop_.nextstate = s;
   }
 
-  bool Find(Label label) {
+  bool Find(Label label) final {
     if (error_) {
       current_loop_ = false;
       return false;
@@ -1103,18 +1104,22 @@ class LinearFstMatcherTpl : public MatcherBase<typename F::Arc> {
     return current_loop_ || !arcs_.empty();
   }
 
-  bool Done() const { return !(current_loop_ || cur_arc_ < arcs_.size()); }
+  bool Done() const final {
+    return !(current_loop_ || cur_arc_ < arcs_.size());
+  }
 
-  const Arc &Value() const { return current_loop_ ? loop_ : arcs_[cur_arc_]; }
+  const Arc &Value() const final {
+    return current_loop_ ? loop_ : arcs_[cur_arc_];
+  }
 
-  void Next() {
+  void Next() final {
     if (current_loop_)
       current_loop_ = false;
     else
       ++cur_arc_;
   }
 
-  ssize_t Priority_(StateId s) override { return kRequirePriority; }
+  ssize_t Priority(StateId s) final { return kRequirePriority; }
 
   const FST &GetFst() const override { return *fst_; }
 
@@ -1126,16 +1131,6 @@ class LinearFstMatcherTpl : public MatcherBase<typename F::Arc> {
   uint32 Flags() const override { return kRequireMatch; }
 
  private:
-  void SetState_(StateId s) override { SetState(s); }
-
-  bool Find_(Label label) override { return Find(label); }
-
-  bool Done_() const override { return Done(); }
-
-  const Arc &Value_() const override { return Value(); }
-
-  void Next_() override { Next(); }
-
   std::unique_ptr<const FST> fst_;
   MatchType match_type_;  // Type of match to perform.
   StateId s_;             // Current state.
index 319f140..77ff757 100644 (file)
@@ -7,6 +7,7 @@
 #define FST_EXTENSIONS_MPDT_MPDT_H_
 
 #include <array>
+#include <functional>
 #include <map>
 #include <vector>
 
@@ -92,7 +93,7 @@ template <typename Level>
 struct KeyPairHasher {
   inline size_t operator()(const KeyPair<Level> &keypair) const {
     return std::hash<Level>()(keypair.level) ^
-           (hash<size_t>()(keypair.underlying_id) << 1);
+           (std::hash<size_t>()(keypair.underlying_id) << 1);
   }
 };
 
index 5371c06..e5dc783 100644 (file)
@@ -11,6 +11,7 @@
 #include <utility>
 #include <vector>
 
+#include <fst/log.h>
 #include <fst/compose.h>  // for ComposeOptions
 #include <fst/util.h>
 
index ad783b5..e66a620 100644 (file)
@@ -17,6 +17,7 @@
 #include <vector>
 
 #include <fst/compat.h>
+#include <fst/log.h>
 #include <fstream>
 #include <fst/extensions/ngram/bitmap-index.h>
 #include <fst/fstlib.h>
@@ -829,13 +830,12 @@ class NGramFstMatcher : public MatcherBase<A> {
 
   uint64 Properties(uint64 props) const override { return props; }
 
- private:
-  void SetState_(StateId s) override {
+  void SetState(StateId s) final {
     fst_.GetImpl()->SetInstFuture(s, &inst_);
     current_loop_ = false;
   }
 
-  bool Find_(Label label) override {
+  bool Find(Label label) final {
     const Label nolabel = kNoLabel;
     done_ = true;
     if (label == 0 || label == nolabel) {
@@ -867,14 +867,14 @@ class NGramFstMatcher : public MatcherBase<A> {
         done_ = false;
       }
     }
-    return !Done_();
+    return !Done();
   }
 
-  bool Done_() const override { return !current_loop_ && done_; }
+  bool Done() const final { return !current_loop_ && done_; }
 
-  const Arc &Value_() const override { return (current_loop_) ? loop_ : arc_; }
+  const Arc &Value() const final { return (current_loop_) ? loop_ : arc_; }
 
-  void Next_() override {
+  void Next() final {
     if (current_loop_) {
       current_loop_ = false;
     } else {
@@ -882,8 +882,9 @@ class NGramFstMatcher : public MatcherBase<A> {
     }
   }
 
-  ssize_t Priority_(StateId s) override { return fst_.NumArcs(s); }
+  ssize_t Priority(StateId s) final { return fst_.NumArcs(s); }
 
+ private:
   const NGramFst<A> &fst_;
   NGramFstInst<A> inst_;
   MatchType match_type_;  // Supplied by caller
@@ -898,20 +899,20 @@ class NGramFstMatcher : public MatcherBase<A> {
 // for sample usage (but use the ProdLmFst type!). This version
 // should inline.
 template <class A>
-class StateIterator<NGramFst<A>> final : public StateIteratorBase<A> {
+class StateIterator<NGramFst<A>> : public StateIteratorBase<A> {
  public:
   typedef typename A::StateId StateId;
 
   explicit StateIterator(const NGramFst<A> &fst)
       : s_(0), num_states_(fst.NumStates()) {}
 
-  bool Done() const override { return s_ >= num_states_; }
+  bool Done() const final { return s_ >= num_states_; }
 
-  StateId Value() const override { return s_; }
+  StateId Value() const final { return s_; }
 
-  void Next() override { ++s_; }
+  void Next() final { ++s_; }
 
-  void Reset() override { s_ = 0; }
+  void Reset() final { s_ = 0; }
 
  private:
   StateId s_;
@@ -920,7 +921,7 @@ class StateIterator<NGramFst<A>> final : public StateIteratorBase<A> {
 
 /*****************************************************************************/
 template <class A>
-class ArcIterator<NGramFst<A>> final : public ArcIteratorBase<A> {
+class ArcIterator<NGramFst<A>> : public ArcIteratorBase<A> {
  public:
   typedef A Arc;
   typedef typename A::Label Label;
@@ -934,12 +935,12 @@ class ArcIterator<NGramFst<A>> final : public ArcIteratorBase<A> {
     impl_->SetInstNode(&inst_);
   }
 
-  bool Done() const override {
+  bool Done() const final {
     return i_ >=
            ((inst_.node_ == 0) ? inst_.num_futures_ : inst_.num_futures_ + 1);
   }
 
-  const Arc &Value() const override {
+  const Arc &Value() const final {
     bool eps = (inst_.node_ != 0 && i_ == 0);
     StateId state = (inst_.node_ == 0) ? i_ : i_ - 1;
     if (flags_ & lazy_ & (kArcILabelValue | kArcOLabelValue)) {
@@ -969,28 +970,28 @@ class ArcIterator<NGramFst<A>> final : public ArcIteratorBase<A> {
     return arc_;
   }
 
-  void Next() override {
+  void Next() final {
     ++i_;
     lazy_ = ~0;
   }
 
-  size_t Position() const override { return i_; }
+  size_t Position() const final { return i_; }
 
-  void Reset() override {
+  void Reset() final {
     i_ = 0;
     lazy_ = ~0;
   }
 
-  void Seek(size_t a) override {
+  void Seek(size_t a) final {
     if (i_ != a) {
       i_ = a;
       lazy_ = ~0;
     }
   }
 
-  uint32 Flags() const override { return flags_; }
+  uint32 Flags() const final { return flags_; }
 
-  void SetFlags(uint32 flags, uint32 mask) override {
+  void SetFlags(uint32 flags, uint32 mask) final {
     flags_ &= ~mask;
     flags_ |= (flags & kArcValueFlags);
   }
index be1b5c9..ae34aba 100644 (file)
@@ -9,6 +9,7 @@
 #include <functional>
 #include <vector>
 
+#include <fst/log.h>
 #include <fst/bi-table.h>
 
 namespace fst {
index 47fa823..eeee781 100644 (file)
@@ -9,6 +9,8 @@
 #include <forward_list>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/extensions/pdt/paren.h>
 #include <fst/extensions/pdt/pdt.h>
 #include <fst/extensions/pdt/reverse.h>
index dd3dfa3..0347848 100644 (file)
@@ -11,6 +11,8 @@
 #include <unordered_map>
 #include <unordered_set>
 
+#include <fst/log.h>
+
 #include <fst/extensions/pdt/collection.h>
 #include <fst/extensions/pdt/pdt.h>
 #include <fst/dfs-visit.h>
index 2850449..a859ab5 100644 (file)
@@ -11,6 +11,7 @@
 #include <unordered_map>
 
 #include <fst/compat.h>
+#include <fst/log.h>
 #include <fst/fst.h>
 #include <fst/state-table.h>
 
index 2f4bdd2..d73e136 100644 (file)
@@ -11,6 +11,7 @@
 #include <utility>
 #include <vector>
 
+#include <fst/log.h>
 #include <fst/compose.h>  // for ComposeOptions
 #include <fst/util.h>
 
index 470e71b..591c1ea 100644 (file)
@@ -11,6 +11,8 @@
 #include <utility>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/extensions/pdt/paren.h>
 #include <fst/extensions/pdt/pdt.h>
 #include <fst/shortest-path.h>
index 7151cd6..4e7be95 100644 (file)
@@ -78,7 +78,7 @@ class PhiFstMatcherData {
 constexpr uint8 kPhiFstMatchInput = 0x01;   // Input matcher is PhiMatcher.
 constexpr uint8 kPhiFstMatchOutput = 0x02;  // Output matcher is PhiMatcher.
 
-template <class M, uint8 F = kPhiFstMatchInput | kPhiFstMatchOutput>
+template <class M, uint8 flags = kPhiFstMatchInput | kPhiFstMatchOutput>
 class PhiFstMatcher : public PhiMatcher<M> {
  public:
   using FST = typename M::FST;
@@ -88,6 +88,8 @@ class PhiFstMatcher : public PhiMatcher<M> {
   using Weight = typename Arc::Weight;
   using MatcherData = internal::PhiFstMatcherData<Label>;
 
+  enum : uint8 { kFlags = flags };
+
   PhiFstMatcher(const FST &fst, MatchType match_type,
       std::shared_ptr<MatcherData> data = std::make_shared<MatcherData>())
       : PhiMatcher<M>(fst, match_type,
@@ -97,11 +99,11 @@ class PhiFstMatcher : public PhiMatcher<M> {
                       data ? data->RewriteMode() : MatcherData().RewriteMode()),
         data_(data) {}
 
-  PhiFstMatcher(const PhiFstMatcher<M, F> &matcher, bool safe = false)
+  PhiFstMatcher(const PhiFstMatcher<M, flags> &matcher, bool safe = false)
       : PhiMatcher<M>(matcher, false), data_(matcher.data_) {}
 
-  PhiFstMatcher<M, F> *Copy(bool safe = false) const override {
-    return new PhiFstMatcher<M, F>(*this, safe);
+  PhiFstMatcher<M, flags> *Copy(bool safe = false) const override {
+    return new PhiFstMatcher<M, flags>(*this, safe);
   }
 
   const MatcherData *GetData() const { return data_.get(); }
@@ -110,8 +112,8 @@ class PhiFstMatcher : public PhiMatcher<M> {
 
  private:
   static Label PhiLabel(MatchType match_type, Label label) {
-    if (match_type == MATCH_INPUT && F & kPhiFstMatchInput) return label;
-    if (match_type == MATCH_OUTPUT && F & kPhiFstMatchOutput) return label;
+    if (match_type == MATCH_INPUT && flags & kPhiFstMatchInput) return label;
+    if (match_type == MATCH_OUTPUT && flags & kPhiFstMatchOutput) return label;
     return kNoLabel;
   }
 
index 16bfeb9..1f87663 100644 (file)
@@ -67,7 +67,7 @@ class RhoFstMatcherData {
 constexpr uint8 kRhoFstMatchInput = 0x01;   // Input matcher is RhoMatcher.
 constexpr uint8 kRhoFstMatchOutput = 0x02;  // Output matcher is RhoMatcher.
 
-template <class M, uint8 F = kRhoFstMatchInput | kRhoFstMatchOutput>
+template <class M, uint8 flags = kRhoFstMatchInput | kRhoFstMatchOutput>
 class RhoFstMatcher : public RhoMatcher<M> {
  public:
   using FST = typename M::FST;
@@ -77,6 +77,8 @@ class RhoFstMatcher : public RhoMatcher<M> {
   using Weight = typename Arc::Weight;
   using MatcherData = internal::RhoFstMatcherData<Label>;
 
+  enum : uint8 { kFlags = flags };
+
   RhoFstMatcher(
       const FST &fst, MatchType match_type,
       std::shared_ptr<MatcherData> data = std::make_shared<MatcherData>())
@@ -86,11 +88,11 @@ class RhoFstMatcher : public RhoMatcher<M> {
                       data ? data->RewriteMode() : MatcherData().RewriteMode()),
         data_(data) {}
 
-  RhoFstMatcher(const RhoFstMatcher<M, F> &matcher, bool safe = false)
+  RhoFstMatcher(const RhoFstMatcher<M, flags> &matcher, bool safe = false)
       : RhoMatcher<M>(matcher, false), data_(matcher.data_) {}
 
-  RhoFstMatcher<M, F> *Copy(bool safe = false) const override {
-    return new RhoFstMatcher<M, F>(*this, safe);
+  RhoFstMatcher<M, flags> *Copy(bool safe = false) const override {
+    return new RhoFstMatcher<M, flags>(*this, safe);
   }
 
   const MatcherData *GetData() const { return data_.get(); }
@@ -99,8 +101,8 @@ class RhoFstMatcher : public RhoMatcher<M> {
 
  private:
   static Label RhoLabel(MatchType match_type, Label label) {
-    if (match_type == MATCH_INPUT && F & kRhoFstMatchInput) return label;
-    if (match_type == MATCH_OUTPUT && F & kRhoFstMatchOutput) return label;
+    if (match_type == MATCH_INPUT && flags & kRhoFstMatchInput) return label;
+    if (match_type == MATCH_OUTPUT && flags & kRhoFstMatchOutput) return label;
     return kNoLabel;
   }
 
index 8795d7d..9ab8fe4 100644 (file)
@@ -67,7 +67,7 @@ class SigmaFstMatcherData {
 constexpr uint8 kSigmaFstMatchInput = 0x01;   // Input matcher is SigmaMatcher.
 constexpr uint8 kSigmaFstMatchOutput = 0x02;  // Output matcher is SigmaMatcher.
 
-template <class M, uint8 F = kSigmaFstMatchInput | kSigmaFstMatchOutput>
+template <class M, uint8 flags = kSigmaFstMatchInput | kSigmaFstMatchOutput>
 class SigmaFstMatcher : public SigmaMatcher<M> {
  public:
   using FST = typename M::FST;
@@ -77,6 +77,8 @@ class SigmaFstMatcher : public SigmaMatcher<M> {
   using Weight = typename Arc::Weight;
   using MatcherData = internal::SigmaFstMatcherData<Label>;
 
+  enum : uint8 { kFlags = flags };
+
   SigmaFstMatcher(
       const FST &fst, MatchType match_type,
       std::shared_ptr<MatcherData> data = std::make_shared<MatcherData>())
@@ -87,11 +89,11 @@ class SigmaFstMatcher : public SigmaMatcher<M> {
             data ? data->RewriteMode() : MatcherData().RewriteMode()),
         data_(data) {}
 
-  SigmaFstMatcher(const SigmaFstMatcher<M, F> &matcher, bool safe = false)
+  SigmaFstMatcher(const SigmaFstMatcher<M, flags> &matcher, bool safe = false)
       : SigmaMatcher<M>(matcher, false), data_(matcher.data_) {}
 
-  SigmaFstMatcher<M, F> *Copy(bool safe = false) const override {
-    return new SigmaFstMatcher<M, F>(*this, safe);
+  SigmaFstMatcher<M, flags> *Copy(bool safe = false) const override {
+    return new SigmaFstMatcher<M, flags>(*this, safe);
   }
 
   const MatcherData *GetData() const { return data_.get(); }
@@ -100,8 +102,9 @@ class SigmaFstMatcher : public SigmaMatcher<M> {
 
  private:
   static Label SigmaLabel(MatchType match_type, Label label) {
-    if (match_type == MATCH_INPUT && F & kSigmaFstMatchInput) return label;
-    if (match_type == MATCH_OUTPUT && F & kSigmaFstMatchOutput) return label;
+    if (match_type == MATCH_INPUT && flags & kSigmaFstMatchInput) return label;
+    if (match_type == MATCH_OUTPUT && flags & kSigmaFstMatchOutput)
+      return label;
     return kNoLabel;
   }
 
index 4ac163b..948e997 100644 (file)
@@ -12,6 +12,8 @@
 #include <utility>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/cache.h>
 #include <fst/test-properties.h>
 
index 57f2eb4..137f4a8 100644 (file)
@@ -44,7 +44,7 @@ using MinMaxWeight = MinMaxWeightTpl<float>;
 // Arc templates and arcs.
 
 template <class Weight>
-class ArcTpl;
+struct ArcTpl;
 
 using StdArc = ArcTpl<TropicalWeight>;
 
index f0d1f32..814a940 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <fst/compat.h>
 #include <fst/types.h>
+#include <fst/log.h>
 #include <fstream>
 
 #include <fst/arc.h>
index 74b9404..1e943dc 100644 (file)
@@ -12,6 +12,7 @@
 #include <string>
 
 #include <fst/types.h>
+#include <fst/log.h>
 
 // Generic class representing a globally-stored correspondence between
 // objects of KeyType and EntryType.
index c04d612..3cb2a3a 100644 (file)
@@ -12,6 +12,8 @@
 #include <sstream>
 #include <vector>
 
+#include <fst/log.h>
+
 namespace fst {
 
 // This function writes UTF-8 codepoints into a vector of Labels, truncating if
index 68b603a..4330a00 100644 (file)
@@ -9,6 +9,8 @@
 #include <algorithm>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/cache.h>
 #include <fst/compose.h>
 
index 17d1ec3..e62cead 100644 (file)
@@ -12,6 +12,8 @@
 #include <list>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/fst.h>
 
 
index 3f96fd5..4ea711b 100644 (file)
@@ -11,6 +11,8 @@
 #include <utility>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/accumulator.h>
 #include <fst/arcsort.h>
 #include <fst/interval-set.h>
index 240f6c6..28072f4 100644 (file)
@@ -17,6 +17,8 @@
 
 #include <string>
 
+#include <fst/log.h>
+
 #include <fst/pair-weight.h>
 #include <fst/weight.h>
 
index cc6a963..7357a45 100644 (file)
@@ -9,6 +9,8 @@
 
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/filter-state.h>
 #include <fst/fst.h>
 #include <fst/lookahead-matcher.h>
index beda37a..55ce422 100644 (file)
@@ -8,9 +8,11 @@
 #define FST_LIB_LOOKAHEAD_MATCHER_H_
 
 #include <memory>
-#include <string>
+#include <utility>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/add-on.h>
 #include <fst/const-fst.h>
 #include <fst/fst.h>
@@ -23,8 +25,8 @@ DECLARE_string(save_relabel_opairs);
 
 namespace fst {
 
-// Lookahead matches extend the interface of Matcher (see matcher.h) with the
-// following additional methods:
+// Lookahead matches extend the matcher interface with following additional
+// methods:
 //
 // template <class FST>
 // class LookAheadMatcher {
@@ -43,54 +45,51 @@ namespace fst {
 //  // Below are methods for looking ahead for a match to a label and more
 //  // generally, to a rational set. Each returns false if there is definitely
 //  // not a match and returns true if there possibly is a match.
-
-//  // Can the label be read from the current matcher state after possibly
-//  // following epsilon transitions?
-//  bool LookAheadLabel(Label label) const;
 //
-//  // The following methods allow looking ahead for an arbitrary rational set
-//  // of strings, specified by an FST and a state from which to begin the
-//  matching. If the lookahead FST is a transducer, this looks on the side
-//  // different from the matcher's match_type (cf. composition).
+//  // Optionally pre-specifies the lookahead FST that will be passed to
+//  // LookAheadFst() for possible precomputation. If copy is true, then the FST
+//  // argument is a copy of the FST used in the previous call to this method
+//  // (to avoid unnecessary updates).
+//  void InitLookAheadFst(const Fst<Arc> &fst, bool copy = false) override;
 //
 //  // Are there paths from a state in the lookahead FST that can be read from
 //  // the curent matcher state?
-//  bool LookAheadFst(const Fst<Arc> &fst, StateId state);
+//  bool LookAheadFst(const Fst<Arc> &fst, StateId s) override;
 //
-//  // Gives an estimate of the combined weight of the paths in the lookahead
-//  // and matcher FSTs for the last call to LookAheadFst; a trivial
-//  // implementation returns Weight::One(). Non-trivial implementations are
-//  // useful for weight-pushing in composition.
-//  Weight LookAheadWeight() const;
+//  // Can the label be read from the current matcher state after possibly
+//  // following epsilon transitions?
+//  bool LookAheadLabel(Label label) const override;
 //
+//  // The following methods allow looking ahead for an arbitrary rational set
+//  // of strings, specified by an FST and a state from which to begin the
+//  // matching. If the lookahead FST is a transducer, this looks on the side
+//  // different from the matcher's match_type (cf. composition).
 //  // Is there is a single non-epsilon arc found in the lookahead FST that
 //  // begins the path (after possibly following any epsilons) in the last call
 //  // to LookAheadFst? If so, return true and copy it to the arc argument;
-//  // otherwise, return false. A trivial implementation returns false.
-//  // Non-trivial implementations are useful for label-pushing in composition.
-//  bool LookAheadPrefix(Arc *arc);
+//  // otherwise, return false. Non-trivial implementations are useful for
+//  // label-pushing in composition.
+//  bool LookAheadPrefix(Arc *arc) override;
 //
-//  // Optionally pre-specifies the lookahead FST that will be passed to
-//  // LookAheadFst() for possible precomputation. If copy is true, then the FST
-//  argument is a copy of the FST used in the previous call to this method (to
-//  avoid unnecessary updates).
-//  void InitLookAheadFst(const Fst<Arc> &fst, bool copy = false);
+//  // Gives an estimate of the combined weight of the paths in the lookahead
+//  // and matcher FSTs for the last call to LookAheadFst. Non-trivial
+//  // implementations are useful for weight-pushing in composition.
+//  Weight LookAheadWeight() const override;
 // };
 
-// LOOK-AHEAD FLAGS (see also kMatcherFlags in matcher.h):
-//
-// Matcher is a lookahead matcher when 'match_type' is MATCH_INPUT.
+// Look-ahead flags.
+// Matcher is a lookahead matcher when match_type is MATCH_INPUT.
 constexpr uint32 kInputLookAheadMatcher = 0x00000010;
 
-// Matcher is a lookahead matcher when 'match_type' is MATCH_OUTPUT.
+// Matcher is a lookahead matcher when match_type is MATCH_OUTPUT.
 constexpr uint32 kOutputLookAheadMatcher = 0x00000020;
 
-// A non-trivial implementation of LookAheadWeight() method defined and
-// should be used?
+// Is a non-trivial implementation of LookAheadWeight() method defined and
+// if so, should it be used?
 constexpr uint32 kLookAheadWeight = 0x00000040;
 
-// A non-trivial implementation of LookAheadPrefix() method defined and
-// should be used?
+// Is a non-trivial implementation of LookAheadPrefix() method defined and
+// if so, should it be used?
 constexpr uint32 kLookAheadPrefix = 0x00000080;
 
 // Look-ahead of matcher FST non-epsilon arcs?
@@ -99,12 +98,12 @@ constexpr uint32 kLookAheadNonEpsilons = 0x00000100;
 // Look-ahead of matcher FST epsilon arcs?
 constexpr uint32 kLookAheadEpsilons = 0x00000200;
 
-// Ignore epsilon paths for the lookahead prefix? Note this gives
-// correct results in composition only with an appropriate composition
-// filter since it depends on the filter blocking the ignored paths.
+// Ignore epsilon paths for the lookahead prefix? This gives correct results in
+// composition only with an appropriate composition filter since it depends on
+// the filter blocking the ignored paths.
 constexpr uint32 kLookAheadNonEpsilonPrefix = 0x00000400;
 
-// For LabelLookAheadMatcher, save relabeling data to file
+// For LabelLookAheadMatcher, save relabeling data to file?
 constexpr uint32 kLookAheadKeepRelabelData = 0x00000800;
 
 // Flags used for lookahead matchers.
@@ -120,19 +119,11 @@ class LookAheadMatcherBase : public MatcherBase<Arc> {
   using StateId = typename Arc::StateId;
   using Weight = typename Arc::Weight;
 
-  LookAheadMatcherBase()
-      : weight_(Weight::One()),
-        prefix_arc_(kNoLabel, kNoLabel, Weight::One(), kNoStateId) {}
-
-  ~LookAheadMatcherBase() override {}
+  virtual void InitLookAheadFst(const Fst<Arc> &, bool copy = false) = 0;
+  virtual bool LookAheadFst(const Fst<Arc> &, StateId) = 0;
+  virtual bool LookAheadLabel(Label) const = 0;
 
-  bool LookAheadLabel(Label label) const { return LookAheadLabel_(label); }
-
-  bool LookAheadFst(const Fst<Arc> &fst, StateId state) {
-    return LookAheadFst_(fst, state);
-  }
-
-  Weight LookAheadWeight() const { return weight_; }
+  // Suggested concrete implementation of lookahead methods.
 
   bool LookAheadPrefix(Arc *arc) const {
     if (prefix_arc_.nextstate != kNoStateId) {
@@ -143,26 +134,25 @@ class LookAheadMatcherBase : public MatcherBase<Arc> {
     }
   }
 
-  virtual void InitLookAheadFst(const Fst<Arc> &fst, bool copy = false) = 0;
+  Weight LookAheadWeight() const { return weight_; }
 
  protected:
-  void SetLookAheadWeight(const Weight &w) { weight_ = w; }
+  // Concrete implementations for lookahead helper methods.
 
-  void SetLookAheadPrefix(const Arc &arc) { prefix_arc_ = arc; }
+  void ClearLookAheadWeight() { weight_ = Weight::One(); }
 
-  void ClearLookAheadPrefix() { prefix_arc_.nextstate = kNoStateId; }
+  void SetLookAheadWeight(Weight weight) { weight_ = std::move(weight); }
 
- private:
-  virtual bool LookAheadLabel_(Label label) const = 0;
+  void ClearLookAheadPrefix() { prefix_arc_.nextstate = kNoStateId; }
 
-  // This must set l.a. weight and prefix if non-trivial.
-  virtual bool LookAheadFst_(const Fst<Arc> &fst, StateId state) = 0;
+  void SetLookAheadPrefix(Arc arc) { prefix_arc_ = std::move(arc); }
 
-  Weight weight_;                             // Look-ahead weight.
-  Arc prefix_arc_;                            // Look-ahead prefix arc
+ private:
+  Arc prefix_arc_;
+  Weight weight_;
 };
 
-// Don't really lookahead, just declare future looks good regardless.
+// Doesn't actually lookahead, just declares that the future looks good.
 template <class M>
 class TrivialLookAheadMatcher
     : public LookAheadMatcherBase<typename M::FST::Arc> {
@@ -186,19 +176,19 @@ class TrivialLookAheadMatcher
 
   MatchType Type(bool test) const override { return matcher_.Type(test); }
 
-  void SetState(StateId state) { return matcher_.SetState(state); }
+  void SetState(StateId s) final { return matcher_.SetState(s); }
 
-  bool Find(Label label) { return matcher_.Find(label); }
+  bool Find(Label label) final { return matcher_.Find(label); }
 
-  bool Done() const { return matcher_.Done(); }
+  bool Done() const final { return matcher_.Done(); }
 
-  const Arc &Value() const { return matcher_.Value(); }
+  const Arc &Value() const final { return matcher_.Value(); }
 
-  void Next() { matcher_.Next(); }
+  void Next() final { matcher_.Next(); }
 
-  Weight Final(StateId state) const { return matcher_.Final(state); }
+  Weight Final(StateId s) const final { return matcher_.Final(s); }
 
-  ssize_t Priority(StateId state) { return matcher_.Priority(state); }
+  ssize_t Priority(StateId s) final { return matcher_.Priority(s); }
 
   const FST &GetFst() const override { return matcher_.GetFst(); }
 
@@ -210,52 +200,27 @@ class TrivialLookAheadMatcher
     return matcher_.Flags() | kInputLookAheadMatcher | kOutputLookAheadMatcher;
   }
 
-  // Look-ahead methods.
-  bool LookAheadLabel(Label label) const { return true; }
-
-  bool LookAheadFst(const Fst<Arc> &fst, StateId state) { return true; }
-
-  Weight LookAheadWeight() const { return Weight::One(); }
-
-  bool LookAheadPrefix(Arc *arc) const { return false; }
+  // Lookahead methods (all trivial).
 
   void InitLookAheadFst(const Fst<Arc> &fst, bool copy = false) override {}
 
- private:
-  // This allows base class virtual access to non-virtual derived-class members
-  // of the same name. It makes the derived class more efficient to use but
-  // unsafe to further derive.
-  void SetState_(StateId state) override { SetState(state); }
-
-  bool Find_(Label label) override { return Find(label); }
-
-  bool Done_() const override { return Done(); }
-
-  const Arc &Value_() const override { return Value(); }
-
-  void Next_() override { Next(); }
-
-  Weight Final_(StateId state) const override { return Final(state); }
+  bool LookAheadFst(const Fst<Arc> &, StateId) final { return true; }
 
-  ssize_t Priority_(StateId state) override { return Priority(state); }
+  bool LookAheadLabel(Label) const final { return true; }
 
-  bool LookAheadLabel_(Label l) const override { return LookAheadLabel(l); }
+  bool LookAheadPrefix(Arc *) const { return false; }
 
-  bool LookAheadFst_(const Fst<Arc> &fst, StateId state) override {
-    return LookAheadFst(fst, state);
-  }
-
-  Weight LookAheadWeight_() const { return LookAheadWeight(); }
-
-  bool LookAheadPrefix_(Arc *arc) const { return LookAheadPrefix(arc); }
+  Weight LookAheadWeight() const { return Weight::One(); }
 
+ private:
   M matcher_;
 };
 
-// Look-ahead of one transition. Template argument F accepts flags to
+// Look-ahead of one transition. Template argument flags accepts flags to
 // control behavior.
-template <class M, uint32 F = kLookAheadNonEpsilons | kLookAheadEpsilons |
-                              kLookAheadWeight | kLookAheadPrefix>
+template <class M,
+          uint32 flags = kLookAheadNonEpsilons | kLookAheadEpsilons |
+                         kLookAheadWeight | kLookAheadPrefix>
 class ArcLookAheadMatcher : public LookAheadMatcherBase<typename M::FST::Arc> {
  public:
   using FST = typename M::FST;
@@ -265,10 +230,14 @@ class ArcLookAheadMatcher : public LookAheadMatcherBase<typename M::FST::Arc> {
   using Weight = typename Arc::Weight;
   using MatcherData = NullAddOn;
 
+  using LookAheadMatcherBase<Arc>::ClearLookAheadWeight;
   using LookAheadMatcherBase<Arc>::LookAheadWeight;
-  using LookAheadMatcherBase<Arc>::SetLookAheadPrefix;
   using LookAheadMatcherBase<Arc>::SetLookAheadWeight;
   using LookAheadMatcherBase<Arc>::ClearLookAheadPrefix;
+  using LookAheadMatcherBase<Arc>::LookAheadPrefix;
+  using LookAheadMatcherBase<Arc>::SetLookAheadPrefix;
+
+  enum : uint32 { kFlags = flags };
 
   ArcLookAheadMatcher(
       const FST &fst, MatchType match_type,
@@ -278,7 +247,7 @@ class ArcLookAheadMatcher : public LookAheadMatcherBase<typename M::FST::Arc> {
         lfst_(nullptr),
         state_(kNoStateId) {}
 
-  ArcLookAheadMatcher(const ArcLookAheadMatcher<M, F> &lmatcher,
+  ArcLookAheadMatcher(const ArcLookAheadMatcher<M, flags> &lmatcher,
                       bool safe = false)
       : matcher_(lmatcher.matcher_, safe),
         fst_(matcher_.GetFst()),
@@ -286,28 +255,28 @@ class ArcLookAheadMatcher : public LookAheadMatcherBase<typename M::FST::Arc> {
         state_(kNoStateId) {}
 
   // General matcher methods.
-  ArcLookAheadMatcher<M, F> *Copy(bool safe = false) const override {
-    return new ArcLookAheadMatcher<M, F>(*this, safe);
+  ArcLookAheadMatcher<M, flags> *Copy(bool safe = false) const override {
+    return new ArcLookAheadMatcher<M, flags>(*this, safe);
   }
 
   MatchType Type(bool test) const override { return matcher_.Type(test); }
 
-  void SetState(StateId state) {
-    state_ = state;
-    matcher_.SetState(state);
+  void SetState(StateId s) final {
+    state_ = s;
+    matcher_.SetState(s);
   }
 
-  bool Find(Label label) { return matcher_.Find(label); }
+  bool Find(Label label) final { return matcher_.Find(label); }
 
-  bool Done() const { return matcher_.Done(); }
+  bool Done() const final { return matcher_.Done(); }
 
-  const Arc &Value() const { return matcher_.Value(); }
+  const Arc &Value() const final { return matcher_.Value(); }
 
-  void Next() { matcher_.Next(); }
+  void Next() final { matcher_.Next(); }
 
-  Weight Final(StateId state) const { return matcher_.Final(state); }
+  Weight Final(StateId s) const final { return matcher_.Final(s); }
 
-  ssize_t Priority(StateId state) { return matcher_.Priority(state); }
+  ssize_t Priority(StateId s) final { return matcher_.Priority(s); }
 
   const FST &GetFst() const override { return fst_; }
 
@@ -317,7 +286,7 @@ class ArcLookAheadMatcher : public LookAheadMatcherBase<typename M::FST::Arc> {
 
   uint32 Flags() const override {
     return matcher_.Flags() | kInputLookAheadMatcher | kOutputLookAheadMatcher |
-           F;
+           kFlags;
   }
 
   const MatcherData *GetData() const { return nullptr; }
@@ -327,78 +296,53 @@ class ArcLookAheadMatcher : public LookAheadMatcherBase<typename M::FST::Arc> {
   }
 
   // Look-ahead methods.
-  bool LookAheadLabel(Label label) const { return matcher_.Find(label); }
-
-  // Checks if there is a matching (possibly super-final) transition
-  // at (state_, state).
-  bool LookAheadFst(const Fst<Arc> &fst, StateId state);
 
   void InitLookAheadFst(const Fst<Arc> &fst, bool copy = false) override {
     lfst_ = &fst;
   }
 
- private:
-  // This allows base class virtual access to non-virtual derived-
-  // class members of the same name. It makes the derived class more
-  // efficient to use but unsafe to further derive.
-  void SetState_(StateId state) override { SetState(state); }
-
-  bool Find_(Label label) override { return Find(label); }
-
-  bool Done_() const override { return Done(); }
-
-  const Arc &Value_() const override { return Value(); }
-
-  void Next_() override { Next(); }
-
-  Weight Final_(StateId state) const override { return Final(state); }
-
-  ssize_t Priority_(StateId state) override { return Priority(state); }
-
-  bool LookAheadLabel_(Label label) const override {
-    return LookAheadLabel(label);
-  }
+  // Checks if there is a matching (possibly super-final) transition
+  // at (state_, s).
+  bool LookAheadFst(const Fst<Arc> &, StateId) final;
 
-  bool LookAheadFst_(const Fst<Arc> &fst, StateId state) override {
-    return LookAheadFst(fst, state);
-  }
+  bool LookAheadLabel(Label label) const final { return matcher_.Find(label); }
 
+ private:
   mutable M matcher_;
   const FST &fst_;        // Matcher FST.
   const Fst<Arc> *lfst_;  // Look-ahead FST.
   StateId state_;         // Matcher state.
 };
 
-template <class M, uint32 F>
-bool ArcLookAheadMatcher<M, F>::LookAheadFst(const Fst<Arc> &fst,
-                                             StateId state) {
+template <class M, uint32 flags>
+bool ArcLookAheadMatcher<M, flags>::LookAheadFst(const Fst<Arc> &fst,
+                                                 StateId s) {
   if (&fst != lfst_) InitLookAheadFst(fst);
   bool result = false;
   ssize_t nprefix = 0;
-  if (F & kLookAheadWeight) SetLookAheadWeight(Weight::Zero());
-  if (F & kLookAheadPrefix) ClearLookAheadPrefix();
+  if (kFlags & kLookAheadWeight) ClearLookAheadWeight();
+  if (kFlags & kLookAheadPrefix) ClearLookAheadPrefix();
   if (fst_.Final(state_) != Weight::Zero() &&
-      lfst_->Final(state) != Weight::Zero()) {
-    if (!(F & (kLookAheadWeight | kLookAheadPrefix))) return true;
+      lfst_->Final(s) != Weight::Zero()) {
+    if (!(kFlags & (kLookAheadWeight | kLookAheadPrefix))) return true;
     ++nprefix;
-    if (F & kLookAheadWeight) {
-      SetLookAheadWeight(Plus(LookAheadWeight(),
-                              Times(fst_.Final(state_), lfst_->Final(state))));
+    if (kFlags & kLookAheadWeight) {
+      SetLookAheadWeight(
+          Plus(LookAheadWeight(), Times(fst_.Final(state_), lfst_->Final(s))));
     }
     result = true;
   }
   if (matcher_.Find(kNoLabel)) {
-    if (!(F & (kLookAheadWeight | kLookAheadPrefix))) return true;
+    if (!(kFlags & (kLookAheadWeight | kLookAheadPrefix))) return true;
     ++nprefix;
-    if (F & kLookAheadWeight) {
+    if (kFlags & kLookAheadWeight) {
       for (; !matcher_.Done(); matcher_.Next()) {
         SetLookAheadWeight(Plus(LookAheadWeight(), matcher_.Value().weight));
       }
     }
     result = true;
   }
-  for (ArcIterator<Fst<Arc>> aiter(*lfst_, state); !aiter.Done();
-       aiter.Next()) {
+  for (ArcIterator<Fst<Arc>> aiter(*lfst_, s); !aiter.Done(); aiter.Next()) {
     const auto &arc = aiter.Value();
     Label label = kNoLabel;
     switch (matcher_.Type(false)) {
@@ -413,28 +357,29 @@ bool ArcLookAheadMatcher<M, F>::LookAheadFst(const Fst<Arc> &fst,
         return true;
     }
     if (label == 0) {
-      if (!(F & (kLookAheadWeight | kLookAheadPrefix))) return true;
-      if (!(F & kLookAheadNonEpsilonPrefix)) ++nprefix;
-      if (F & kLookAheadWeight) {
+      if (!(kFlags & (kLookAheadWeight | kLookAheadPrefix))) return true;
+      if (!(kFlags & kLookAheadNonEpsilonPrefix)) ++nprefix;
+      if (kFlags & kLookAheadWeight) {
         SetLookAheadWeight(Plus(LookAheadWeight(), arc.weight));
       }
       result = true;
     } else if (matcher_.Find(label)) {
-      if (!(F & (kLookAheadWeight | kLookAheadPrefix))) return true;
+      if (!(kFlags & (kLookAheadWeight | kLookAheadPrefix))) return true;
       for (; !matcher_.Done(); matcher_.Next()) {
         ++nprefix;
-        if (F & kLookAheadWeight) {
+        if (kFlags & kLookAheadWeight) {
           SetLookAheadWeight(Plus(LookAheadWeight(),
                                   Times(arc.weight, matcher_.Value().weight)));
         }
-        if ((F & kLookAheadPrefix) && nprefix == 1) SetLookAheadPrefix(arc);
+        if ((kFlags & kLookAheadPrefix) && nprefix == 1)
+          SetLookAheadPrefix(arc);
       }
       result = true;
     }
   }
-  if (F & kLookAheadPrefix) {
+  if (kFlags & kLookAheadPrefix) {
     if (nprefix == 1) {
-      SetLookAheadWeight(Weight::One());  // Avoids double counting.
+      ClearLookAheadWeight();  // Avoids double counting.
     } else {
       ClearLookAheadPrefix();
     }
@@ -442,11 +387,12 @@ bool ArcLookAheadMatcher<M, F>::LookAheadFst(const Fst<Arc> &fst,
   return result;
 }
 
-// Template argument F accepts flags to control behavior. It must include
+// Template argument flags accepts flags to control behavior. It must include
 // precisely one of kInputLookAheadMatcher or kOutputLookAheadMatcher.
 template <class M,
-          uint32 F = kLookAheadEpsilons | kLookAheadWeight | kLookAheadPrefix |
-                     kLookAheadNonEpsilonPrefix | kLookAheadKeepRelabelData,
+          uint32 flags = kLookAheadEpsilons | kLookAheadWeight |
+                         kLookAheadPrefix | kLookAheadNonEpsilonPrefix |
+                         kLookAheadKeepRelabelData,
           class Accumulator = DefaultAccumulator<typename M::Arc>,
           class Reachable = LabelReachable<typename M::Arc, Accumulator>>
 class LabelLookAheadMatcher
@@ -459,10 +405,14 @@ class LabelLookAheadMatcher
   using Weight = typename Arc::Weight;
   using MatcherData = typename Reachable::Data;
 
+  using LookAheadMatcherBase<Arc>::ClearLookAheadWeight;
   using LookAheadMatcherBase<Arc>::LookAheadWeight;
-  using LookAheadMatcherBase<Arc>::SetLookAheadPrefix;
   using LookAheadMatcherBase<Arc>::SetLookAheadWeight;
   using LookAheadMatcherBase<Arc>::ClearLookAheadPrefix;
+  using LookAheadMatcherBase<Arc>::LookAheadPrefix;
+  using LookAheadMatcherBase<Arc>::SetLookAheadPrefix;
+
+  enum : uint32 { kFlags = flags };
 
   LabelLookAheadMatcher(
       const FST &fst, MatchType match_type,
@@ -472,8 +422,8 @@ class LabelLookAheadMatcher
         lfst_(nullptr),
         state_(kNoStateId),
         error_(false) {
-    if (!(F & (kInputLookAheadMatcher | kOutputLookAheadMatcher))) {
-      FSTERROR() << "LabelLookaheadMatcher: Bad matcher flags: " << F;
+    if (!(kFlags & (kInputLookAheadMatcher | kOutputLookAheadMatcher))) {
+      FSTERROR() << "LabelLookaheadMatcher: Bad matcher flags: " << kFlags;
       error_ = true;
     }
     const bool reach_input = match_type == MATCH_INPUT;
@@ -481,15 +431,15 @@ class LabelLookAheadMatcher
       if (reach_input == data->ReachInput()) {
         label_reachable_.reset(new Reachable(data, accumulator));
       }
-    } else if ((reach_input && (F & kInputLookAheadMatcher)) ||
-               (!reach_input && (F & kOutputLookAheadMatcher))) {
+    } else if ((reach_input && (kFlags & kInputLookAheadMatcher)) ||
+               (!reach_input && (kFlags & kOutputLookAheadMatcher))) {
       label_reachable_.reset(new Reachable(fst, reach_input, accumulator,
-                                           F & kLookAheadKeepRelabelData));
+                                           kFlags & kLookAheadKeepRelabelData));
     }
   }
 
   LabelLookAheadMatcher(
-      const LabelLookAheadMatcher<M, F, Accumulator, Reachable> &lmatcher,
+      const LabelLookAheadMatcher<M, flags, Accumulator, Reachable> &lmatcher,
       bool safe = false)
       : matcher_(lmatcher.matcher_, safe),
         lfst_(lmatcher.lfst_),
@@ -499,23 +449,22 @@ class LabelLookAheadMatcher
         state_(kNoStateId),
         error_(lmatcher.error_) {}
 
-  // General matcher methods.
-
-  LabelLookAheadMatcher<M, F, Accumulator, Reachable> *Copy(
+  LabelLookAheadMatcher<M, flags, Accumulator, Reachable> *Copy(
       bool safe = false) const override {
-    return new LabelLookAheadMatcher<M, F, Accumulator, Reachable>(*this, safe);
+    return new LabelLookAheadMatcher<M, flags, Accumulator, Reachable>(*this,
+                                                                       safe);
   }
 
   MatchType Type(bool test) const override { return matcher_.Type(test); }
 
-  void SetState(StateId state) {
-    if (state == state_) return;
-    state_ = state;
+  void SetState(StateId s) final {
+    if (state_ == s) return;
+    state_ = s;
     match_set_state_ = false;
     reach_set_state_ = false;
   }
 
-  bool Find(Label label) {
+  bool Find(Label label) final {
     if (!match_set_state_) {
       matcher_.SetState(state_);
       match_set_state_ = true;
@@ -523,15 +472,15 @@ class LabelLookAheadMatcher
     return matcher_.Find(label);
   }
 
-  bool Done() const { return matcher_.Done(); }
+  bool Done() const final { return matcher_.Done(); }
 
-  const Arc &Value() const { return matcher_.Value(); }
+  const Arc &Value() const final { return matcher_.Value(); }
 
-  void Next() { matcher_.Next(); }
+  void Next() final { matcher_.Next(); }
 
-  ssize_t Priority(StateId state) { return matcher_.Priority(state); }
+  Weight Final(StateId s) const final { return matcher_.Final(s); }
 
-  Weight Final(StateId state) const { return matcher_.Final(state); }
+  ssize_t Priority(StateId s) final { return matcher_.Priority(s); }
 
   const FST &GetFst() const override { return matcher_.GetFst(); }
 
@@ -545,9 +494,9 @@ class LabelLookAheadMatcher
 
   uint32 Flags() const override {
     if (label_reachable_ && label_reachable_->GetData()->ReachInput()) {
-      return matcher_.Flags() | F | kInputLookAheadMatcher;
+      return matcher_.Flags() | kFlags | kInputLookAheadMatcher;
     } else if (label_reachable_ && !label_reachable_->GetData()->ReachInput()) {
-      return matcher_.Flags() | F | kOutputLookAheadMatcher;
+      return matcher_.Flags() | kFlags | kOutputLookAheadMatcher;
     } else {
       return matcher_.Flags();
     }
@@ -561,24 +510,15 @@ class LabelLookAheadMatcher
     return label_reachable_ ? label_reachable_->GetSharedData()
                             : std::shared_ptr<MatcherData>();
   }
-
-  bool LookAheadLabel(Label label) const {
-    if (label == 0) return true;
-    if (label_reachable_) {
-      if (!reach_set_state_) {
-        label_reachable_->SetState(state_);
-        reach_set_state_ = true;
-      }
-      return label_reachable_->Reach(label);
-    } else {
-      return true;
-    }
-  }
-
   // Checks if there is a matching (possibly super-final) transition at
-  // (state_, state).
+  // (state_, s).
   template <class LFST>
-  bool LookAheadFst(const LFST &fst, StateId state);
+  bool LookAheadFst(const LFST &fst, StateId s);
+
+  // Required to make class concrete.
+  bool LookAheadFst(const Fst<Arc> &fst, StateId s) final {
+    return LookAheadFst<Fst<Arc>>(fst, s);
+  }
 
   void InitLookAheadFst(const Fst<Arc> &fst, bool copy = false) override {
     lfst_ = &fst;
@@ -597,58 +537,47 @@ class LabelLookAheadMatcher
     }
   }
 
- private:
-  // This allows base class virtual access to non-virtual derived-
-  // class members of the same name. It makes the derived class more
-  // efficient to use but unsafe to further derive.
-  void SetState_(StateId state) override { SetState(state); }
-
-  bool Find_(Label label) override { return Find(label); }
-
-  bool Done_() const override { return Done(); }
-
-  const Arc &Value_() const override { return Value(); }
-
-  void Next_() override { Next(); }
-
-  Weight Final_(StateId state) const override { return Final(state); }
-
-  ssize_t Priority_(StateId state) override { return Priority(state); }
-
-  bool LookAheadLabel_(Label label) const override {
-    return LookAheadLabel(label);
-  }
-
-  bool LookAheadFst_(const Fst<Arc> &fst, StateId state) override {
-    return LookAheadFst(fst, state);
+  bool LookAheadLabel(Label label) const final {
+    if (label == 0) return true;
+    if (label_reachable_) {
+      if (!reach_set_state_) {
+        label_reachable_->SetState(state_);
+        reach_set_state_ = true;
+      }
+      return label_reachable_->Reach(label);
+    } else {
+      return true;
+    }
   }
 
+ private:
   mutable M matcher_;
   const Fst<Arc> *lfst_;                        // Look-ahead FST.
   std::unique_ptr<Reachable> label_reachable_;  // Label reachability info.
   StateId state_;                               // Matcher state.
   bool match_set_state_;                        // matcher_.SetState called?
   mutable bool reach_set_state_;                // reachable_.SetState called?
-  bool error_;
+  bool error_;                                  // Error encountered?
 };
 
-template <class M, uint32 F, class Accumulator, class Reachable>
+template <class M, uint32 flags, class Accumulator, class Reachable>
 template <class LFST>
-inline bool LabelLookAheadMatcher<M, F, Accumulator, Reachable>::LookAheadFst(
-    const LFST &fst, StateId state) {
+inline bool LabelLookAheadMatcher<M, flags, Accumulator,
+                                  Reachable>::LookAheadFst(const LFST &fst,
+                                                           StateId s) {
   if (static_cast<const Fst<Arc> *>(&fst) != lfst_) InitLookAheadFst(fst);
-  SetLookAheadWeight(Weight::One());
+  ClearLookAheadWeight();
   ClearLookAheadPrefix();
   if (!label_reachable_) return true;
-  label_reachable_->SetState(state_, state);
+  label_reachable_->SetState(state_, s);
   reach_set_state_ = true;
-  bool compute_weight = F & kLookAheadWeight;
-  bool compute_prefix = F & kLookAheadPrefix;
-  ArcIterator<LFST> aiter(fst, state);
+  bool compute_weight = kFlags & kLookAheadWeight;
+  bool compute_prefix = kFlags & kLookAheadPrefix;
+  ArcIterator<LFST> aiter(fst, s);
   aiter.SetFlags(kArcNoCache, kArcNoCache);  // Makes caching optional.
   const bool reach_arc = label_reachable_->Reach(
-      &aiter, 0, internal::NumArcs(*lfst_, state), compute_weight);
-  const auto lfinal = internal::Final(*lfst_, state);
+      &aiter, 0, internal::NumArcs(*lfst_, s), compute_weight);
+  const auto lfinal = internal::Final(*lfst_, s);
   const bool reach_final =
       lfinal != Weight::Zero() && label_reachable_->ReachFinal();
   if (reach_arc) {
@@ -773,7 +702,7 @@ class LookAheadMatcher {
 
   MatchType Type(bool test) const { return base_->Type(test); }
 
-  void SetState(StateId state) { base_->SetState(state); }
+  void SetState(StateId s) { base_->SetState(s); }
 
   bool Find(Label label) { return base_->Find(label); }
 
@@ -783,9 +712,9 @@ class LookAheadMatcher {
 
   void Next() { base_->Next(); }
 
-  Weight Final(StateId state) const { return base_->Final(state); }
+  Weight Final(StateId s) const { return base_->Final(s); }
 
-  ssize_t Priority(StateId state) { return base_->Priority(state); }
+  ssize_t Priority(StateId s) { return base_->Priority(s); }
 
   const FST &GetFst() const {
     return static_cast<const FST &>(base_->GetFst());
@@ -803,9 +732,9 @@ class LookAheadMatcher {
     }
   }
 
-  bool LookAheadFst(const Fst<Arc> &fst, StateId state) {
+  bool LookAheadFst(const Fst<Arc> &fst, StateId s) {
     if (LookAheadCheck()) {
-      return static_cast<LBase *>(base_.get())->LookAheadFst(fst, state);
+      return static_cast<LBase *>(base_.get())->LookAheadFst(fst, s);
     } else {
       return true;
     }
index 24afdca..75fbd0d 100644 (file)
@@ -10,6 +10,8 @@
 #include <unordered_map>
 #include <utility>
 
+#include <fst/log.h>
+
 #include <fst/mutable-fst.h>  // for all internal FST accessors.
 
 
@@ -31,58 +33,59 @@ namespace fst {
 //   using Weight = typename Arc::Weight;
 //
 //   // Required constructors.
+//
 //   Matcher(const FST &fst, MatchType type);
-//   // If safe = true, the copy is thread-safe. See Fst<>::Copy()
-//   // for further doc.
 //   Matcher(const Matcher &matcher, bool safe = false);
 //
-//   // If safe=true, the copy is thread-safe. See Fst<>::Copy()
-//   // for further doc.
-//   Matcher<FST> *Copy(bool safe = false) const;
+//   // Standard copy method.
+//   Matcher<FST> *Copy(bool safe = false) const override;
+//
+//   // Returns the match type that can be provided (depending on compatibility
+//   of the input FST). It is either the requested match type, MATCH_NONE, or
+//   MATCH_UNKNOWN. If test is false, a costly testing is avoided, but
+//   MATCH_UNKNOWN may be returned. If test is true, a definite answer is
+//   returned, but may involve more costly computation (e.g., visiting the FST).
+//   MatchType Type(bool test) const override;
 //
-//   // Returns the match type that can be provided (depending on
-//   // compatibility of the input FST). It is either
-//   // the requested match type, MATCH_NONE, or MATCH_UNKNOWN.
-//   // If 'test' is false, a costly testing is avoided, but
-//   // MATCH_UNKNOWN may be returned. If 'test' is true,
-//   // a definite answer is returned, but may involve more costly
-//   // computation (e.g., visiting the FST).
-//   MatchType Type(bool test) const;
 //   // Specifies the current state.
-//   void SetState(StateId state);
+//   void SetState(StateId s) final;
+//
+//   // Finds matches to a label at the current state, returning true if a match
+//   // found. kNoLabel matches any non-consuming transitions, e.g., epsilon
+//   // transitions, which do not require a matching symbol.
+//   bool Find(Label label) final;
+//
+//   // Iterator methods. Note that initially and after SetState() these have
+//   undefined behavior until Find() is called.
 //
-//   // This finds matches to a label at the current state.
-//   // Returns true if a match found. kNoLabel matches any
-//   // 'non-consuming' transitions, e.g., epsilon transitions,
-//   // which do not require a matching symbol.
-//   bool Find(Label label);
-//   // These iterate through any matches found:
-//   bool Done() const;         // No more matches.
-//   const A& Value() const;    // Current arc (when !Done)
-//   void Next();               // Advance to next arc (when !Done)
-//   // Initially and after SetState() the iterator methods
-//   // have undefined behavior until Find() is called.
+//   bool Done() const final;
 //
-//   // Returns finality of a state.
-//   Weight Final(StateId state) const;
+//   const Arc &Value() const final;
+//
+//   void Next() final;
+//
+//   // Returns final weight of a state.
+//   Weight Final(StateId) const final;
 //
 //   // Indicates preference for being the side used for matching in
-//   // composition/intersection. If the value is kRequirePriority,
-//   // then it is mandatory that it be used.
-//   // Calling this method without passing the current state of the matcher
-//   // invalidates the state of the matcher.
-//   ssize_t Priority(StateId state);
+//   // composition. If the value is kRequirePriority, then it is
+//   // mandatory that it be used. Calling this method without passing the
+//   // current state of the matcher invalidates the state of the matcher.
+//   ssize_t Priority(StateId s) final;
 //
-//   // Return matcher FST.
-//   const FST &GetFst() const;
-//   // This specifies the known FST properties as viewed from this
-//   // matcher. It takes as argument the input FST's known properties.
-//   uint64 Properties(uint64 props) const;
-// };
-
+//   // This specifies the known FST properties as viewed from this matcher. It
+//   // takes as argument the input FST's known properties.
+//   uint64 Properties(uint64 props) const override;
 //
-// MATCHER FLAGS (see also kLookAheadFlags in lookahead-matcher.h)
+//   // Returns matcher flags.
+//   uint32 Flags() const override;
 //
+//   // Returns matcher FST.
+//   const FST &GetFst() const override;
+// };
+
+// Basic matcher flags.
+
 // Matcher needs to be used as the matching side in composition for
 // at least one state (has kRequirePriority).
 constexpr uint32 kRequireMatch = 0x00000001;
@@ -93,9 +96,8 @@ constexpr uint32 kMatcherFlags = kRequireMatch;
 // Matcher priority that is mandatory.
 constexpr ssize_t kRequirePriority = -1;
 
-// Matcher interface, templated on the Arc definition; used
-// for matcher specializations that are returned by the
-// InitMatcher Fst method.
+// Matcher interface, templated on the Arc definition; used for matcher
+// specializations that are returned by the InitMatcher FST method.
 template <class A>
 class MatcherBase {
  public:
@@ -106,44 +108,25 @@ class MatcherBase {
 
   virtual ~MatcherBase() {}
 
-  virtual MatcherBase<A> *Copy(bool safe = false) const = 0;
-
-  virtual MatchType Type(bool test) const = 0;
-
-  void SetState(StateId s) { SetState_(s); }
-
-  bool Find(Label label) { return Find_(label); }
-
-  bool Done() const { return Done_(); }
-
-  const A &Value() const { return Value_(); }
-
-  void Next() { Next_(); }
+  // Virtual interface.
 
-  Weight Final(StateId state) const { return Final_(state); }
-
-  ssize_t Priority(StateId state) { return Priority_(state); }
-
-  virtual const Fst<A> &GetFst() const = 0;
-
-  virtual uint64 Properties(uint64 props) const = 0;
+  virtual MatcherBase<Arc> *Copy(bool safe = false) const = 0;
+  virtual MatchType Type(bool) const = 0;
+  virtual void SetState(StateId) = 0;
+  virtual bool Find(Label) = 0;
+  virtual bool Done() const = 0;
+  virtual const Arc &Value() const = 0;
+  virtual void Next() = 0;
+  virtual const Fst<Arc> &GetFst() const = 0;
+  virtual uint64 Properties(uint64) const = 0;
 
+  // Trivial implementations that can be used by derived classes. Full
+  // devirtualization is expected for any derived class marked final.
   virtual uint32 Flags() const { return 0; }
 
- private:
-  virtual void SetState_(StateId state) = 0;
-
-  virtual bool Find_(Label label) = 0;
-
-  virtual bool Done_() const = 0;
-
-  virtual const A &Value_() const = 0;
-
-  virtual void Next_() = 0;
-
-  virtual Weight Final_(StateId state) const { return GetFst().Final(state); }
+  virtual Weight Final(StateId s) const { return internal::Final(GetFst(), s); }
 
-  virtual ssize_t Priority_(StateId state) { return GetFst().NumArcs(state); }
+  virtual ssize_t Priority(StateId s) { return internal::NumArcs(GetFst(), s); }
 };
 
 // A matcher that expects sorted labels on the side to be matched.
@@ -160,9 +143,12 @@ class SortedMatcher : public MatcherBase<typename F::Arc> {
   using StateId = typename Arc::StateId;
   using Weight = typename Arc::Weight;
 
+  using MatcherBase<Arc>::Flags;
+  using MatcherBase<Arc>::Properties;
+
   // Labels >= binary_label will be searched for by binary search;
   // o.w. linear search is used.
-  SortedMatcher(const F &fst, MatchType match_type, Label binary_label = 1)
+  SortedMatcher(const FST &fst, MatchType match_type, Label binary_label = 1)
       : fst_(fst.Copy()),
         state_(kNoStateId),
         aiter_(nullptr),
@@ -221,21 +207,21 @@ class SortedMatcher : public MatcherBase<typename F::Arc> {
     }
   }
 
-  void SetState(StateId state) {
-    if (state == state_) return;
-    state_ = state;
+  void SetState(StateId s) final {
+    if (state_ == s) return;
+    state_ = s;
     if (match_type_ == MATCH_NONE) {
       FSTERROR() << "SortedMatcher: Bad match type";
       error_ = true;
     }
     Destroy(aiter_, &aiter_pool_);
-    aiter_ = new (&aiter_pool_) ArcIterator<FST>(*fst_, state);
+    aiter_ = new (&aiter_pool_) ArcIterator<FST>(*fst_, s);
     aiter_->SetFlags(kArcNoCache, kArcNoCache);
-    narcs_ = internal::NumArcs(*fst_, state);
-    loop_.nextstate = state;
+    narcs_ = internal::NumArcs(*fst_, s);
+    loop_.nextstate = s;
   }
 
-  bool Find(Label match_label) {
+  bool Find(Label match_label) final {
     exact_match_ = true;
     if (error_) {
       current_loop_ = false;
@@ -251,22 +237,22 @@ class SortedMatcher : public MatcherBase<typename F::Arc> {
     }
   }
 
-  // Positions matcher to the first position where inserting
-  // match_label would maintain the sort order.
-  void LowerBound(Label match_label) {
+  // Positions matcher to the first position where inserting match_label would
+  // maintain the sort order.
+  void LowerBound(Label label) {
     exact_match_ = false;
     current_loop_ = false;
     if (error_) {
       match_label_ = kNoLabel;
       return;
     }
-    match_label_ = match_label;
+    match_label_ = label;
     Search();
   }
 
   // After Find(), returns false if no more exact matches.
   // After LowerBound(), returns false if no more arcs.
-  bool Done() const {
+  bool Done() const final {
     if (current_loop_) return false;
     if (aiter_->Done()) return true;
     if (!exact_match_) return false;
@@ -278,13 +264,13 @@ class SortedMatcher : public MatcherBase<typename F::Arc> {
     return label != match_label_;
   }
 
-  const Arc &Value() const {
+  const Arc &Value() const final {
     if (current_loop_) return loop_;
     aiter_->SetFlags(kArcValueFlags, kArcValueFlags);
     return aiter_->Value();
   }
 
-  void Next() {
+  void Next() final {
     if (current_loop_) {
       current_loop_ = false;
     } else {
@@ -292,9 +278,13 @@ class SortedMatcher : public MatcherBase<typename F::Arc> {
     }
   }
 
-  Weight Final(StateId state) const { return internal::Final(*fst_, state); }
+  Weight Final(StateId s) const final {
+    return MatcherBase<Arc>::Final(s);
+  }
 
-  ssize_t Priority(StateId state) { return internal::NumArcs(*fst_, state); }
+  ssize_t Priority(StateId s) final {
+    return MatcherBase<Arc>::Priority(s);
+  }
 
   const FST &GetFst() const override { return *fst_; }
 
@@ -305,24 +295,10 @@ class SortedMatcher : public MatcherBase<typename F::Arc> {
   size_t Position() const { return aiter_ ? aiter_->Position() : 0; }
 
  private:
-  void SetState_(StateId state) override { SetState(state); }
-
-  bool Find_(Label label) override { return Find(label); }
-
-  bool Done_() const override { return Done(); }
-
-  const Arc &Value_() const override { return Value(); }
-
-  void Next_() override { Next(); }
-
-  Weight Final_(StateId state) const override { return Final(state); }
-
-  ssize_t Priority_(StateId state) override { return Priority(state); }
-
   bool Search();
 
   std::unique_ptr<const FST> fst_;
-  StateId state_;            // Current state.
+  StateId state_;            // Matcher state.
   ArcIterator<FST> *aiter_;  // Iterator for current state.
   MatchType match_type_;     // Type of match to perform.
   Label binary_label_;       // Least label for binary search.
@@ -331,12 +307,12 @@ class SortedMatcher : public MatcherBase<typename F::Arc> {
   Arc loop_;                 // For non-consuming symbols.
   bool current_loop_;        // Current arc is the implicit loop.
   bool exact_match_;         // Exact match or lower bound?
-  bool error_;               // Error encountered.
+  bool error_;               // Error encountered?
   MemoryPool<ArcIterator<FST>> aiter_pool_;  // Pool of arc iterators.
 };
 
-// Returns true iff match to match_label_. Positions arc iterator at
-// lower bound regardless.
+// Returns true iff match to match_label_, positioning arc iterator at lower
+// bound.
 template <class FST>
 inline bool SortedMatcher<FST>::Search() {
   aiter_->SetFlags(
@@ -347,7 +323,7 @@ inline bool SortedMatcher<FST>::Search() {
     size_t low = 0;
     size_t high = narcs_;
     while (low < high) {
-      const auto mid = (low + high) / 2;
+      const size_t mid = (low + high) / 2;
       aiter_->Seek(mid);
       auto label = match_type_ == MATCH_INPUT ? aiter_->Value().ilabel
                                               : aiter_->Value().olabel;
@@ -357,7 +333,7 @@ inline bool SortedMatcher<FST>::Search() {
         low = mid + 1;
       } else {
         // Finds first matching label (when non-deterministic).
-        for (auto i = mid; i > low; --i) {
+        for (size_t i = mid; i > low; --i) {
           aiter_->Seek(i - 1);
           label = match_type_ == MATCH_INPUT ? aiter_->Value().ilabel
                                              : aiter_->Value().olabel;
@@ -395,8 +371,9 @@ class HashMatcher : public MatcherBase<typename F::Arc> {
   using StateId = typename Arc::StateId;
   using Weight = typename Arc::Weight;
 
-  using LabelTable = std::unordered_multimap<Label, size_t>;
-  using StateTable = std::unordered_map<StateId, LabelTable>;
+  using MatcherBase<Arc>::Flags;
+  using MatcherBase<Arc>::Final;
+  using MatcherBase<Arc>::Priority;
 
   HashMatcher(const FST &fst, MatchType match_type)
       : fst_(fst.Copy()),
@@ -431,60 +408,30 @@ class HashMatcher : public MatcherBase<typename F::Arc> {
   // The argument is ignored as there are no relevant properties to test.
   MatchType Type(bool test) const override { return match_type_; }
 
-  void SetState(StateId state) {
-    if (state == state_) return;
-    // Resets everything for the state.
-    state_ = state;
-    loop_.nextstate = state_;
-    aiter_.reset(new ArcIterator<FST>(*fst_, state_));
-    if (match_type_ == MATCH_NONE) {
-      FSTERROR() << "HashMatcher: Bad match type";
-      error_ = false;
-    }
-    // Attempts to insert a new label table; if it already exists,
-    // no additional work is done and we simply return.
-    auto it_and_success = state_table_.emplace(state_, LabelTable());
-    if (!it_and_success.second) return;
-    // Otherwise, populate this new table.
-    // Sets instance's pointer to the label table for this state.
-    label_table_ = &(it_and_success.first->second);
-    // Populates the label table.
-    label_table_->reserve(internal::NumArcs(*fst_, state_));
-    const uint32 aiter_flags =
-        (match_type_ == MATCH_INPUT ? kArcILabelValue : kArcOLabelValue) |
-        kArcNoCache;
-    aiter_->SetFlags(aiter_flags, kArcFlags);
-    for (; !aiter_->Done(); aiter_->Next()) {
-      const auto match_label = (match_type_ == MATCH_INPUT)
-                                   ? aiter_->Value().ilabel
-                                   : aiter_->Value().olabel;
-      label_table_->emplace(match_label, aiter_->Position());
-    }
-    aiter_->SetFlags(kArcValueFlags, kArcValueFlags);
-  }
+  void SetState(StateId s) final;
 
-  bool Find(Label match_label) {
-    current_loop_ = match_label == 0;
-    if (match_label == 0) {
-      Search(match_label);
+  bool Find(Label label) final {
+    current_loop_ = label == 0;
+    if (label == 0) {
+      Search(label);
       return true;
     }
-    if (match_label == kNoLabel) match_label = 0;
-    return Search(match_label);
+    if (label == kNoLabel) label = 0;
+    return Search(label);
   }
 
-  bool Done() const {
+  bool Done() const final {
     if (current_loop_) return false;
     return label_it_ == label_end_;
   }
 
-  const Arc &Value() const {
+  const Arc &Value() const final {
     if (current_loop_) return loop_;
     aiter_->Seek(label_it_->second);
     return aiter_->Value();
   }
 
-  void Next() {
+  void Next() final {
     if (current_loop_) {
       current_loop_ = false;
     } else {
@@ -492,10 +439,6 @@ class HashMatcher : public MatcherBase<typename F::Arc> {
     }
   }
 
-  Weight Final(StateId state) const { return internal::Final(*fst_, state); }
-
-  ssize_t Priority(StateId state) { return internal::NumArcs(*fst_, state); }
-
   const FST &GetFst() const override { return *fst_; }
 
   uint64 Properties(uint64 inprops) const override {
@@ -503,28 +446,17 @@ class HashMatcher : public MatcherBase<typename F::Arc> {
   }
 
  private:
-  void SetState_(StateId state) override { SetState(state); }
-
-  bool Find_(Label label) override { return Find(label); }
-
-  bool Done_() const override { return Done(); }
-
-  const Arc &Value_() const override { return Value(); }
-
-  void Next_() override { Next(); }
-
-  Weight Final_(StateId state) const override { return Final(state); }
-
-  ssize_t Priority_(StateId state) override { return Priority(state); }
-
   bool Search(Label match_label);
 
+  using LabelTable = std::unordered_multimap<Label, size_t>;
+  using StateTable = std::unordered_map<StateId, LabelTable>;
+
   std::unique_ptr<const FST> fst_;
-  StateId state_;
+  StateId state_;  // Matcher state.
   MatchType match_type_;
   Arc loop_;           // The implicit loop itself.
   bool current_loop_;  // Is the current arc is the implicit loop?
-  bool error_;
+  bool error_;         // Error encountered?
   std::unique_ptr<ArcIterator<FST>> aiter_;
   StateTable state_table_;   // Table from states to label table.
   LabelTable *label_table_;  // Pointer to current state's label table.
@@ -533,6 +465,38 @@ class HashMatcher : public MatcherBase<typename F::Arc> {
 };
 
 template <class FST>
+void HashMatcher<FST>::SetState(typename FST::Arc::StateId s) {
+  if (state_ == s) return;
+  // Resets everything for the state.
+  state_ = s;
+  loop_.nextstate = state_;
+  aiter_.reset(new ArcIterator<FST>(*fst_, state_));
+  if (match_type_ == MATCH_NONE) {
+    FSTERROR() << "HashMatcher: Bad match type";
+    error_ = false;
+  }
+  // Attempts to insert a new label table; if it already exists,
+  // no additional work is done and we simply return.
+  auto it_and_success = state_table_.emplace(state_, LabelTable());
+  if (!it_and_success.second) return;
+  // Otherwise, populate this new table.
+  // Sets instance's pointer to the label table for this state.
+  label_table_ = &(it_and_success.first->second);
+  // Populates the label table.
+  label_table_->reserve(internal::NumArcs(*fst_, state_));
+  const auto aiter_flags =
+      (match_type_ == MATCH_INPUT ? kArcILabelValue : kArcOLabelValue) |
+      kArcNoCache;
+  aiter_->SetFlags(aiter_flags, kArcFlags);
+  for (; !aiter_->Done(); aiter_->Next()) {
+    const auto label = (match_type_ == MATCH_INPUT) ? aiter_->Value().ilabel
+                                                    : aiter_->Value().olabel;
+    label_table_->emplace(label, aiter_->Position());
+  }
+  aiter_->SetFlags(kArcValueFlags, kArcValueFlags);
+}
+
+template <class FST>
 inline bool HashMatcher<FST>::Search(typename FST::Arc::Label match_label) {
   auto range = label_table_->equal_range(match_label);
   if (range.first == range.second) return false;
@@ -542,7 +506,7 @@ inline bool HashMatcher<FST>::Search(typename FST::Arc::Label match_label) {
   return true;
 }
 
-// Specifies whether during matching we rewrite both the input and output sides.
+// Specifies whether we rewrite both the input and output sides during matching.
 enum MatcherRewriteMode {
   MATCHER_REWRITE_AUTO = 0,  // Rewrites both sides iff acceptor.
   MATCHER_REWRITE_ALWAYS,
@@ -550,6 +514,257 @@ enum MatcherRewriteMode {
 };
 
 // For any requested label that doesn't match at a state, this matcher
+// considers the *unique* transition that matches the label 'phi_label'
+// (phi = 'fail'), and recursively looks for a match at its
+// destination.  When 'phi_loop' is true, if no match is found but a
+// phi self-loop is found, then the phi transition found is returned
+// with the phi_label rewritten as the requested label (both sides if
+// an acceptor, or if 'rewrite_both' is true and both input and output
+// labels of the found transition are 'phi_label').  If 'phi_label' is
+// kNoLabel, this special matching is not done.  PhiMatcher is
+// templated itself on a matcher, which is used to perform the
+// underlying matching.  By default, the underlying matcher is
+// constructed by PhiMatcher. The user can instead pass in this
+// object; in that case, PhiMatcher takes its ownership.
+// Phi non-determinism not supported. No non-consuming symbols other
+// than epsilon supported with the underlying template argument matcher.
+template <class M>
+class PhiMatcher : public MatcherBase<typename M::Arc> {
+ public:
+  using FST = typename M::FST;
+  using Arc = typename FST::Arc;
+  using Label = typename Arc::Label;
+  using StateId = typename Arc::StateId;
+  using Weight = typename Arc::Weight;
+
+  PhiMatcher(const FST &fst, MatchType match_type, Label phi_label = kNoLabel,
+             bool phi_loop = true,
+             MatcherRewriteMode rewrite_mode = MATCHER_REWRITE_AUTO,
+             M *matcher = nullptr)
+      : matcher_(matcher ? matcher : new M(fst, match_type)),
+        match_type_(match_type),
+        phi_label_(phi_label),
+        state_(kNoStateId),
+        phi_loop_(phi_loop),
+        error_(false) {
+    if (match_type == MATCH_BOTH) {
+      FSTERROR() << "PhiMatcher: Bad match type";
+      match_type_ = MATCH_NONE;
+      error_ = true;
+    }
+    if (rewrite_mode == MATCHER_REWRITE_AUTO) {
+      rewrite_both_ = fst.Properties(kAcceptor, true);
+    } else if (rewrite_mode == MATCHER_REWRITE_ALWAYS) {
+      rewrite_both_ = true;
+    } else {
+      rewrite_both_ = false;
+    }
+  }
+
+  PhiMatcher(const PhiMatcher<M> &matcher, bool safe = false)
+      : matcher_(new M(*matcher.matcher_, safe)),
+        match_type_(matcher.match_type_),
+        phi_label_(matcher.phi_label_),
+        rewrite_both_(matcher.rewrite_both_),
+        state_(kNoStateId),
+        phi_loop_(matcher.phi_loop_),
+        error_(matcher.error_) {}
+
+  PhiMatcher<M> *Copy(bool safe = false) const override {
+    return new PhiMatcher<M>(*this, safe);
+  }
+
+  MatchType Type(bool test) const override { return matcher_->Type(test); }
+
+  void SetState(StateId s) final {
+    if (state_ == s) return;
+    matcher_->SetState(s);
+    state_ = s;
+    has_phi_ = phi_label_ != kNoLabel;
+  }
+
+  bool Find(Label match_label) final;
+
+  bool Done() const final { return matcher_->Done(); }
+
+  const Arc &Value() const final {
+    if ((phi_match_ == kNoLabel) && (phi_weight_ == Weight::One())) {
+      return matcher_->Value();
+    } else if (phi_match_ == 0) {  // Virtual epsilon loop.
+      phi_arc_ = Arc(kNoLabel, 0, Weight::One(), state_);
+      if (match_type_ == MATCH_OUTPUT) {
+        std::swap(phi_arc_.ilabel, phi_arc_.olabel);
+      }
+      return phi_arc_;
+    } else {
+      phi_arc_ = matcher_->Value();
+      phi_arc_.weight = Times(phi_weight_, phi_arc_.weight);
+      if (phi_match_ != kNoLabel) {  // Phi loop match.
+        if (rewrite_both_) {
+          if (phi_arc_.ilabel == phi_label_) phi_arc_.ilabel = phi_match_;
+          if (phi_arc_.olabel == phi_label_) phi_arc_.olabel = phi_match_;
+        } else if (match_type_ == MATCH_INPUT) {
+          phi_arc_.ilabel = phi_match_;
+        } else {
+          phi_arc_.olabel = phi_match_;
+        }
+      }
+      return phi_arc_;
+    }
+  }
+
+  void Next() final { matcher_->Next(); }
+
+  Weight Final(StateId s) const final {
+    auto weight = matcher_->Final(s);
+    if (phi_label_ == kNoLabel || weight != Weight::Zero()) {
+      return weight;
+    }
+    weight = Weight::One();
+    matcher_->SetState(s);
+    while (matcher_->Final(s) == Weight::Zero()) {
+      if (!matcher_->Find(phi_label_ == 0 ? -1 : phi_label_)) break;
+      weight = Times(weight, matcher_->Value().weight);
+      if (s == matcher_->Value().nextstate) {
+        return Weight::Zero();  // Does not follow phi self-loops.
+      }
+      s = matcher_->Value().nextstate;
+      matcher_->SetState(s);
+    }
+    weight = Times(weight, matcher_->Final(s));
+    return weight;
+  }
+
+  ssize_t Priority(StateId s) final {
+    if (phi_label_ != kNoLabel) {
+      matcher_->SetState(s);
+      const bool has_phi = matcher_->Find(phi_label_ == 0 ? -1 : phi_label_);
+      return has_phi ? kRequirePriority : matcher_->Priority(s);
+    } else {
+      return matcher_->Priority(s);
+    }
+  }
+
+  const FST &GetFst() const override { return matcher_->GetFst(); }
+
+  uint64 Properties(uint64 props) const override;
+
+  uint32 Flags() const override {
+    if (phi_label_ == kNoLabel || match_type_ == MATCH_NONE) {
+      return matcher_->Flags();
+    }
+    return matcher_->Flags() | kRequireMatch;
+  }
+
+  Label PhiLabel() const { return phi_label_; }
+
+ private:
+  mutable std::unique_ptr<M> matcher_;
+  MatchType match_type_;  // Type of match requested.
+  Label phi_label_;       // Label that represents the phi transition.
+  bool rewrite_both_;     // Rewrite both sides when both are phi_label_?
+  bool has_phi_;          // Are there possibly phis at the current state?
+  Label phi_match_;       // Current label that matches phi loop.
+  mutable Arc phi_arc_;   // Arc to return.
+  StateId state_;         // Matcher state.
+  Weight phi_weight_;     // Product of the weights of phi transitions taken.
+  bool phi_loop_;         // When true, phi self-loop are allowed and treated
+                          // as rho (required for Aho-Corasick).
+  bool error_;            // Error encountered?
+
+  PhiMatcher &operator=(const PhiMatcher &) = delete;
+};
+
+template <class M>
+inline bool PhiMatcher<M>::Find(Label label) {
+  if (label == phi_label_ && phi_label_ != kNoLabel && phi_label_ != 0) {
+    FSTERROR() << "PhiMatcher::Find: bad label (phi): " << phi_label_;
+    error_ = true;
+    return false;
+  }
+  matcher_->SetState(state_);
+  phi_match_ = kNoLabel;
+  phi_weight_ = Weight::One();
+  // If phi_label_ == 0, there are no more true epsilon arcs.
+  if (phi_label_ == 0) {
+    if (label == kNoLabel) {
+      return false;
+    }
+    if (label == 0) {  // but a virtual epsilon loop needs to be returned.
+      if (!matcher_->Find(kNoLabel)) {
+        return matcher_->Find(0);
+      } else {
+        phi_match_ = 0;
+        return true;
+      }
+    }
+  }
+  if (!has_phi_ || label == 0 || label == kNoLabel) {
+    return matcher_->Find(label);
+  }
+  auto s = state_;
+  while (!matcher_->Find(label)) {
+    // Look for phi transition (if phi_label_ == 0, we need to look
+    // for -1 to avoid getting the virtual self-loop)
+    if (!matcher_->Find(phi_label_ == 0 ? -1 : phi_label_)) return false;
+    if (phi_loop_ && matcher_->Value().nextstate == s) {
+      phi_match_ = label;
+      return true;
+    }
+    phi_weight_ = Times(phi_weight_, matcher_->Value().weight);
+    s = matcher_->Value().nextstate;
+    matcher_->Next();
+    if (!matcher_->Done()) {
+      FSTERROR() << "PhiMatcher: Phi non-determinism not supported";
+      error_ = true;
+    }
+    matcher_->SetState(s);
+  }
+  return true;
+}
+
+template <class M>
+inline uint64 PhiMatcher<M>::Properties(uint64 inprops) const {
+  auto outprops = matcher_->Properties(inprops);
+  if (error_) outprops |= kError;
+  if (match_type_ == MATCH_NONE) {
+    return outprops;
+  } else if (match_type_ == MATCH_INPUT) {
+    if (phi_label_ == 0) {
+      outprops &= ~kEpsilons | ~kIEpsilons | ~kOEpsilons;
+      outprops |= kNoEpsilons | kNoIEpsilons;
+    }
+    if (rewrite_both_) {
+      return outprops &
+             ~(kODeterministic | kNonODeterministic | kString | kILabelSorted |
+               kNotILabelSorted | kOLabelSorted | kNotOLabelSorted);
+    } else {
+      return outprops &
+             ~(kODeterministic | kAcceptor | kString | kILabelSorted |
+               kNotILabelSorted | kOLabelSorted | kNotOLabelSorted);
+    }
+  } else if (match_type_ == MATCH_OUTPUT) {
+    if (phi_label_ == 0) {
+      outprops &= ~kEpsilons | ~kIEpsilons | ~kOEpsilons;
+      outprops |= kNoEpsilons | kNoOEpsilons;
+    }
+    if (rewrite_both_) {
+      return outprops &
+             ~(kIDeterministic | kNonIDeterministic | kString | kILabelSorted |
+               kNotILabelSorted | kOLabelSorted | kNotOLabelSorted);
+    } else {
+      return outprops &
+             ~(kIDeterministic | kAcceptor | kString | kILabelSorted |
+               kNotILabelSorted | kOLabelSorted | kNotOLabelSorted);
+    }
+  } else {
+    // Shouldn't ever get here.
+    FSTERROR() << "PhiMatcher: Bad match type: " << match_type_;
+    return 0;
+  }
+}
+
+// For any requested label that doesn't match at a state, this matcher
 // considers all transitions that match the label 'rho_label' (rho =
 // 'rest').  Each such rho transition found is returned with the
 // rho_label rewritten as the requested label (both sides if an
@@ -612,34 +827,34 @@ class RhoMatcher : public MatcherBase<typename M::Arc> {
 
   MatchType Type(bool test) const override { return matcher_->Type(test); }
 
-  void SetState(StateId state) {
-    if (state == state_) return;
-    state_ = state;
-    matcher_->SetState(state);
+  void SetState(StateId s) final {
+    if (state_ == s) return;
+    state_ = s;
+    matcher_->SetState(s);
     has_rho_ = rho_label_ != kNoLabel;
   }
 
-  bool Find(Label match_label) {
-    if (match_label == rho_label_ && rho_label_ != kNoLabel) {
+  bool Find(Label label) final {
+    if (label == rho_label_ && rho_label_ != kNoLabel) {
       FSTERROR() << "RhoMatcher::Find: bad label (rho)";
       error_ = true;
       return false;
     }
-    if (matcher_->Find(match_label)) {
+    if (matcher_->Find(label)) {
       rho_match_ = kNoLabel;
       return true;
-    } else if (has_rho_ && match_label != 0 && match_label != kNoLabel &&
+    } else if (has_rho_ && label != 0 && label != kNoLabel &&
                (has_rho_ = matcher_->Find(rho_label_))) {
-      rho_match_ = match_label;
+      rho_match_ = label;
       return true;
     } else {
       return false;
     }
   }
 
-  bool Done() const { return matcher_->Done(); }
+  bool Done() const final { return matcher_->Done(); }
 
-  const Arc &Value() const {
+  const Arc &Value() const final {
     if (rho_match_ == kNoLabel) {
       return matcher_->Value();
     } else {
@@ -656,18 +871,18 @@ class RhoMatcher : public MatcherBase<typename M::Arc> {
     }
   }
 
-  void Next() { matcher_->Next(); }
+  void Next() final { matcher_->Next(); }
 
-  Weight Final(StateId state) const { return matcher_->Final(state); }
+  Weight Final(StateId s) const final { return matcher_->Final(s); }
 
-  ssize_t Priority(StateId state) {
-    state_ = state;
-    matcher_->SetState(state);
+  ssize_t Priority(StateId s) final {
+    state_ = s;
+    matcher_->SetState(s);
     has_rho_ = matcher_->Find(rho_label_);
     if (has_rho_) {
       return kRequirePriority;
     } else {
-      return matcher_->Priority(state);
+      return matcher_->Priority(s);
     }
   }
 
@@ -685,29 +900,15 @@ class RhoMatcher : public MatcherBase<typename M::Arc> {
   Label RhoLabel() const { return rho_label_; }
 
  private:
-  void SetState_(StateId state) override { SetState(state); }
-
-  bool Find_(Label label) override { return Find(label); }
-
-  bool Done_() const override { return Done(); }
-
-  const Arc &Value_() const override { return Value(); }
-
-  void Next_() override { Next(); }
-
-  Weight Final_(StateId s) const override { return Final(s); }
-
-  ssize_t Priority_(StateId s) override { return Priority(s); }
-
   std::unique_ptr<M> matcher_;
   MatchType match_type_;  // Type of match requested.
   Label rho_label_;       // Label that represents the rho transition
-  bool rewrite_both_;     // Rewrite both sides when both are 'rho_label_'.
+  bool rewrite_both_;     // Rewrite both sides when both are rho_label_?
   bool has_rho_;          // Are there possibly rhos at the current state?
   Label rho_match_;       // Current label that matches rho transition.
   mutable Arc rho_arc_;   // Arc to return when rho match.
-  bool error_;            // Error encountered.
-  StateId state_;         // Current state.
+  bool error_;            // Error encountered?
+  StateId state_;         // Matcher state.
 };
 
 template <class M>
@@ -807,15 +1008,15 @@ class SigmaMatcher : public MatcherBase<typename M::Arc> {
 
   MatchType Type(bool test) const override { return matcher_->Type(test); }
 
-  void SetState(StateId state) {
-    if (state == state_) return;
-    state_ = state;
-    matcher_->SetState(state);
+  void SetState(StateId s) final {
+    if (state_ == s) return;
+    state_ = s;
+    matcher_->SetState(s);
     has_sigma_ =
         (sigma_label_ != kNoLabel) ? matcher_->Find(sigma_label_) : false;
   }
 
-  bool Find(Label match_label) {
+  bool Find(Label match_label) final {
     match_label_ = match_label;
     if (match_label == sigma_label_ && sigma_label_ != kNoLabel) {
       FSTERROR() << "SigmaMatcher::Find: bad label (sigma)";
@@ -834,9 +1035,9 @@ class SigmaMatcher : public MatcherBase<typename M::Arc> {
     }
   }
 
-  bool Done() const { return matcher_->Done(); }
+  bool Done() const final { return matcher_->Done(); }
 
-  const Arc &Value() const {
+  const Arc &Value() const final {
     if (sigma_match_ == kNoLabel) {
       return matcher_->Value();
     } else {
@@ -853,7 +1054,7 @@ class SigmaMatcher : public MatcherBase<typename M::Arc> {
     }
   }
 
-  void Next() {
+  void Next() final {
     matcher_->Next();
     if (matcher_->Done() && has_sigma_ && (sigma_match_ == kNoLabel) &&
         (match_label_ > 0)) {
@@ -862,14 +1063,14 @@ class SigmaMatcher : public MatcherBase<typename M::Arc> {
     }
   }
 
-  Weight Final(StateId state) const { return matcher_->Final(state); }
+  Weight Final(StateId s) const final { return matcher_->Final(s); }
 
-  ssize_t Priority(StateId state) {
+  ssize_t Priority(StateId s) final {
     if (sigma_label_ != kNoLabel) {
-      SetState(state);
-      return has_sigma_ ? kRequirePriority : matcher_->Priority(state);
+      SetState(s);
+      return has_sigma_ ? kRequirePriority : matcher_->Priority(s);
     } else {
-      return matcher_->Priority(state);
+      return matcher_->Priority(s);
     }
   }
 
@@ -887,30 +1088,16 @@ class SigmaMatcher : public MatcherBase<typename M::Arc> {
   Label SigmaLabel() const { return sigma_label_; }
 
  private:
-  void SetState_(StateId state) override { SetState(state); }
-
-  bool Find_(Label label) override { return Find(label); }
-
-  bool Done_() const override { return Done(); }
-
-  const Arc &Value_() const override { return Value(); }
-
-  void Next_() override { Next(); }
-
-  Weight Final_(StateId s) const override { return Final(s); }
-
-  ssize_t Priority_(StateId s) override { return Priority(s); }
-
   std::unique_ptr<M> matcher_;
   MatchType match_type_;   // Type of match requested.
   Label sigma_label_;      // Label that represents the sigma transition.
-  bool rewrite_both_;      // Rewrite both sides when both are 'sigma_label_'.
+  bool rewrite_both_;      // Rewrite both sides when both are sigma_label_?
   bool has_sigma_;         // Are there sigmas at the current state?
   Label sigma_match_;      // Current label that matches sigma transition.
   mutable Arc sigma_arc_;  // Arc to return when sigma match.
   Label match_label_;      // Label being matched.
-  bool error_;             // Error encountered.
-  StateId state_;          // Current state.
+  bool error_;             // Error encountered?
+  StateId state_;          // Matcher state.
 };
 
 template <class M>
@@ -941,266 +1128,7 @@ inline uint64 SigmaMatcher<M>::Properties(uint64 inprops) const {
   }
 }
 
-// For any requested label that doesn't match at a state, this matcher
-// considers the *unique* transition that matches the label 'phi_label'
-// (phi = 'fail'), and recursively looks for a match at its
-// destination.  When 'phi_loop' is true, if no match is found but a
-// phi self-loop is found, then the phi transition found is returned
-// with the phi_label rewritten as the requested label (both sides if
-// an acceptor, or if 'rewrite_both' is true and both input and output
-// labels of the found transition are 'phi_label').  If 'phi_label' is
-// kNoLabel, this special matching is not done.  PhiMatcher is
-// templated itself on a matcher, which is used to perform the
-// underlying matching.  By default, the underlying matcher is
-// constructed by PhiMatcher. The user can instead pass in this
-// object; in that case, PhiMatcher takes its ownership.
-// Phi non-determinism not supported. No non-consuming symbols other
-// than epsilon supported with the underlying template argument matcher.
-template <class M>
-class PhiMatcher : public MatcherBase<typename M::Arc> {
- public:
-  using FST = typename M::FST;
-  using Arc = typename FST::Arc;
-  using Label = typename Arc::Label;
-  using StateId = typename Arc::StateId;
-  using Weight = typename Arc::Weight;
-
-  PhiMatcher(const FST &fst, MatchType match_type, Label phi_label = kNoLabel,
-             bool phi_loop = true,
-             MatcherRewriteMode rewrite_mode = MATCHER_REWRITE_AUTO,
-             M *matcher = nullptr)
-      : matcher_(matcher ? matcher : new M(fst, match_type)),
-        match_type_(match_type),
-        phi_label_(phi_label),
-        state_(kNoStateId),
-        phi_loop_(phi_loop),
-        error_(false) {
-    if (match_type == MATCH_BOTH) {
-      FSTERROR() << "PhiMatcher: Bad match type";
-      match_type_ = MATCH_NONE;
-      error_ = true;
-    }
-    if (rewrite_mode == MATCHER_REWRITE_AUTO) {
-      rewrite_both_ = fst.Properties(kAcceptor, true);
-    } else if (rewrite_mode == MATCHER_REWRITE_ALWAYS) {
-      rewrite_both_ = true;
-    } else {
-      rewrite_both_ = false;
-    }
-  }
-
-  PhiMatcher(const PhiMatcher<M> &matcher, bool safe = false)
-      : matcher_(new M(*matcher.matcher_, safe)),
-        match_type_(matcher.match_type_),
-        phi_label_(matcher.phi_label_),
-        rewrite_both_(matcher.rewrite_both_),
-        state_(kNoStateId),
-        phi_loop_(matcher.phi_loop_),
-        error_(matcher.error_) {}
-
-  PhiMatcher<M> *Copy(bool safe = false) const override {
-    return new PhiMatcher<M>(*this, safe);
-  }
-
-  MatchType Type(bool test) const override { return matcher_->Type(test); }
-
-  void SetState(StateId state) {
-    if (state == state_) return;
-    matcher_->SetState(state);
-    state_ = state;
-    has_phi_ = phi_label_ != kNoLabel;
-  }
-
-  bool Find(Label match_label);
-
-  bool Done() const { return matcher_->Done(); }
-
-  const Arc &Value() const {
-    if ((phi_match_ == kNoLabel) && (phi_weight_ == Weight::One())) {
-      return matcher_->Value();
-    } else if (phi_match_ == 0) {  // Virtual epsilon loop.
-      phi_arc_ = Arc(kNoLabel, 0, Weight::One(), state_);
-      if (match_type_ == MATCH_OUTPUT) {
-        std::swap(phi_arc_.ilabel, phi_arc_.olabel);
-      }
-      return phi_arc_;
-    } else {
-      phi_arc_ = matcher_->Value();
-      phi_arc_.weight = Times(phi_weight_, phi_arc_.weight);
-      if (phi_match_ != kNoLabel) {  // Phi loop match.
-        if (rewrite_both_) {
-          if (phi_arc_.ilabel == phi_label_) phi_arc_.ilabel = phi_match_;
-          if (phi_arc_.olabel == phi_label_) phi_arc_.olabel = phi_match_;
-        } else if (match_type_ == MATCH_INPUT) {
-          phi_arc_.ilabel = phi_match_;
-        } else {
-          phi_arc_.olabel = phi_match_;
-        }
-      }
-      return phi_arc_;
-    }
-  }
-
-  void Next() { matcher_->Next(); }
-
-  Weight Final(StateId state) const {
-    Weight final_weight = matcher_->Final(state);
-    if (phi_label_ == kNoLabel || final_weight != Weight::Zero()) {
-      return final_weight;
-    }
-    final_weight = Weight::One();
-    StateId s = state;
-    matcher_->SetState(s);
-    while (matcher_->Final(s) == Weight::Zero()) {
-      if (!matcher_->Find(phi_label_ == 0 ? -1 : phi_label_)) break;
-      final_weight = Times(final_weight, matcher_->Value().weight);
-      if (s == matcher_->Value().nextstate) {
-        return Weight::Zero();  // Do not follow phi self-loops.
-      }
-      s = matcher_->Value().nextstate;
-      matcher_->SetState(s);
-    }
-    final_weight = Times(final_weight, matcher_->Final(s));
-    return final_weight;
-  }
-
-  ssize_t Priority(StateId state) {
-    if (phi_label_ != kNoLabel) {
-      matcher_->SetState(state);
-      const bool has_phi = matcher_->Find(phi_label_ == 0 ? -1 : phi_label_);
-      return has_phi ? kRequirePriority : matcher_->Priority(state);
-    } else {
-      return matcher_->Priority(state);
-    }
-  }
-
-  const FST &GetFst() const override { return matcher_->GetFst(); }
-
-  uint64 Properties(uint64 props) const override;
-
-  uint32 Flags() const override {
-    if (phi_label_ == kNoLabel || match_type_ == MATCH_NONE) {
-      return matcher_->Flags();
-    }
-    return matcher_->Flags() | kRequireMatch;
-  }
-
-  Label PhiLabel() const { return phi_label_; }
-
- private:
-  void SetState_(StateId s) override { SetState(s); }
-  bool Find_(Label label) override { return Find(label); }
-  bool Done_() const override { return Done(); }
-  const Arc &Value_() const override { return Value(); }
-  void Next_() override { Next(); }
-  Weight Final_(StateId s) const override { return Final(s); }
-  ssize_t Priority_(StateId s) override { return Priority(s); }
-
-  mutable std::unique_ptr<M> matcher_;
-  MatchType match_type_;  // Type of match requested
-  Label phi_label_;       // Label that represents the phi transition
-  bool rewrite_both_;     // Rewrite both sides when both are 'phi_label_'
-  bool has_phi_;          // Are there possibly phis at the current state?
-  Label phi_match_;       // Current label that matches phi loop
-  mutable Arc phi_arc_;   // Arc to return
-  StateId state_;         // State where looking for matches
-  Weight phi_weight_;     // Product of the weights of phi transitions taken
-  bool phi_loop_;         // When true, phi self-loop are allowed and treated
-                          // as rho (required for Aho-Corasick)
-  bool error_;            // Error encountered
-
-  PhiMatcher &operator=(const PhiMatcher &) = delete;
-};
-
-template <class M>
-inline bool PhiMatcher<M>::Find(Label match_label) {
-  if (match_label == phi_label_ && phi_label_ != kNoLabel && phi_label_ != 0) {
-    FSTERROR() << "PhiMatcher::Find: bad label (phi): " << phi_label_;
-    error_ = true;
-    return false;
-  }
-  matcher_->SetState(state_);
-  phi_match_ = kNoLabel;
-  phi_weight_ = Weight::One();
-  if (phi_label_ == 0) {            // When 'phi_label_ == 0',
-    if (match_label == kNoLabel) {  // there are no more true epsilon arcs,
-      return false;
-    }
-    if (match_label == 0) {  // but virtual eps loop needs to be returned
-      if (!matcher_->Find(kNoLabel)) {
-        return matcher_->Find(0);
-      } else {
-        phi_match_ = 0;
-        return true;
-      }
-    }
-  }
-  if (!has_phi_ || match_label == 0 || match_label == kNoLabel) {
-    return matcher_->Find(match_label);
-  }
-  StateId state = state_;
-  while (!matcher_->Find(match_label)) {
-    // Look for phi transition (if phi_label_ == 0, we need to look
-    // for -1 to avoid getting the virtual self-loop)
-    if (!matcher_->Find(phi_label_ == 0 ? -1 : phi_label_)) return false;
-    if (phi_loop_ && matcher_->Value().nextstate == state) {
-      phi_match_ = match_label;
-      return true;
-    }
-    phi_weight_ = Times(phi_weight_, matcher_->Value().weight);
-    state = matcher_->Value().nextstate;
-    matcher_->Next();
-    if (!matcher_->Done()) {
-      FSTERROR() << "PhiMatcher: Phi non-determinism not supported";
-      error_ = true;
-    }
-    matcher_->SetState(state);
-  }
-  return true;
-}
-
-template <class M>
-inline uint64 PhiMatcher<M>::Properties(uint64 inprops) const {
-  auto outprops = matcher_->Properties(inprops);
-  if (error_) outprops |= kError;
-  if (match_type_ == MATCH_NONE) {
-    return outprops;
-  } else if (match_type_ == MATCH_INPUT) {
-    if (phi_label_ == 0) {
-      outprops &= ~kEpsilons | ~kIEpsilons | ~kOEpsilons;
-      outprops |= kNoEpsilons | kNoIEpsilons;
-    }
-    if (rewrite_both_) {
-      return outprops &
-             ~(kODeterministic | kNonODeterministic | kString | kILabelSorted |
-               kNotILabelSorted | kOLabelSorted | kNotOLabelSorted);
-    } else {
-      return outprops &
-             ~(kODeterministic | kAcceptor | kString | kILabelSorted |
-               kNotILabelSorted | kOLabelSorted | kNotOLabelSorted);
-    }
-  } else if (match_type_ == MATCH_OUTPUT) {
-    if (phi_label_ == 0) {
-      outprops &= ~kEpsilons | ~kIEpsilons | ~kOEpsilons;
-      outprops |= kNoEpsilons | kNoOEpsilons;
-    }
-    if (rewrite_both_) {
-      return outprops &
-             ~(kIDeterministic | kNonIDeterministic | kString | kILabelSorted |
-               kNotILabelSorted | kOLabelSorted | kNotOLabelSorted);
-    } else {
-      return outprops &
-             ~(kIDeterministic | kAcceptor | kString | kILabelSorted |
-               kNotILabelSorted | kOLabelSorted | kNotOLabelSorted);
-    }
-  } else {
-    // Shouldn't ever get here.
-    FSTERROR() << "PhiMatcher: Bad match type: " << match_type_;
-    return 0;
-  }
-}
-
-// MULTI-EPS MATCHER FLAGS.
+// Flags for MultiEpsMatcher.
 
 // Return multi-epsilon arcs for Find(kNoLabel).
 const uint32 kMultiEpsList = 0x00000001;
@@ -1265,7 +1193,7 @@ class MultiEpsMatcher {
     loop_.nextstate = state;
   }
 
-  bool Find(Label match_label);
+  bool Find(Label label);
 
   bool Done() const { return done_; }
 
@@ -1292,18 +1220,18 @@ class MultiEpsMatcher {
     }
   }
 
-  Weight Final(StateId state) const { return matcher_->Final(state); }
-
-  ssize_t Priority(StateId state) { return matcher_->Priority(state); }
-
   const FST &GetFst() const { return matcher_->GetFst(); }
 
+  uint64 Properties(uint64 props) const { return matcher_->Properties(props); }
+
   const M *GetMatcher() const { return matcher_; }
 
-  uint64 Properties(uint64 props) const { return matcher_->Properties(props); }
+  Weight Final(StateId s) const { return matcher_->Final(s); }
 
   uint32 Flags() const { return matcher_->Flags(); }
 
+  ssize_t Priority(StateId s) { return matcher_->Priority(s); }
+
   void AddMultiEpsLabel(Label label) {
     if (label == 0) {
       FSTERROR() << "MultiEpsMatcher: Bad multi-eps label: 0";
@@ -1331,21 +1259,21 @@ class MultiEpsMatcher {
   CompactSet<Label, kNoLabel> multi_eps_labels_;
   typename CompactSet<Label, kNoLabel>::const_iterator multi_eps_iter_;
 
-  bool current_loop_;  // Current arc is the implicit loop.
+  bool current_loop_;  // Current arc is the implicit loop?
   mutable Arc loop_;   // For non-consuming symbols.
-  bool done_;          // Matching done.
+  bool done_;          // Matching done?
 
   MultiEpsMatcher &operator=(const MultiEpsMatcher &) = delete;
 };
 
 template <class M>
-inline bool MultiEpsMatcher<M>::Find(Label match_label) {
+inline bool MultiEpsMatcher<M>::Find(Label label) {
   multi_eps_iter_ = multi_eps_labels_.End();
   current_loop_ = false;
   bool ret;
-  if (match_label == 0) {
+  if (label == 0) {
     ret = matcher_->Find(0);
-  } else if (match_label == kNoLabel) {
+  } else if (label == kNoLabel) {
     if (flags_ & kMultiEpsList) {
       // Returns all non-consuming arcs (including epsilon).
       multi_eps_iter_ = multi_eps_labels_.Begin();
@@ -1363,18 +1291,18 @@ inline bool MultiEpsMatcher<M>::Find(Label match_label) {
       ret = matcher_->Find(kNoLabel);
     }
   } else if ((flags_ & kMultiEpsLoop) &&
-             multi_eps_labels_.Find(match_label) != multi_eps_labels_.End()) {
-    // Returns 'implicit' loop.
+             multi_eps_labels_.Find(label) != multi_eps_labels_.End()) {
+    // Returns implicit loop.
     current_loop_ = true;
     ret = true;
   } else {
-    ret = matcher_->Find(match_label);
+    ret = matcher_->Find(label);
   }
   done_ = !ret;
   return ret;
 }
 
-// This class discards any implicit matches (e.g. the implicit epsilon
+// This class discards any implicit matches (e.g., the implicit epsilon
 // self-loops in the SortedMatcher). Matchers are most often used in
 // composition/intersection where the implicit matches are needed
 // e.g. for epsilon processing. However, if a matcher is simply being
@@ -1406,35 +1334,35 @@ class ExplicitMatcher : public MatcherBase<typename M::Arc> {
 
   MatchType Type(bool test) const override { return matcher_->Type(test); }
 
-  void SetState(StateId state) { matcher_->SetState(state); }
+  void SetState(StateId s) final { matcher_->SetState(s); }
 
-  bool Find(Label match_label) {
-    matcher_->Find(match_label);
+  bool Find(Label label) final {
+    matcher_->Find(label);
     CheckArc();
     return !Done();
   }
 
-  bool Done() const { return matcher_->Done(); }
+  bool Done() const final { return matcher_->Done(); }
 
-  const Arc &Value() const { return matcher_->Value(); }
+  const Arc &Value() const final { return matcher_->Value(); }
 
-  void Next() {
+  void Next() final {
     matcher_->Next();
     CheckArc();
   }
 
-  Weight Final(StateId state) const { return matcher_->Final(state); }
+  Weight Final(StateId s) const final { return matcher_->Final(s); }
 
-  ssize_t Priority(StateId state) { return matcher_->Priority(state); }
-
-  const FST &GetFst() const override { return matcher_->GetFst(); }
+  ssize_t Priority(StateId s) final { return matcher_->Priority(s); }
 
-  const M *GetMatcher() const { return matcher_.get(); }
+  const FST &GetFst() const final { return matcher_->GetFst(); }
 
   uint64 Properties(uint64 inprops) const override {
     return matcher_->Properties(inprops);
   }
 
+  const M *GetMatcher() const { return matcher_.get(); }
+
   uint32 Flags() const override { return matcher_->Flags(); }
 
  private:
@@ -1442,41 +1370,28 @@ class ExplicitMatcher : public MatcherBase<typename M::Arc> {
   // not explicit, checks next ones.
   void CheckArc() {
     for (; !matcher_->Done(); matcher_->Next()) {
-      Label label = match_type_ == MATCH_INPUT ? matcher_->Value().ilabel
-                                               : matcher_->Value().olabel;
+      const auto label = match_type_ == MATCH_INPUT ? matcher_->Value().ilabel
+                                                    : matcher_->Value().olabel;
       if (label != kNoLabel) return;
     }
   }
 
-  void SetState_(StateId state) override { SetState(state); }
-
-  bool Find_(Label label) override { return Find(label); }
-
-  bool Done_() const override { return Done(); }
-
-  const Arc &Value_() const override { return Value(); }
-
-  void Next_() override { Next(); }
-
-  Weight Final_(StateId s) const override { return Final(s); }
-
-  ssize_t Priority_(StateId s) override { return Priority(s); }
-
   std::unique_ptr<M> matcher_;
   MatchType match_type_;  // Type of match requested.
-  bool error_;            // Error encountered.
+  bool error_;            // Error encountered?
 };
 
-// Generic matcher, templated on the FST definition
-// - a wrapper around pointer to specific one.
-// Here is a typical use: \code
+// Generic matcher, templated on the FST definition.
+//
+// Here is a typical use:
+//
 //   Matcher<StdFst> matcher(fst, MATCH_INPUT);
 //   matcher.SetState(state);
 //   if (matcher.Find(label))
 //     for (; !matcher.Done(); matcher.Next()) {
-//       StdArc &arc = matcher.Value();
+//       auto &arc = matcher.Value();
 //       ...
-//     } \endcode
+//     }
 template <class F>
 class Matcher {
  public:
@@ -1495,7 +1410,7 @@ class Matcher {
     base_.reset(matcher.base_->Copy(safe));
   }
 
-  // Takes ownership of the provided matcher
+  // Takes ownership of the provided matcher.
   explicit Matcher(MatcherBase<Arc> *base_matcher) {
     base_.reset(base_matcher);
   }
@@ -1506,7 +1421,7 @@ class Matcher {
 
   MatchType Type(bool test) const { return base_->Type(test); }
 
-  void SetState(StateId state) { base_->SetState(state); }
+  void SetState(StateId s) { base_->SetState(s); }
 
   bool Find(Label label) { return base_->Find(label); }
 
@@ -1516,18 +1431,18 @@ class Matcher {
 
   void Next() { base_->Next(); }
 
-  Weight Final(StateId state) const { return base_->Final(state); }
-
-  ssize_t Priority(StateId state) { return base_->Priority(state); }
-
   const FST &GetFst() const {
     return static_cast<const FST &>(base_->GetFst());
   }
 
   uint64 Properties(uint64 props) const { return base_->Properties(props); }
 
+  Weight Final(StateId s) const { return base_->Final(s); }
+
   uint32 Flags() const { return base_->Flags() & kMatcherFlags; }
 
+  ssize_t Priority(StateId s) { return base_->Priority(s); }
+
  private:
   std::unique_ptr<MatcherBase<Arc>> base_;
 };
index 55ef1be..75b950c 100644 (file)
@@ -12,6 +12,7 @@
 #include <vector>
 
 #include <fst/types.h>
+#include <fst/log.h>
 #include <fstream>
 
 namespace fst {
index 8277057..74a4877 100644 (file)
@@ -14,6 +14,8 @@
 #include <utility>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/arcsort.h>
 #include <fst/connect.h>
 #include <fst/dfs-visit.h>
index 9ce9b84..90aea94 100644 (file)
@@ -15,6 +15,7 @@
 #include <utility>
 #include <vector>
 
+#include <fst/log.h>
 #include <fstream>
 
 #include <fst/expanded-fst.h>
@@ -94,7 +95,7 @@ class MutableFst : public ExpandedFst<A> {
   // Gets a copy of this MutableFst. See Fst<>::Copy() for further doc.
   MutableFst<A> *Copy(bool safe = false) const override = 0;
 
-  // Reads an MutableFst from an input stream, returning nullptr on error.
+  // Reads a MutableFst from an input stream, returning nullptr on error.
   static MutableFst<Arc> *Read(std::istream &strm, const FstReadOptions &opts) {
     FstReadOptions ropts(opts);
     FstHeader hdr;
index f02a668..7735d73 100644 (file)
@@ -12,6 +12,8 @@
 #include <string>
 #include <utility>
 
+#include <fst/log.h>
+
 #include <fst/weight.h>
 
 
index d59df75..032ccfc 100644 (file)
@@ -9,6 +9,8 @@
 #include <utility>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/arcfilter.h>
 #include <fst/heap.h>
 #include <fst/shortest-distance.h>
index bb74434..13bb55d 100644 (file)
@@ -9,6 +9,8 @@
 
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/arc-map.h>
 #include <fst/factor-weight.h>
 #include <fst/fst.h>
index f84ec40..926320c 100644 (file)
@@ -11,6 +11,8 @@
 #include <utility>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/arcfilter.h>
 #include <fst/connect.h>
 #include <fst/heap.h>
index 9411041..b4cd843 100644 (file)
@@ -7,6 +7,8 @@
 #ifndef FST_LIB_RANDEQUIVALENT_H_
 #define FST_LIB_RANDEQUIVALENT_H_
 
+#include <fst/log.h>
+
 #include <fst/arcsort.h>
 #include <fst/compose.h>
 #include <fst/project.h>
index 68ad374..0a6089c 100644 (file)
@@ -108,7 +108,9 @@ class FastLogProbArcSelector : public LogProbArcSelector<Arc> {
                                                        fst.NumArcs(s)))
                            .Value();
     const double r = -log(rand() / (RAND_MAX + 1.0));  // NOLINT
-    return accumulator->LowerBound(r + sum, &aiter);
+    Weight w = from_log_weight_(r + sum);
+    aiter.Reset();
+    return accumulator->LowerBound(w, &aiter);
   }
 
   time_t Seed() const { return seed_; }
@@ -116,6 +118,7 @@ class FastLogProbArcSelector : public LogProbArcSelector<Arc> {
  private:
   const time_t seed_;
   WeightConvert<Weight, Log64Weight> to_log_weight_;
+  WeightConvert<Log64Weight, Weight> from_log_weight_;
 };
 
 // Random path state info maintained by RandGenFst and passed to samplers.
index a475a35..1d48814 100644 (file)
@@ -15,6 +15,7 @@
 
 
 #include <fst/types.h>
+#include <fst/log.h>
 
 namespace fst {
 
index 014c463..3263ac1 100644 (file)
@@ -11,6 +11,8 @@
 #include <utility>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/cache.h>
 #include <fst/test-properties.h>
 
@@ -73,26 +75,42 @@ void Relabel(
 // Relabels either the input labels or output labels. The old to
 // new labels are specified using pairs of old and new symbol tables.
 // The tables must contain (at least) all labels on the appropriate side of the
-// FST.
+// FST. If the 'unknown_i(o)symbol' is non-empty, it is used to label any
+// missing symbol in new_i(o)symbols table.
 template <class Arc>
-void Relabel(MutableFst<Arc> *fst, const SymbolTable *old_isymbols,
-             const SymbolTable *new_isymbols, bool attach_new_isymbols,
+void Relabel(MutableFst<Arc> *fst,
+             const SymbolTable *old_isymbols, const SymbolTable *new_isymbols,
+             const string &unknown_isymbol, bool attach_new_isymbols,
              const SymbolTable *old_osymbols, const SymbolTable *new_osymbols,
-             bool attach_new_osymbols) {
+             const string &unknown_osymbol, bool attach_new_osymbols) {
   using Label = typename Arc::Label;
   // Constructs vectors of input-side label pairs.
   std::vector<std::pair<Label, Label>> ipairs;
   if (old_isymbols && new_isymbols) {
     size_t num_missing_syms = 0;
+    Label unknown_ilabel = kNoLabel;
+    if (!unknown_isymbol.empty()) {
+      unknown_ilabel = new_isymbols->Find(unknown_isymbol);
+      if (unknown_ilabel == kNoLabel) {
+        VLOG(1) << "Input symbol '" << unknown_isymbol
+                << "' missing from target symbol table";
+        ++num_missing_syms;
+      }
+    }
+
     for (SymbolTableIterator siter(*old_isymbols); !siter.Done();
          siter.Next()) {
       const auto old_index = siter.Value();
       const auto symbol = siter.Symbol();
-      const auto new_index = new_isymbols->Find(siter.Symbol());
+      auto new_index = new_isymbols->Find(siter.Symbol());
       if (new_index == kNoLabel) {
-        VLOG(1) << "Input symbol ID " << new_index << " symbol '" << symbol
-                << "' missing from target symbol table";
-        ++num_missing_syms;
+        if (unknown_ilabel != kNoLabel) {
+          new_index = unknown_ilabel;
+        } else {
+          VLOG(1) << "Input symbol ID " << old_index << " symbol '" << symbol
+                  << "' missing from target symbol table";
+          ++num_missing_syms;
+        }
       }
       ipairs.push_back(std::make_pair(old_index, new_index));
     }
@@ -106,15 +124,29 @@ void Relabel(MutableFst<Arc> *fst, const SymbolTable *old_isymbols,
   std::vector<std::pair<Label, Label>> opairs;
   if (old_osymbols && new_osymbols) {
     size_t num_missing_syms = 0;
+    Label unknown_olabel = kNoLabel;
+    if (!unknown_osymbol.empty()) {
+      unknown_olabel = new_osymbols->Find(unknown_osymbol);
+      if (unknown_olabel == kNoLabel) {
+        VLOG(1) << "Output symbol '" << unknown_osymbol
+                << "' missing from target symbol table";
+        ++num_missing_syms;
+      }
+    }
+
     for (SymbolTableIterator siter(*old_osymbols); !siter.Done();
          siter.Next()) {
       const auto old_index = siter.Value();
       const auto symbol = siter.Symbol();
-      const auto new_index = new_osymbols->Find(siter.Symbol());
+      auto new_index = new_osymbols->Find(siter.Symbol());
       if (new_index == kNoLabel) {
-        VLOG(1) << "Output symbol ID " << new_index << " symbol '" << symbol
-                << "' missing from target symbol table";
-        ++num_missing_syms;
+        if (unknown_olabel != kNoLabel) {
+          new_index = unknown_olabel;
+        } else {
+          VLOG(1) << "Output symbol ID " << old_index << " symbol '" << symbol
+                  << "' missing from target symbol table";
+          ++num_missing_syms;
+        }
       }
       opairs.push_back(std::make_pair(old_index, new_index));
     }
@@ -128,6 +160,21 @@ void Relabel(MutableFst<Arc> *fst, const SymbolTable *old_isymbols,
   Relabel(fst, ipairs, opairs);
 }
 
+// Same as previous but no special allowance for unknown symbols. Kept
+// for backward compat.
+template <class Arc>
+void Relabel(MutableFst<Arc> *fst, const SymbolTable *old_isymbols,
+             const SymbolTable *new_isymbols, bool attach_new_isymbols,
+             const SymbolTable *old_osymbols, const SymbolTable *new_osymbols,
+             bool attach_new_osymbols) {
+  Relabel(fst,
+          old_isymbols, new_isymbols, "" /* no unknown isymbol */,
+          attach_new_isymbols,
+          old_osymbols, new_osymbols, "" /* no unknown ioymbol */,
+          attach_new_osymbols);
+}
+
+
 // Relabels either the input labels or output labels. The old to
 // new labels are specified using symbol tables. Any label associations not
 // specified are assumed to be identity mapping.
@@ -373,25 +420,25 @@ class RelabelFst : public ImplToFst<internal::RelabelFstImpl<A>> {
 
 // Specialization for RelabelFst.
 template <class Arc>
-class StateIterator<RelabelFst<Arc>> final : public StateIteratorBase<Arc> {
+class StateIterator<RelabelFst<Arc>> : public StateIteratorBase<Arc> {
  public:
   using StateId = typename Arc::StateId;
 
   explicit StateIterator(const RelabelFst<Arc> &fst)
       : impl_(fst.GetImpl()), siter_(*impl_->fst_), s_(0) {}
 
-  bool Done() const override { return siter_.Done(); }
+  bool Done() const final { return siter_.Done(); }
 
-  StateId Value() const override { return s_; }
+  StateId Value() const final { return s_; }
 
-  void Next() override {
+  void Next() final {
     if (!siter_.Done()) {
       ++s_;
       siter_.Next();
     }
   }
 
-  void Reset() override {
+  void Reset() final {
     s_ = 0;
     siter_.Reset();
   }
index 391c33f..efbd3cb 100644 (file)
@@ -11,6 +11,8 @@
 #include <unordered_set>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/connect.h>
 #include <fst/mutable-fst.h>
 #include <fst/topsort.h>
index 1007677..0537019 100644 (file)
@@ -12,6 +12,8 @@
 #include <utility>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/cache.h>
 #include <fst/expanded-fst.h>
 #include <fst/fst-decl.h>  // For optional argument declarations.
@@ -1319,9 +1321,8 @@ class ReplaceFstMatcher : public MatcherBase<Arc> {
 
   uint64 Properties(uint64 props) const override { return props; }
 
- private:
   // Sets the state from which our matching happens.
-  void SetState_(StateId s) override {
+  void SetState(StateId s) final {
     if (s_ == s) return;
     s_ = s;
     tuple_ = impl_->GetStateTable()->Tuple(s_);
@@ -1343,7 +1344,7 @@ class ReplaceFstMatcher : public MatcherBase<Arc> {
   // MultiEpsilonMatcher to search for possible matches of non-terminals. If the
   // component FST
   // reaches a final state we also need to add the exiting final arc.
-  bool Find_(Label label) override {
+  bool Find(Label label) final {
     bool found = false;
     label_ = label;
     if (label_ == 0 || label_ == kNoLabel) {
@@ -1362,14 +1363,12 @@ class ReplaceFstMatcher : public MatcherBase<Arc> {
     return found;
   }
 
-  bool Done_() const override {
+  bool Done() const final {
     return !current_loop_ && !final_arc_ && current_matcher_->Done();
   }
 
-  const Arc &Value_() const override {
-    if (current_loop_) {
-      return loop_;
-    }
+  const Arc &Value() const final {
+    if (current_loop_) return loop_;
     if (final_arc_) {
       impl_->ComputeFinalArc(tuple_, &arc_);
       return arc_;
@@ -1379,7 +1378,7 @@ class ReplaceFstMatcher : public MatcherBase<Arc> {
     return arc_;
   }
 
-  void Next_() override {
+  void Next() final {
     if (current_loop_) {
       current_loop_ = false;
       return;
@@ -1391,16 +1390,15 @@ class ReplaceFstMatcher : public MatcherBase<Arc> {
     current_matcher_->Next();
   }
 
-  ssize_t Priority_(StateId s) override { return fst_.NumArcs(s); }
+  ssize_t Priority(StateId s) final { return fst_.NumArcs(s); }
 
+ private:
   const ReplaceFst<Arc, StateTable, CacheStore> &fst_;
   internal::ReplaceFstImpl<Arc, StateTable, CacheStore> *impl_;
   LocalMatcher *current_matcher_;
   std::vector<std::unique_ptr<LocalMatcher>> matcher_;
-
-  StateId s_;    // Current state.
-  Label label_;  // Current label.
-
+  StateId s_;             // Current state.
+  Label label_;           // Current label.
   MatchType match_type_;  // Supplied by caller.
   mutable bool done_;
   mutable bool current_loop_;  // Current arc is the implicit loop.
index 2a11735..1a9af0a 100644 (file)
@@ -7,6 +7,7 @@
 #define FST_LIB_REWEIGHT_H_
 
 #include <vector>
+#include <fst/log.h>
 
 #include <fst/mutable-fst.h>
 
index 844d283..9fdf490 100644 (file)
@@ -13,6 +13,8 @@
 #include <utility>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/arcfilter.h>
 #include <fst/cache.h>
 #include <fst/connect.h>
index db6c925..2fe6846 100644 (file)
@@ -30,7 +30,7 @@ class FstDrawer {
             const SymbolTable *osyms, const SymbolTable *ssyms, bool accep,
             const string &title, float width, float height, bool portrait,
             bool vertical, float ranksep, float nodesep, int fontsize,
-            int precision, bool show_weight_one)
+            int precision, const string &float_format, bool show_weight_one)
       : fst_(fst),
         isyms_(isyms),
         osyms_(osyms),
@@ -46,12 +46,18 @@ class FstDrawer {
         nodesep_(nodesep),
         fontsize_(fontsize),
         precision_(precision),
+        float_format_(float_format),
         show_weight_one_(show_weight_one) {}
 
   // Draw Fst to an output buffer (or stdout if buf = 0)
   void Draw(std::ostream *strm, const string &dest) {
     ostrm_ = strm;
     ostrm_->precision(precision_);
+    if (float_format_ == "e")
+        ostrm_->setf(std::ios_base::scientific, std::ios_base::floatfield);
+    if (float_format_ == "f")
+        ostrm_->setf(std::ios_base::fixed, std::ios_base::floatfield);
+    // O.w. defaults to "g" per standard lib.
     dest_ = dest;
     StateId start = fst_.Start();
     if (start == kNoStateId) return;
@@ -199,6 +205,7 @@ class FstDrawer {
   float nodesep_;
   int fontsize_;
   int precision_;
+  string float_format_;
   bool show_weight_one_;
 
   FstDrawer(const FstDrawer &) = delete;
index b64bf6b..936b93b 100644 (file)
@@ -32,6 +32,7 @@ struct FstDrawerArgs {
   const float nodesep;
   const int fontsize;
   const int precision;
+  const string &float_format;  // NOLINT
   const bool show_weight_one;
   std::ostream *ostrm;
   const string &dest;
@@ -40,8 +41,8 @@ struct FstDrawerArgs {
                 const SymbolTable *osyms, const SymbolTable *ssyms, bool accep,
                 const string &title, float width, float height, bool portrait,
                 bool vertical, float ranksep, float nodesep, int fontsize,
-                int precision, bool show_weight_one, std::ostream *ostrm,
-                const string &dest)
+                int precision, const string &float_format,
+                bool show_weight_one, std::ostream *ostrm,  const string &dest)
       : fst(fst),
         isyms(isyms),
         osyms(osyms),
@@ -56,6 +57,7 @@ struct FstDrawerArgs {
         nodesep(nodesep),
         fontsize(fontsize),
         precision(precision),
+        float_format(float_format),
         show_weight_one(show_weight_one),
         ostrm(ostrm),
         dest(dest) {}
@@ -67,7 +69,8 @@ void DrawFst(FstDrawerArgs *args) {
   FstDrawer<Arc> fstdrawer(
       fst, args->isyms, args->osyms, args->ssyms, args->accep, args->title,
       args->width, args->height, args->portrait, args->vertical, args->ranksep,
-      args->nodesep, args->fontsize, args->precision, args->show_weight_one);
+      args->nodesep, args->fontsize, args->precision, args->float_format,
+      args->show_weight_one);
   fstdrawer.Draw(args->ostrm, args->dest);
 }
 
@@ -75,8 +78,8 @@ void DrawFst(const FstClass &fst, const SymbolTable *isyms,
              const SymbolTable *osyms, const SymbolTable *ssyms, bool accep,
              const string &title, float width, float height, bool portrait,
              bool vertical, float ranksep, float nodesep, int fontsize,
-             int precision, bool show_weight_one, std::ostream *ostrm,
-             const string &dest);
+             int precision, const string &float_format, bool show_weight_one,
+             std::ostream *ostrm, const string &dest);
 
 }  // namespace script
 }  // namespace fst
index bfa45e3..8ab0cd0 100644 (file)
@@ -22,6 +22,7 @@
 #include <fst/script/script-impl.h>   // For RandArcSelection.
 
 #include <fst/types.h>
+#include <fst/log.h>
 
 namespace fst {
 namespace script {
index 7681499..99c98ee 100644 (file)
@@ -17,14 +17,17 @@ namespace script {
 
 // 1
 using RelabelArgs1 =
-    args::Package<MutableFstClass *, const SymbolTable *, const SymbolTable *,
-                  bool, const SymbolTable *, const SymbolTable *, bool>;
+    args::Package<MutableFstClass *,
+                  const SymbolTable *, const SymbolTable *,
+                  const string &, bool,
+                  const SymbolTable *, const SymbolTable *,
+                  const string &, bool>;
 
 template <class Arc>
 void Relabel(RelabelArgs1 *args) {
   MutableFst<Arc> *ofst = args->arg1->GetMutableFst<Arc>();
   Relabel(ofst, args->arg2, args->arg3, args->arg4, args->arg5, args->arg6,
-          args->arg7);
+          args->arg7, args->arg8, args->arg9);
 }
 
 using LabelPair = std::pair<int64, int64>;
@@ -58,10 +61,11 @@ void Relabel(args::Package<MutableFstClass *, const SymbolTable *,
 }
 
 // 1
-void Relabel(MutableFstClass *ofst, const SymbolTable *old_isymbols,
-             const SymbolTable *new_isymbols, bool attach_new_isymbols,
+void Relabel(MutableFstClass *ofst,
+             const SymbolTable *old_isymbols, const SymbolTable *new_isymbols,
+             const string &unknown_isymbol,  bool attach_new_isymbols,
              const SymbolTable *old_osymbols, const SymbolTable *new_osymbols,
-             bool attach_new_osymbols);
+             const string &unknown_osymbol, bool attach_new_osymbols);
 
 // 2
 void Relabel(MutableFstClass *ofst, const std::vector<LabelPair> &ipairs,
index 6cf3e85..0b94752 100644 (file)
@@ -88,6 +88,7 @@
 #include <fst/script/fst-class.h>
 
 #include <fst/types.h>
+#include <fst/log.h>
 
 namespace fst {
 namespace script {
index 384191f..b52330b 100644 (file)
@@ -9,6 +9,8 @@
 #include <deque>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/arcfilter.h>
 #include <fst/cache.h>
 #include <fst/queue.h>
index 18a5d64..b96efe0 100644 (file)
@@ -10,6 +10,8 @@
 #include <utility>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/cache.h>
 #include <fst/determinize.h>
 #include <fst/queue.h>
index 074b05d..721937a 100644 (file)
@@ -12,6 +12,8 @@
 #include <string>
 #include <utility>
 
+#include <fst/log.h>
+
 #include <fst/arc-map.h>
 #include <fst/cache.h>
 #include <fst/mutable-fst.h>
@@ -155,7 +157,7 @@ class StateMapFst;
 
 // Facade around StateIteratorBase<A> inheriting from StateIteratorBase<B>.
 template <class A, class B>
-class StateMapStateIteratorBase final : public StateIteratorBase<B> {
+class StateMapStateIteratorBase : public StateIteratorBase<B> {
  public:
   using Arc = B;
   using StateId = typename Arc::StateId;
@@ -163,13 +165,13 @@ class StateMapStateIteratorBase final : public StateIteratorBase<B> {
   explicit StateMapStateIteratorBase(StateIteratorBase<A> *base)
       : base_(base) {}
 
-  bool Done() const override { return base_->Done(); }
+  bool Done() const final { return base_->Done(); }
 
-  StateId Value() const override { return base_->Value(); }
+  StateId Value() const final { return base_->Value(); }
 
-  void Next() override { base_->Next(); }
+  void Next() final { base_->Next(); }
 
-  void Reset() override { base_->Reset(); }
+  void Reset() final { base_->Reset(); }
 
  private:
   std::unique_ptr<StateIteratorBase<A>> base_;
index e946f23..ab17ac6 100644 (file)
@@ -9,6 +9,8 @@
 
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/connect.h>
 #include <fst/dfs-visit.h>
 #include <fst/fst.h>
index 973967a..e92fcbf 100644 (file)
@@ -10,6 +10,8 @@
 #include <utility>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/bi-table.h>
 #include <fst/expanded-fst.h>
 #include <fst/filter-state.h>
index 477b5a5..0651e56 100644 (file)
@@ -9,6 +9,8 @@
 #include <algorithm>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/mutable-fst.h>
 
 
index c10157a..032fc65 100644 (file)
@@ -10,6 +10,8 @@
 #include <string>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/compact-fst.h>
 #include <fst/icu.h>
 #include <fst/mutable-fst.h>
index 8ffb76d..02ee804 100644 (file)
@@ -7,16 +7,17 @@
 #define FST_LIB_SYMBOL_TABLE_H_
 
 #include <cstring>
+#include <functional>
 #include <ios>
 #include <iostream>
 #include <memory>
 #include <sstream>
 #include <string>
-#include <unordered_map>
 #include <utility>
 #include <vector>
 
 #include <fst/compat.h>
+#include <fst/log.h>
 #include <fstream>
 #include <map>
 
@@ -226,7 +227,7 @@ class SymbolTable {
 
   virtual ~SymbolTable() {}
 
-  // Reads an text representation of the symbol table from an istream. Pass a
+  // Reads a text representation of the symbol table from an istream. Pass a
   // name to give the resulting SymbolTable.
   static SymbolTable* ReadText(std::istream &strm,
       const string &name,
@@ -239,7 +240,7 @@ class SymbolTable {
     }
   }
 
-  // Reads an text representation of the symbol table.
+  // Reads a text representation of the symbol table.
   static SymbolTable *ReadText(const string &filename,
       const SymbolTableTextOptions &opts = SymbolTableTextOptions()) {
     std::ifstream strm(filename.c_str(), std::ios_base::in);
index e2ad06f..7e14c3a 100644 (file)
@@ -8,6 +8,8 @@
 
 #include <unordered_set>
 
+#include <fst/log.h>
+
 #include <fst/connect.h>
 #include <fst/dfs-visit.h>
 
index 5837c9b..c12fc68 100644 (file)
@@ -11,6 +11,8 @@
 #include <string>
 #include <vector>
 
+#include <fst/log.h>
+
 #include <fst/weight.h>
 
 
index 5a870d1..d8af009 100644 (file)
@@ -7,6 +7,7 @@
 #define FST_LIB_UTIL_H_
 
 #include <iostream>
+#include <iterator>
 #include <list>
 #include <map>
 #include <set>
@@ -20,6 +21,7 @@
 
 #include <fst/compat.h>
 #include <fst/types.h>
+#include <fst/log.h>
 #include <fstream>
 
 
@@ -64,22 +66,18 @@ inline std::istream &ReadType(std::istream &strm, string *s) {  // NOLINT
 }
 
 // Declares types that can be read from an input stream.
-
-#define DECL_READ_TYPE2(C)          \
-  template <typename S, typename T> \
-  inline std::istream &ReadType(std::istream &strm, C<S, T> *c)  // NOLINT
-
-#define DECL_READ_TYPE3(C)                      \
-  template <typename S, typename T, typename U> \
-  inline std::istream &ReadType(std::istream &strm, C<S, T, U> *c)
-
-DECL_READ_TYPE2(std::vector);
-DECL_READ_TYPE2(std::list);
-
-DECL_READ_TYPE3(std::set);
-DECL_READ_TYPE3(std::unordered_set);
-DECL_READ_TYPE3(std::map);
-DECL_READ_TYPE3(std::unordered_map);
+template <class... T>
+std::istream &ReadType(std::istream &strm, std::vector<T...> *c);
+template <class... T>
+std::istream &ReadType(std::istream &strm, std::list<T...> *c);
+template <class... T>
+std::istream &ReadType(std::istream &strm, std::set<T...> *c);
+template <class... T>
+std::istream &ReadType(std::istream &strm, std::map<T...> *c);
+template <class... T>
+std::istream &ReadType(std::istream &strm, std::unordered_map<T...> *c);
+template <class... T>
+std::istream &ReadType(std::istream &strm, std::unordered_set<T...> *c);
 
 // Pair case.
 template <typename S, typename T>
@@ -96,54 +94,55 @@ inline std::istream &ReadType(std::istream &strm, std::pair<const S, T> *p) {
   return strm;
 }
 
-// General case - no-op.
-template <typename C>
-void StlReserve(C *c, int64 n) {}
+namespace internal {
+template <class C, class ReserveFn>
+std::istream &ReadContainerType(std::istream &strm, C *c, ReserveFn reserve) {
+  c->clear();
+  int64 n = 0;
+  ReadType(strm, &n);
+  reserve(c, n);
+  auto insert = std::inserter(*c, c->begin());
+  for (int64 i = 0; i < n; ++i) {
+    typename C::value_type value;
+    ReadType(strm, &value);
+    *insert = value;
+  }
+  return strm;
+}
+}  // namespace internal
 
-// Specialization for vectors.
-template <typename S, typename T>
-void StlReserve(std::vector<S, T> *c, int64 n) {
-  c->reserve(n);
+template <class... T>
+std::istream &ReadType(std::istream &strm, std::vector<T...> *c) {
+  return internal::ReadContainerType(
+      strm, c, [](decltype(c) v, int n) { v->reserve(n); });
 }
 
-// STL sequence container.
-#define READ_STL_SEQ_TYPE(C)                                      \
-  template <typename S, typename T>                               \
-  inline std::istream &ReadType(std::istream &strm, C<S, T> *c) { \
-    c->clear();                                                   \
-    int64 n = 0;                                                  \
-    strm.read(reinterpret_cast<char *>(&n), sizeof(n));           \
-    StlReserve(c, n);                                             \
-    for (ssize_t i = 0; i < n; ++i) {                             \
-      typename C<S, T>::value_type value;                         \
-      ReadType(strm, &value);                                     \
-      c->insert(c->end(), value);                                 \
-    }                                                             \
-    return strm;                                                  \
-  }
+template <class... T>
+std::istream &ReadType(std::istream &strm, std::list<T...> *c) {
+  return internal::ReadContainerType(strm, c, [](decltype(c) v, int n) {});
+}
 
-READ_STL_SEQ_TYPE(vector);
-READ_STL_SEQ_TYPE(std::list);
-
-// STL associative container.
-#define READ_STL_ASSOC_TYPE(C)                                       \
-  template <typename S, typename T, typename U>                      \
-  inline std::istream &ReadType(std::istream &strm, C<S, T, U> *c) { \
-    c->clear();                                                      \
-    int64 n = 0;                                                     \
-    strm.read(reinterpret_cast<char *>(&n), sizeof(n));              \
-    for (ssize_t i = 0; i < n; ++i) {                                \
-      typename C<S, T, U>::value_type value;                         \
-      ReadType(strm, &value);                                        \
-      c->insert(value);                                              \
-    }                                                                \
-    return strm;                                                     \
-  }
+template <class... T>
+std::istream &ReadType(std::istream &strm, std::set<T...> *c) {
+  return internal::ReadContainerType(strm, c, [](decltype(c) v, int n) {});
+}
+
+template <class... T>
+std::istream &ReadType(std::istream &strm, std::map<T...> *c) {
+  return internal::ReadContainerType(strm, c, [](decltype(c) v, int n) {});
+}
+
+template <class... T>
+std::istream &ReadType(std::istream &strm, std::unordered_set<T...> *c) {
+  return internal::ReadContainerType(
+      strm, c, [](decltype(c) v, int n) { v->reserve(n); });
+}
 
-READ_STL_ASSOC_TYPE(std::set);
-READ_STL_ASSOC_TYPE(std::unordered_set);
-READ_STL_ASSOC_TYPE(std::map);
-READ_STL_ASSOC_TYPE(std::unordered_map);
+template <class... T>
+std::istream &ReadType(std::istream &strm, std::unordered_map<T...> *c) {
+  return internal::ReadContainerType(
+      strm, c, [](decltype(c) v, int n) { v->reserve(n); });
+}
 
 // Writes types to an output stream.
 
@@ -171,22 +170,18 @@ inline std::ostream &WriteType(std::ostream &strm, const string &s) {  // NOLINT
 
 // Declares types that can be written to an output stream.
 
-#define DECL_WRITE_TYPE2(C)         \
-  template <typename S, typename T> \
-  inline std::ostream &WriteType(std::ostream &strm, const C<S, T> &c)
-
-#define DECL_WRITE_TYPE3(C)                          \
-  template <typename S, typename T, typename U>      \
-  inline std::ostream &WriteType(std::ostream &strm, \
-                                 const C<S, T, U> &c)  // NOLINT
-
-DECL_WRITE_TYPE2(std::vector);
-DECL_WRITE_TYPE2(std::list);
-
-DECL_WRITE_TYPE3(std::set);
-DECL_WRITE_TYPE3(std::unordered_set);
-DECL_WRITE_TYPE3(std::map);
-DECL_WRITE_TYPE3(std::unordered_map);
+template <typename... T>
+std::ostream &WriteType(std::ostream &strm, const std::vector<T...> &c);
+template <typename... T>
+std::ostream &WriteType(std::ostream &strm, const std::list<T...> &c);
+template <typename... T>
+std::ostream &WriteType(std::ostream &strm, const std::set<T...> &c);
+template <typename... T>
+std::ostream &WriteType(std::ostream &strm, const std::map<T...> &c);
+template <typename... T>
+std::ostream &WriteType(std::ostream &strm, const std::unordered_map<T...> &c);
+template <typename... T>
+std::ostream &WriteType(std::ostream &strm, const std::unordered_set<T...> &c);
 
 // Pair case.
 template <typename S, typename T>
@@ -197,36 +192,47 @@ inline std::ostream &WriteType(std::ostream &strm,
   return strm;
 }
 
-// STL sequence container.
-#define WRITE_STL_SEQ_TYPE(C)                                                  \
-  template <typename S, typename T>                                            \
-  inline std::ostream &WriteType(std::ostream &strm, const C<S, T> &c) {       \
-    int64 n = c.size();                                                        \
-    strm.write(reinterpret_cast<char *>(&n), sizeof(n));                       \
-    for (typename C<S, T>::const_iterator it = c.begin(); it != c.end(); ++it) \
-      WriteType(strm, *it);                                                    \
-    return strm;                                                               \
+namespace internal {
+template <class C>
+std::ostream &WriteContainer(std::ostream &strm, const C &c) {
+  const int64 n = c.size();
+  WriteType(strm, n);
+  for (const auto &e : c) {
+    WriteType(strm, e);
   }
+  return strm;
+}
+}  // namespace internal
 
-WRITE_STL_SEQ_TYPE(vector);
-WRITE_STL_SEQ_TYPE(std::list);
-
-// STL associative container.
-#define WRITE_STL_ASSOC_TYPE(C)                                             \
-  template <typename S, typename T, typename U>                             \
-  inline std::ostream &WriteType(std::ostream &strm, const C<S, T, U> &c) { \
-    int64 n = c.size();                                                     \
-    strm.write(reinterpret_cast<char *>(&n), sizeof(n));                    \
-    for (typename C<S, T, U>::const_iterator it = c.begin(); it != c.end(); \
-         ++it)                                                              \
-      WriteType(strm, *it);                                                 \
-    return strm;                                                            \
-  }
+template <typename... T>
+std::ostream &WriteType(std::ostream &strm, const std::vector<T...> &c) {
+  return internal::WriteContainer(strm, c);
+}
+
+template <typename... T>
+std::ostream &WriteType(std::ostream &strm, const std::list<T...> &c) {
+  return internal::WriteContainer(strm, c);
+}
+
+template <typename... T>
+std::ostream &WriteType(std::ostream &strm, const std::set<T...> &c) {
+  return internal::WriteContainer(strm, c);
+}
+
+template <typename... T>
+std::ostream &WriteType(std::ostream &strm, const std::map<T...> &c) {
+  return internal::WriteContainer(strm, c);
+}
+
+template <typename... T>
+std::ostream &WriteType(std::ostream &strm, const std::unordered_map<T...> &c) {
+  return internal::WriteContainer(strm, c);
+}
 
-WRITE_STL_ASSOC_TYPE(std::set);
-WRITE_STL_ASSOC_TYPE(std::unordered_set);
-WRITE_STL_ASSOC_TYPE(std::map);
-WRITE_STL_ASSOC_TYPE(std::unordered_map);
+template <typename... T>
+std::ostream &WriteType(std::ostream &strm, const std::unordered_set<T...> &c) {
+  return internal::WriteContainer(strm, c);
+}
 
 // Utilities for converting between int64 or Weight and string.
 
index eaa8d54..2785c40 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <string>
 #include <vector>
+#include <fst/log.h>
 
 #include <fst/fst-decl.h>  // For optional argument declarations
 #include <fst/mutable-fst.h>
@@ -640,19 +641,19 @@ class MutableArcIterator<VectorFst<Arc, State>>
     properties_ = &fst->GetImpl()->properties_;
   }
 
-  bool Done() const override { return i_ >= state_->NumArcs(); }
+  bool Done() const final { return i_ >= state_->NumArcs(); }
 
-  const Arc &Value() const override { return state_->GetArc(i_); }
+  const Arc &Value() const final { return state_->GetArc(i_); }
 
-  void Next() override { ++i_; }
+  void Next() final { ++i_; }
 
-  size_t Position() const override { return i_; }
+  size_t Position() const final { return i_; }
 
-  void Reset() override { i_ = 0; }
+  void Reset() final { i_ = 0; }
 
-  void Seek(size_t a) override { i_ = a; }
+  void Seek(size_t a) final { i_ = a; }
 
-  void SetValue(const Arc &arc) override {
+  void SetValue(const Arc &arc) final {
     const auto &oarc = state_->GetArc(i_);
     if (oarc.ilabel != oarc.olabel) *properties_ &= ~kNotAcceptor;
     if (oarc.ilabel == 0) {
@@ -689,9 +690,9 @@ class MutableArcIterator<VectorFst<Arc, State>>
                     kNoOEpsilons | kWeighted | kUnweighted;
   }
 
-  constexpr uint32 Flags() const override { return kArcValueFlags; }
+  constexpr uint32 Flags() const final { return kArcValueFlags; }
 
-  void SetFlags(uint32, uint32) override {}
+  void SetFlags(uint32, uint32) final {}
 
  private:
   State *state_;
index a2dcfb9..373826a 100644 (file)
@@ -6,6 +6,8 @@
 #ifndef FST_LIB_VERIFY_H_
 #define FST_LIB_VERIFY_H_
 
+#include <fst/log.h>
+
 #include <fst/fst.h>
 #include <fst/test-properties.h>
 
index a32b13b..462af6b 100644 (file)
@@ -12,6 +12,7 @@
 #include <sstream>
 
 #include <fst/compat.h>
+#include <fst/log.h>
 
 #include <fst/util.h>
 
index e51439d..4d5b543 100644 (file)
@@ -7,6 +7,8 @@
 
 #include <sstream>
 
+#include <fst/log.h>
+
 // Include these for registration.
 #include <fst/compact-fst.h>
 #include <fst/const-fst.h>
index e158071..0c396ea 100644 (file)
@@ -13,6 +13,8 @@
 #include <ios>
 #include <memory>
 
+#include <fst/log.h>
+
 namespace fst {
 
 MappedFile::MappedFile(const MemoryRegion &region) : region_(region) {}
index 351183a..bee1202 100644 (file)
@@ -5,6 +5,8 @@
 
 #include <fst/symbol-table.h>
 
+#include <fst/log.h>
+
 #include <fstream>
 #include <fst/util.h>
 
index 261cc9c..8f58a92 100644 (file)
@@ -7,6 +7,7 @@
 #include <cctype>
 #include <sstream>
 #include <string>
+#include <fst/log.h>
 #include <fst/mapped-file.h>
 
 // Utility flag definitions
index b4bc09a..536c9df 100644 (file)
@@ -15,11 +15,11 @@ void DrawFst(const FstClass &fst, const SymbolTable *isyms,
              const SymbolTable *osyms, const SymbolTable *ssyms, bool accep,
              const string &title, float width, float height, bool portrait,
              bool vertical, float ranksep, float nodesep, int fontsize,
-             int precision, bool show_weight_one, std::ostream *ostrm,
-             const string &dest) {
+             int precision, const string &float_format, bool show_weight_one,
+             std::ostream *ostrm, const string &dest) {
   FstDrawerArgs args(fst, isyms, osyms, ssyms, accep, title, width, height,
                      portrait, vertical, ranksep, nodesep, fontsize, precision,
-                     show_weight_one, ostrm, dest);
+                     float_format, show_weight_one, ostrm, dest);
   Apply<Operation<FstDrawerArgs>>("DrawFst", fst.ArcType(), &args);
 }
 
index 7920990..142f166 100644 (file)
@@ -7,6 +7,8 @@
 
 #include <istream>
 
+#include <fst/log.h>
+
 #include <fst/equal.h>
 #include <fst/fst-decl.h>
 #include <fst/reverse.h>
index 6e1a186..edae763 100644 (file)
@@ -9,12 +9,15 @@ namespace fst {
 namespace script {
 
 // 1
-void Relabel(MutableFstClass *ofst, const SymbolTable *old_isyms,
-             const SymbolTable *relabel_isyms, bool attach_new_isyms,
+void Relabel(MutableFstClass *ofst,
+             const SymbolTable *old_isyms, const SymbolTable *relabel_isyms,
+             const string &unknown_isymbol, bool attach_new_isyms,
              const SymbolTable *old_osyms, const SymbolTable *relabel_osyms,
-             bool attach_new_osyms) {
-  RelabelArgs1 args(ofst, old_isyms, relabel_isyms, attach_new_isyms, old_osyms,
-                    relabel_osyms, attach_new_osyms);
+             const string &unknown_osymbol, bool attach_new_osyms) {
+  RelabelArgs1 args(
+      ofst,
+      old_isyms, relabel_isyms, unknown_isymbol, attach_new_isyms,
+      old_osyms, relabel_osyms, unknown_osymbol, attach_new_osyms);
   Apply<Operation<RelabelArgs1>>("Relabel", ofst->ArcType(), &args);
 }
 
index ce78684..17c69d5 100644 (file)
@@ -10,6 +10,7 @@
 #include <utility>
 
 #include <fst/types.h>
+#include <fst/log.h>
 #include <fstream>
 #include <fst/util.h>
 
index 4d0f59c..0ebd2f4 100644 (file)
@@ -6,6 +6,8 @@
 #ifndef FST_TEST_ALGO_TEST_H_
 #define FST_TEST_ALGO_TEST_H_
 
+#include <fst/log.h>
+
 #include <fst/fstlib.h>
 #include "./rand-fst.h"
 
index 840e3ed..caf3c10 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <utility>
 
+#include <fst/log.h>
 #include <fst/compact-fst.h>
 #include <fst/const-fst.h>
 #include <fst/edit-fst.h>
index 51d966b..f2f34c6 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef FST_TEST_RAND_FST_H_
 #define FST_TEST_RAND_FST_H_
 
+#include <fst/log.h>
 #include <fst/mutable-fst.h>
 #include <fst/verify.h>
 
index 7c7447a..b7de665 100644 (file)
@@ -11,6 +11,7 @@
 
 #include <utility>
 
+#include <fst/log.h>
 #include <fst/weight.h>
 
 namespace fst {
index 070feea..9202956 100644 (file)
@@ -6,6 +6,7 @@
 #include <cstdlib>
 #include <ctime>
 
+#include <fst/log.h>
 #include <fst/expectation-weight.h>
 #include <fst/float-weight.h>
 #include <fst/lexicographic-weight.h>