summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac87
-rw-r--r--extractor/Makefile.am175
-rw-r--r--extractor/alignment.cc51
-rw-r--r--extractor/alignment.h29
-rw-r--r--extractor/alignment_test.cc31
-rw-r--r--extractor/binary_search_merger.cc251
-rw-r--r--extractor/binary_search_merger.h75
-rw-r--r--extractor/binary_search_merger_test.cc157
-rw-r--r--extractor/compile.cc99
-rw-r--r--extractor/data_array.cc156
-rw-r--r--extractor/data_array.h76
-rw-r--r--extractor/data_array_test.cc70
-rw-r--r--extractor/fast_intersector.cc191
-rw-r--r--extractor/fast_intersector.h65
-rw-r--r--extractor/fast_intersector_test.cc146
-rw-r--r--extractor/features/count_source_target.cc11
-rw-r--r--extractor/features/count_source_target.h13
-rw-r--r--extractor/features/count_source_target_test.cc32
-rw-r--r--extractor/features/feature.cc5
-rw-r--r--extractor/features/feature.h36
-rw-r--r--extractor/features/is_source_singleton.cc11
-rw-r--r--extractor/features/is_source_singleton.h13
-rw-r--r--extractor/features/is_source_singleton_test.cc35
-rw-r--r--extractor/features/is_source_target_singleton.cc11
-rw-r--r--extractor/features/is_source_target_singleton.h13
-rw-r--r--extractor/features/is_source_target_singleton_test.cc35
-rw-r--r--extractor/features/max_lex_source_given_target.cc31
-rw-r--r--extractor/features/max_lex_source_given_target.h24
-rw-r--r--extractor/features/max_lex_source_given_target_test.cc74
-rw-r--r--extractor/features/max_lex_target_given_source.cc31
-rw-r--r--extractor/features/max_lex_target_given_source.h24
-rw-r--r--extractor/features/max_lex_target_given_source_test.cc74
-rw-r--r--extractor/features/sample_source_count.cc11
-rw-r--r--extractor/features/sample_source_count.h13
-rw-r--r--extractor/features/sample_source_count_test.cc36
-rw-r--r--extractor/features/target_given_source_coherent.cc12
-rw-r--r--extractor/features/target_given_source_coherent.h13
-rw-r--r--extractor/features/target_given_source_coherent_test.cc35
-rw-r--r--extractor/grammar.cc39
-rw-r--r--extractor/grammar.h27
-rw-r--r--extractor/grammar_extractor.cc58
-rw-r--r--extractor/grammar_extractor.h51
-rw-r--r--extractor/grammar_extractor_test.cc49
-rw-r--r--extractor/intersector.cc154
-rw-r--r--extractor/intersector.h79
-rw-r--r--extractor/intersector_test.cc193
-rw-r--r--extractor/linear_merger.cc65
-rw-r--r--extractor/linear_merger.h38
-rw-r--r--extractor/linear_merger_test.cc149
-rw-r--r--extractor/matching.cc12
-rw-r--r--extractor/matching.h18
-rw-r--r--extractor/matching_comparator.cc46
-rw-r--r--extractor/matching_comparator.h23
-rw-r--r--extractor/matching_comparator_test.cc139
-rw-r--r--extractor/matching_test.cc25
-rw-r--r--extractor/matchings_finder.cc21
-rw-r--r--extractor/matchings_finder.h28
-rw-r--r--extractor/matchings_finder_test.cc42
-rw-r--r--extractor/matchings_trie.cc19
-rw-r--r--extractor/matchings_trie.h47
-rw-r--r--extractor/mocks/mock_alignment.h10
-rw-r--r--extractor/mocks/mock_binary_search_merger.h15
-rw-r--r--extractor/mocks/mock_data_array.h19
-rw-r--r--extractor/mocks/mock_fast_intersector.h11
-rw-r--r--extractor/mocks/mock_feature.h9
-rw-r--r--extractor/mocks/mock_intersector.h11
-rw-r--r--extractor/mocks/mock_linear_merger.h15
-rw-r--r--extractor/mocks/mock_matchings_finder.h9
-rw-r--r--extractor/mocks/mock_precomputation.h9
-rw-r--r--extractor/mocks/mock_rule_extractor.h12
-rw-r--r--extractor/mocks/mock_rule_extractor_helper.h78
-rw-r--r--extractor/mocks/mock_rule_factory.h9
-rw-r--r--extractor/mocks/mock_sampler.h9
-rw-r--r--extractor/mocks/mock_scorer.h10
-rw-r--r--extractor/mocks/mock_suffix_array.h19
-rw-r--r--extractor/mocks/mock_target_phrase_extractor.h12
-rw-r--r--extractor/mocks/mock_translation_table.h9
-rw-r--r--extractor/mocks/mock_vocabulary.h9
-rw-r--r--extractor/phrase.cc54
-rw-r--r--extractor/phrase.h41
-rw-r--r--extractor/phrase_builder.cc44
-rw-r--r--extractor/phrase_builder.h24
-rw-r--r--extractor/phrase_location.cc39
-rw-r--r--extractor/phrase_location.h25
-rw-r--r--extractor/phrase_test.cc61
-rw-r--r--extractor/precomputation.cc192
-rw-r--r--extractor/precomputation.h56
-rw-r--r--extractor/precomputation_test.cc138
-rw-r--r--extractor/rule.cc10
-rw-r--r--extractor/rule.h20
-rw-r--r--extractor/rule_extractor.cc315
-rw-r--r--extractor/rule_extractor.h104
-rw-r--r--extractor/rule_extractor_helper.cc356
-rw-r--r--extractor/rule_extractor_helper.h82
-rw-r--r--extractor/rule_extractor_helper_test.cc622
-rw-r--r--extractor/rule_extractor_test.cc166
-rw-r--r--extractor/rule_factory.cc305
-rw-r--r--extractor/rule_factory.h102
-rw-r--r--extractor/rule_factory_test.cc146
-rw-r--r--extractor/run_extractor.cc208
-rw-r--r--extractor/sample_alignment.txt2
-rw-r--r--extractor/sample_bitext.txt2
-rw-r--r--extractor/sampler.cc41
-rw-r--r--extractor/sampler.h29
-rw-r--r--extractor/sampler_test.cc72
-rw-r--r--extractor/scorer.cc26
-rw-r--r--extractor/scorer.h30
-rw-r--r--extractor/scorer_test.cc47
-rw-r--r--extractor/suffix_array.cc229
-rw-r--r--extractor/suffix_array.h54
-rw-r--r--extractor/suffix_array_test.cc76
-rw-r--r--extractor/target_phrase_extractor.cc144
-rw-r--r--extractor/target_phrase_extractor.h56
-rw-r--r--extractor/target_phrase_extractor_test.cc116
-rw-r--r--extractor/time_util.cc6
-rw-r--r--extractor/time_util.h14
-rw-r--r--extractor/translation_table.cc117
-rw-r--r--extractor/translation_table.h53
-rw-r--r--extractor/translation_table_test.cc82
-rw-r--r--extractor/veb.cc25
-rw-r--r--extractor/veb.h29
-rw-r--r--extractor/veb_bitset.cc25
-rw-r--r--extractor/veb_bitset.h22
-rw-r--r--extractor/veb_test.cc56
-rw-r--r--extractor/veb_tree.cc71
-rw-r--r--extractor/veb_tree.h29
-rw-r--r--extractor/vocabulary.cc26
-rw-r--r--extractor/vocabulary.h27
-rw-r--r--m4/misc.m4110
-rw-r--r--python/pkg/cdec/sa/compile.py21
-rw-r--r--python/pkg/cdec/sa/extract.py9
-rw-r--r--python/src/_cdec.cpp1360
-rw-r--r--python/src/sa/_sa.c16532
-rw-r--r--python/src/sa/_sa.pyx2
-rw-r--r--python/src/sa/rulefactory.pxi13
135 files changed, 17671 insertions, 8841 deletions
diff --git a/configure.ac b/configure.ac
index 402ddd0a..ba1a83ea 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12,6 +12,7 @@ AC_PROG_CC
AC_PROG_CXX
AC_LANG_CPLUSPLUS
BOOST_REQUIRE([1.44])
+BOOST_FILESYSTEM
BOOST_PROGRAM_OPTIONS
BOOST_SYSTEM
BOOST_SERIALIZATION
@@ -87,11 +88,92 @@ then
AM_CONDITIONAL([HAVE_CMPH], true)
fi
+AM_CONDITIONAL([HAVE_GTEST], false)
+AC_ARG_WITH(gtest,
+ [AC_HELP_STRING([--with-gtest=DIR], [(optional) path to Google Test library])],
+ [with_gtest=$withval],
+ [with_gtest=no]
+ )
+
+if test "x$with_gtest" != 'xno'
+then
+ gtest_CPPFLAGS="-I${with_gtest}/include"
+ gtest_LDFLAGS="-L${with_gtest} -L${with_gtest}/lib"
+ gtest_LIBS="-lgtest_main -lgtest -lpthread"
+
+ SAVECPP_FLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $gtest_CPPFLAGS"
+ AC_CHECK_HEADER(${with_gtest}/include/gtest/gtest.h,
+ [AC_DEFINE([HAVE_GTEST], [1], [flag for Google Test header])],
+ [AC_MSG_ERROR([Cannot find Google Test headers!])]
+ )
+
+ SAVE_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $gtest_LDFLAGS"
+ SAVE_LIBS="$LIBS"
+ # Google Test needs pthreads.
+ AC_CHECK_LIB([pthread],
+ [pthread_mutex_init],
+ [],
+ [AC_MSG_ERROR([Cannot find pthread library])]
+ )
+ AX_CXX_CHECK_LIB([gtest],
+ [testing::TestInfo::name() const],
+ [],
+ [AC_MSG_ERROR([Cannot find Google Test library libgtest])]
+ )
+ AC_CHECK_LIB([gtest_main],
+ [main],
+ [],
+ [AC_MSG_ERROR([Cannot find Google Test library libgtest_main])]
+ )
+
+ AC_SUBST(AS_TR_CPP([GTEST_CPPFLAGS]), ["$gtest_CPPFLAGS"])
+ AC_SUBST(AS_TR_CPP([GTEST_LDFLAGS]), ["$gtest_LDFLAGS"])
+ AC_SUBST(AS_TR_CPP([GTEST_LIBS]), ["$gtest_LIBS"])
+
+ AM_CONDITIONAL([HAVE_GMOCK], false)
+ AC_ARG_WITH(gmock,
+ [AC_HELP_STRING([--with-gmock=DIR], [(optional) path to Google Mock library])],
+ [with_gmock=$withval],
+ [with_gmock=no]
+ )
+
+ if test "x$with_gmock" != 'xno'
+ then
+ gmock_CPPFLAGS="-I${with_gmock}/include"
+ gmock_LDFLAGS="-L${with_gmock} -L${with_gmock}/lib"
+ gmock_LIBS="-lgmock"
+
+ CPPFLAGS="$CPPFLAGS $gmock_CPPFLAGS"
+ AC_CHECK_HEADER(${with_gmock}/include/gmock/gmock.h,
+ [AC_DEFINE([HAVE_GMOCK], [1], [flag for Google Mock header])],
+ [AC_MSG_ERROR([Cannot find Google Mock headers!])]
+ )
+
+ LDFLAGS="$LDFLAGS $gmock_LDFLAGS"
+ AX_CXX_CHECK_LIB([gmock],
+ [testing::Expectation],
+ [],
+ [AC_MSG_ERROR([Cannot find Google Mock library libgmock])]
+ )
+
+ AC_SUBST(AS_TR_CPP([GMOCK_CPPFLAGS]), ["$gmock_CPPFLAGS"])
+ AC_SUBST(AS_TR_CPP([GMOCK_LDFLAGS]), ["$gmock_LDFLAGS"])
+ AC_SUBST(AS_TR_CPP([GMOCK_LIBS]), ["$gmock_LIBS"])
+ fi
+
+ CPPFLAGS="$SAVE_CPPFLAGS"
+ LDFLAGS="$SAVE_LDFLAGS"
+ LIBS="$SAVE_LIBS"
+ AM_CONDITIONAL([HAVE_GTEST], true)
+fi
+
#BOOST_THREADS
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
-LDFLAGS="$LDFLAGS $BOOST_PROGRAM_OPTIONS_LDFLAGS $BOOST_SERIALIZATION_LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+LDFLAGS="$LDFLAGS $BOOST_PROGRAM_OPTIONS_LDFLAGS $BOOST_SERIALIZATION_LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS"
# $BOOST_THREAD_LDFLAGS"
-LIBS="$LIBS $BOOST_PROGRAM_OPTIONS_LIBS $BOOST_SERIALIZATION_LIBS $BOOST_SYSTEM_LIBS $ZLIBS"
+LIBS="$LIBS $BOOST_PROGRAM_OPTIONS_LIBS $BOOST_SERIALIZATION_LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $ZLIBS"
# $BOOST_THREAD_LIBS"
AC_CHECK_HEADER(google/dense_hash_map,
@@ -108,6 +190,7 @@ AC_CONFIG_FILES([mteval/Makefile])
AC_CONFIG_FILES([mteval/meteor_jar.cc])
AC_CONFIG_FILES([decoder/Makefile])
AC_CONFIG_FILES([python/setup.py])
+AC_CONFIG_FILES([extractor/Makefile])
AC_CONFIG_FILES([word-aligner/Makefile])
# KenLM stuff
diff --git a/extractor/Makefile.am b/extractor/Makefile.am
new file mode 100644
index 00000000..8f76dea5
--- /dev/null
+++ b/extractor/Makefile.am
@@ -0,0 +1,175 @@
+bin_PROGRAMS = compile run_extractor
+
+noinst_PROGRAMS = \
+ alignment_test \
+ binary_search_merger_test \
+ data_array_test \
+ fast_intersector_test \
+ feature_count_source_target_test \
+ feature_is_source_singleton_test \
+ feature_is_source_target_singleton_test \
+ feature_max_lex_source_given_target_test \
+ feature_max_lex_target_given_source_test \
+ feature_sample_source_count_test \
+ feature_target_given_source_coherent_test \
+ grammar_extractor_test \
+ intersector_test \
+ linear_merger_test \
+ matching_comparator_test \
+ matching_test \
+ matchings_finder_test \
+ phrase_test \
+ precomputation_test \
+ rule_extractor_helper_test \
+ rule_extractor_test \
+ rule_factory_test \
+ sampler_test \
+ scorer_test \
+ suffix_array_test \
+ target_phrase_extractor_test \
+ translation_table_test \
+ veb_test
+
+TESTS = alignment_test \
+ binary_search_merger_test \
+ data_array_test \
+ fast_intersector_test \
+ feature_count_source_target_test \
+ feature_is_source_singleton_test \
+ feature_is_source_target_singleton_test \
+ feature_max_lex_source_given_target_test \
+ feature_max_lex_target_given_source_test \
+ feature_sample_source_count_test \
+ feature_target_given_source_coherent_test \
+ grammar_extractor_test \
+ intersector_test \
+ linear_merger_test \
+ matching_comparator_test \
+ matching_test \
+ matchings_finder_test \
+ phrase_test \
+ precomputation_test \
+ rule_extractor_helper_test \
+ rule_extractor_test \
+ rule_factory_test \
+ sampler_test \
+ scorer_test \
+ suffix_array_test \
+ target_phrase_extractor_test \
+ translation_table_test \
+ veb_test
+
+alignment_test_SOURCES = alignment_test.cc
+alignment_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) libextractor.a
+binary_search_merger_test_SOURCES = binary_search_merger_test.cc
+binary_search_merger_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) $(GMOCK_LDFLAGS) $(GMOCK_LIBS) libextractor.a
+data_array_test_SOURCES = data_array_test.cc
+data_array_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) libextractor.a
+fast_intersector_test_SOURCES = fast_intersector_test.cc
+fast_intersector_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) $(GMOCK_LDFLAGS) $(GMOCK_LIBS) libextractor.a
+feature_count_source_target_test_SOURCES = features/count_source_target_test.cc
+feature_count_source_target_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) libextractor.a
+feature_is_source_singleton_test_SOURCES = features/is_source_singleton_test.cc
+feature_is_source_singleton_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) libextractor.a
+feature_is_source_target_singleton_test_SOURCES = features/is_source_target_singleton_test.cc
+feature_is_source_target_singleton_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) libextractor.a
+feature_max_lex_source_given_target_test_SOURCES = features/max_lex_source_given_target_test.cc
+feature_max_lex_source_given_target_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) $(GMOCK_LDFLAGS) $(GMOCK_LIBS) libextractor.a
+feature_max_lex_target_given_source_test_SOURCES = features/max_lex_target_given_source_test.cc
+feature_max_lex_target_given_source_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) $(GMOCK_LDFLAGS) $(GMOCK_LIBS) libextractor.a
+feature_sample_source_count_test_SOURCES = features/sample_source_count_test.cc
+feature_sample_source_count_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) libextractor.a
+feature_target_given_source_coherent_test_SOURCES = features/target_given_source_coherent_test.cc
+feature_target_given_source_coherent_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) libextractor.a
+grammar_extractor_test_SOURCES = grammar_extractor_test.cc
+grammar_extractor_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) $(GMOCK_LDFLAGS) $(GMOCK_LIBS) libextractor.a
+intersector_test_SOURCES = intersector_test.cc
+intersector_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) $(GMOCK_LDFLAGS) $(GMOCK_LIBS) libextractor.a
+linear_merger_test_SOURCES = linear_merger_test.cc
+linear_merger_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) $(GMOCK_LDFLAGS) $(GMOCK_LIBS) libextractor.a
+matching_comparator_test_SOURCES = matching_comparator_test.cc
+matching_comparator_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) libextractor.a
+matching_test_SOURCES = matching_test.cc
+matching_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) libextractor.a
+matchings_finder_test_SOURCES = matchings_finder_test.cc
+matchings_finder_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) $(GMOCK_LDFLAGS) $(GMOCK_LIBS) libextractor.a
+phrase_test_SOURCES = phrase_test.cc
+phrase_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) $(GMOCK_LDFLAGS) $(GMOCK_LIBS) libextractor.a
+precomputation_test_SOURCES = precomputation_test.cc
+precomputation_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) $(GMOCK_LDFLAGS) $(GMOCK_LIBS) libextractor.a
+rule_extractor_helper_test_SOURCES = rule_extractor_helper_test.cc
+rule_extractor_helper_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) $(GMOCK_LDFLAGS) $(GMOCK_LIBS) libextractor.a
+rule_extractor_test_SOURCES = rule_extractor_test.cc
+rule_extractor_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) $(GMOCK_LDFLAGS) $(GMOCK_LIBS) libextractor.a
+rule_factory_test_SOURCES = rule_factory_test.cc
+rule_factory_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) $(GMOCK_LDFLAGS) $(GMOCK_LIBS) libextractor.a
+sampler_test_SOURCES = sampler_test.cc
+sampler_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) $(GMOCK_LDFLAGS) $(GMOCK_LIBS) libextractor.a
+scorer_test_SOURCES = scorer_test.cc
+scorer_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) $(GMOCK_LDFLAGS) $(GMOCK_LIBS) libextractor.a
+suffix_array_test_SOURCES = suffix_array_test.cc
+suffix_array_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) $(GMOCK_LDFLAGS) $(GMOCK_LIBS) libextractor.a
+target_phrase_extractor_test_SOURCES = target_phrase_extractor_test.cc
+target_phrase_extractor_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) $(GMOCK_LDFLAGS) $(GMOCK_LIBS) libextractor.a
+translation_table_test_SOURCES = translation_table_test.cc
+translation_table_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) $(GMOCK_LDFLAGS) $(GMOCK_LIBS) libextractor.a
+veb_test_SOURCES = veb_test.cc
+veb_test_LDADD = $(GTEST_LDFLAGS) $(GTEST_LIBS) libextractor.a
+
+noinst_LIBRARIES = libextractor.a libcompile.a
+
+compile_SOURCES = compile.cc
+compile_LDADD = libcompile.a
+run_extractor_SOURCES = run_extractor.cc
+run_extractor_LDADD = libextractor.a
+
+libcompile_a_SOURCES = \
+ alignment.cc \
+ data_array.cc \
+ phrase_location.cc \
+ precomputation.cc \
+ suffix_array.cc \
+ time_util.cc \
+ translation_table.cc
+
+libextractor_a_SOURCES = \
+ alignment.cc \
+ binary_search_merger.cc \
+ data_array.cc \
+ fast_intersector.cc \
+ features/count_source_target.cc \
+ features/feature.cc \
+ features/is_source_singleton.cc \
+ features/is_source_target_singleton.cc \
+ features/max_lex_source_given_target.cc \
+ features/max_lex_target_given_source.cc \
+ features/sample_source_count.cc \
+ features/target_given_source_coherent.cc \
+ grammar.cc \
+ grammar_extractor.cc \
+ matching.cc \
+ matching_comparator.cc \
+ matchings_finder.cc \
+ intersector.cc \
+ linear_merger.cc \
+ matchings_trie.cc \
+ phrase.cc \
+ phrase_builder.cc \
+ phrase_location.cc \
+ precomputation.cc \
+ rule.cc \
+ rule_extractor.cc \
+ rule_extractor_helper.cc \
+ rule_factory.cc \
+ sampler.cc \
+ scorer.cc \
+ suffix_array.cc \
+ target_phrase_extractor.cc \
+ time_util.cc \
+ translation_table.cc \
+ veb.cc \
+ veb_bitset.cc \
+ veb_tree.cc \
+ vocabulary.cc
+
+AM_CPPFLAGS = -W -Wall -Wno-sign-compare -std=c++0x $(GTEST_CPPFLAGS) $(GMOCK_CPPFLAGS)
diff --git a/extractor/alignment.cc b/extractor/alignment.cc
new file mode 100644
index 00000000..ff39d484
--- /dev/null
+++ b/extractor/alignment.cc
@@ -0,0 +1,51 @@
+#include "alignment.h"
+
+#include <fstream>
+#include <sstream>
+#include <string>
+#include <fcntl.h>
+#include <unistd.h>
+#include <vector>
+
+#include <boost/algorithm/string.hpp>
+#include <boost/filesystem.hpp>
+
+namespace fs = boost::filesystem;
+using namespace std;
+
+Alignment::Alignment(const string& filename) {
+ ifstream infile(filename.c_str());
+ string line;
+ while (getline(infile, line)) {
+ vector<string> items;
+ boost::split(items, line, boost::is_any_of(" -"));
+ vector<pair<int, int> > alignment;
+ alignment.reserve(items.size() / 2);
+ for (size_t i = 0; i < items.size(); i += 2) {
+ alignment.push_back(make_pair(stoi(items[i]), stoi(items[i + 1])));
+ }
+ alignments.push_back(alignment);
+ }
+ // Note: shrink_to_fit does nothing for vector<vector<string> > on g++ 4.6.3,
+ // but let's hope that the bug will be fixed in a newer version.
+ alignments.shrink_to_fit();
+}
+
+Alignment::Alignment() {}
+
+Alignment::~Alignment() {}
+
+vector<pair<int, int> > Alignment::GetLinks(int sentence_index) const {
+ return alignments[sentence_index];
+}
+
+void Alignment::WriteBinary(const fs::path& filepath) {
+ FILE* file = fopen(filepath.string().c_str(), "w");
+ int size = alignments.size();
+ fwrite(&size, sizeof(int), 1, file);
+ for (vector<pair<int, int> > alignment: alignments) {
+ size = alignment.size();
+ fwrite(&size, sizeof(int), 1, file);
+ fwrite(alignment.data(), sizeof(pair<int, int>), size, file);
+ }
+}
diff --git a/extractor/alignment.h b/extractor/alignment.h
new file mode 100644
index 00000000..f7e79585
--- /dev/null
+++ b/extractor/alignment.h
@@ -0,0 +1,29 @@
+#ifndef _ALIGNMENT_H_
+#define _ALIGNMENT_H_
+
+#include <string>
+#include <vector>
+
+#include <boost/filesystem.hpp>
+
+namespace fs = boost::filesystem;
+using namespace std;
+
+class Alignment {
+ public:
+ Alignment(const string& filename);
+
+ virtual vector<pair<int, int> > GetLinks(int sentence_index) const;
+
+ void WriteBinary(const fs::path& filepath);
+
+ virtual ~Alignment();
+
+ protected:
+ Alignment();
+
+ private:
+ vector<vector<pair<int, int> > > alignments;
+};
+
+#endif
diff --git a/extractor/alignment_test.cc b/extractor/alignment_test.cc
new file mode 100644
index 00000000..1bc51a56
--- /dev/null
+++ b/extractor/alignment_test.cc
@@ -0,0 +1,31 @@
+#include <gtest/gtest.h>
+
+#include <memory>
+#include <string>
+
+#include "alignment.h"
+
+using namespace std;
+using namespace ::testing;
+
+namespace {
+
+class AlignmentTest : public Test {
+ protected:
+ virtual void SetUp() {
+ alignment = make_shared<Alignment>("sample_alignment.txt");
+ }
+
+ shared_ptr<Alignment> alignment;
+};
+
+TEST_F(AlignmentTest, TestGetLinks) {
+ vector<pair<int, int> > expected_links = {
+ make_pair(0, 0), make_pair(1, 1), make_pair(2, 2)
+ };
+ EXPECT_EQ(expected_links, alignment->GetLinks(0));
+ expected_links = {make_pair(1, 0), make_pair(2, 1)};
+ EXPECT_EQ(expected_links, alignment->GetLinks(1));
+}
+
+} // namespace
diff --git a/extractor/binary_search_merger.cc b/extractor/binary_search_merger.cc
new file mode 100644
index 00000000..c1b86a77
--- /dev/null
+++ b/extractor/binary_search_merger.cc
@@ -0,0 +1,251 @@
+#include "binary_search_merger.h"
+
+#include "data_array.h"
+#include "linear_merger.h"
+#include "matching.h"
+#include "matching_comparator.h"
+#include "phrase.h"
+#include "vocabulary.h"
+
+double BinarySearchMerger::BAEZA_YATES_FACTOR = 1.0;
+
+BinarySearchMerger::BinarySearchMerger(
+ shared_ptr<Vocabulary> vocabulary,
+ shared_ptr<LinearMerger> linear_merger,
+ shared_ptr<DataArray> data_array,
+ shared_ptr<MatchingComparator> comparator,
+ bool force_binary_search_merge) :
+ vocabulary(vocabulary), linear_merger(linear_merger),
+ data_array(data_array), comparator(comparator),
+ force_binary_search_merge(force_binary_search_merge) {}
+
+BinarySearchMerger::BinarySearchMerger() {}
+
+BinarySearchMerger::~BinarySearchMerger() {}
+
+void BinarySearchMerger::Merge(
+ vector<int>& locations, const Phrase& phrase, const Phrase& suffix,
+ const vector<int>::iterator& prefix_start,
+ const vector<int>::iterator& prefix_end,
+ const vector<int>::iterator& suffix_start,
+ const vector<int>::iterator& suffix_end,
+ int prefix_subpatterns, int suffix_subpatterns) const {
+ if (IsIntersectionVoid(prefix_start, prefix_end, suffix_start, suffix_end,
+ prefix_subpatterns, suffix_subpatterns, suffix)) {
+ return;
+ }
+
+ int prefix_set_size = prefix_end - prefix_start;
+ int suffix_set_size = suffix_end - suffix_start;
+ if (ShouldUseLinearMerge(prefix_set_size, suffix_set_size)) {
+ linear_merger->Merge(locations, phrase, suffix, prefix_start, prefix_end,
+ suffix_start, suffix_end, prefix_subpatterns, suffix_subpatterns);
+ return;
+ }
+
+ vector<int>::iterator low, high, prefix_low, prefix_high, suffix_mid;
+ if (prefix_set_size > suffix_set_size) {
+ // Binary search on the prefix set.
+ suffix_mid = GetMiddle(suffix_start, suffix_end, suffix_subpatterns);
+ low = prefix_start, high = prefix_end;
+ while (low < high) {
+ vector<int>::iterator prefix_mid =
+ GetMiddle(low, high, prefix_subpatterns);
+
+ GetComparableMatchings(prefix_start, prefix_end, prefix_mid,
+ prefix_subpatterns, prefix_low, prefix_high);
+ int comparison = CompareMatchingsSet(prefix_low, prefix_high, suffix_mid,
+ prefix_subpatterns, suffix_subpatterns, suffix);
+ if (comparison == 0) {
+ break;
+ } else if (comparison < 0) {
+ low = prefix_mid + prefix_subpatterns;
+ } else {
+ high = prefix_mid;
+ }
+ }
+ } else {
+ // Binary search on the suffix set.
+ vector<int>::iterator prefix_mid =
+ GetMiddle(prefix_start, prefix_end, prefix_subpatterns);
+
+ GetComparableMatchings(prefix_start, prefix_end, prefix_mid,
+ prefix_subpatterns, prefix_low, prefix_high);
+ low = suffix_start, high = suffix_end;
+ while (low < high) {
+ suffix_mid = GetMiddle(low, high, suffix_subpatterns);
+
+ int comparison = CompareMatchingsSet(prefix_low, prefix_high, suffix_mid,
+ prefix_subpatterns, suffix_subpatterns, suffix);
+ if (comparison == 0) {
+ break;
+ } else if (comparison > 0) {
+ low = suffix_mid + suffix_subpatterns;
+ } else {
+ high = suffix_mid;
+ }
+ }
+ }
+
+ vector<int> result;
+ int last_chunk_len = suffix.GetChunkLen(suffix.Arity());
+ bool offset = !vocabulary->IsTerminal(suffix.GetSymbol(0));
+ vector<int>::iterator suffix_low, suffix_high;
+ if (low < high) {
+ // We found a group of prefixes with the same starting position that give
+ // different results when compared to the found suffix.
+ // Find all matching suffixes for the previously found set of prefixes.
+ suffix_low = suffix_mid;
+ suffix_high = suffix_mid + suffix_subpatterns;
+ for (auto i = prefix_low; i != prefix_high; i += prefix_subpatterns) {
+ Matching left(i, prefix_subpatterns, data_array->GetSentenceId(*i));
+ while (suffix_low != suffix_start) {
+ Matching right(suffix_low - suffix_subpatterns, suffix_subpatterns,
+ data_array->GetSentenceId(*(suffix_low - suffix_subpatterns)));
+ if (comparator->Compare(left, right, last_chunk_len, offset) <= 0) {
+ suffix_low -= suffix_subpatterns;
+ } else {
+ break;
+ }
+ }
+
+ for (auto j = suffix_low; j != suffix_end; j += suffix_subpatterns) {
+ Matching right(j, suffix_subpatterns, data_array->GetSentenceId(*j));
+ int comparison = comparator->Compare(left, right, last_chunk_len,
+ offset);
+ if (comparison == 0) {
+ vector<int> merged = left.Merge(right, phrase.Arity() + 1);
+ result.insert(result.end(), merged.begin(), merged.end());
+ } else if (comparison < 0) {
+ break;
+ }
+ suffix_high = max(suffix_high, j + suffix_subpatterns);
+ }
+ }
+
+ swap(suffix_low, suffix_high);
+ } else if (prefix_set_size > suffix_set_size) {
+ // We did the binary search on the prefix set.
+ suffix_low = suffix_mid;
+ suffix_high = suffix_mid + suffix_subpatterns;
+ if (CompareMatchingsSet(prefix_low, prefix_high, suffix_mid,
+ prefix_subpatterns, suffix_subpatterns, suffix) < 0) {
+ prefix_low = prefix_high;
+ } else {
+ prefix_high = prefix_low;
+ }
+ } else {
+ // We did the binary search on the suffix set.
+ if (CompareMatchingsSet(prefix_low, prefix_high, suffix_mid,
+ prefix_subpatterns, suffix_subpatterns, suffix) < 0) {
+ suffix_low = suffix_mid;
+ suffix_high = suffix_mid;
+ } else {
+ suffix_low = suffix_mid + suffix_subpatterns;
+ suffix_high = suffix_mid + suffix_subpatterns;
+ }
+ }
+
+ Merge(locations, phrase, suffix, prefix_start, prefix_low, suffix_start,
+ suffix_low, prefix_subpatterns, suffix_subpatterns);
+ locations.insert(locations.end(), result.begin(), result.end());
+ Merge(locations, phrase, suffix, prefix_high, prefix_end, suffix_high,
+ suffix_end, prefix_subpatterns, suffix_subpatterns);
+}
+
+bool BinarySearchMerger::IsIntersectionVoid(
+ vector<int>::iterator prefix_start, vector<int>::iterator prefix_end,
+ vector<int>::iterator suffix_start, vector<int>::iterator suffix_end,
+ int prefix_subpatterns, int suffix_subpatterns,
+ const Phrase& suffix) const {
+ // Is any of the sets empty?
+ if (prefix_start >= prefix_end || suffix_start >= suffix_end) {
+ return true;
+ }
+
+ int last_chunk_len = suffix.GetChunkLen(suffix.Arity());
+ bool offset = !vocabulary->IsTerminal(suffix.GetSymbol(0));
+ // Is the first value from the first set larger than the last value in the
+ // second set?
+ Matching left(prefix_start, prefix_subpatterns,
+ data_array->GetSentenceId(*prefix_start));
+ Matching right(suffix_end - suffix_subpatterns, suffix_subpatterns,
+ data_array->GetSentenceId(*(suffix_end - suffix_subpatterns)));
+ if (comparator->Compare(left, right, last_chunk_len, offset) > 0) {
+ return true;
+ }
+
+ // Is the last value from the first set smaller than the first value in the
+ // second set?
+ left = Matching(prefix_end - prefix_subpatterns, prefix_subpatterns,
+ data_array->GetSentenceId(*(prefix_end - prefix_subpatterns)));
+ right = Matching(suffix_start, suffix_subpatterns,
+ data_array->GetSentenceId(*suffix_start));
+ if (comparator->Compare(left, right, last_chunk_len, offset) < 0) {
+ return true;
+ }
+
+ return false;
+}
+
+bool BinarySearchMerger::ShouldUseLinearMerge(
+ int prefix_set_size, int suffix_set_size) const {
+ if (force_binary_search_merge) {
+ return false;
+ }
+
+ int min_size = min(prefix_set_size, suffix_set_size);
+ int max_size = max(prefix_set_size, suffix_set_size);
+
+ return BAEZA_YATES_FACTOR * min_size * log2(max_size) > max_size;
+}
+
+vector<int>::iterator BinarySearchMerger::GetMiddle(
+ vector<int>::iterator low, vector<int>::iterator high,
+ int num_subpatterns) const {
+ return low + (((high - low) / num_subpatterns) / 2) * num_subpatterns;
+}
+
+void BinarySearchMerger::GetComparableMatchings(
+ const vector<int>::iterator& prefix_start,
+ const vector<int>::iterator& prefix_end,
+ const vector<int>::iterator& prefix_mid,
+ int num_subpatterns,
+ vector<int>::iterator& prefix_low,
+ vector<int>::iterator& prefix_high) const {
+ prefix_low = prefix_mid;
+ while (prefix_low != prefix_start
+ && *prefix_mid == *(prefix_low - num_subpatterns)) {
+ prefix_low -= num_subpatterns;
+ }
+ prefix_high = prefix_mid + num_subpatterns;
+ while (prefix_high != prefix_end
+ && *prefix_mid == *prefix_high) {
+ prefix_high += num_subpatterns;
+ }
+}
+
+int BinarySearchMerger::CompareMatchingsSet(
+ const vector<int>::iterator& prefix_start,
+ const vector<int>::iterator& prefix_end,
+ const vector<int>::iterator& suffix_mid,
+ int prefix_subpatterns,
+ int suffix_subpatterns,
+ const Phrase& suffix) const {
+ int result = 0;
+ int last_chunk_len = suffix.GetChunkLen(suffix.Arity());
+ bool offset = !vocabulary->IsTerminal(suffix.GetSymbol(0));
+
+ Matching right(suffix_mid, suffix_subpatterns,
+ data_array->GetSentenceId(*suffix_mid));
+ for (auto i = prefix_start; i != prefix_end; i += prefix_subpatterns) {
+ Matching left(i, prefix_subpatterns, data_array->GetSentenceId(*i));
+ int comparison = comparator->Compare(left, right, last_chunk_len, offset);
+ if (i == prefix_start) {
+ result = comparison;
+ } else if (comparison != result) {
+ return 0;
+ }
+ }
+ return result;
+}
diff --git a/extractor/binary_search_merger.h b/extractor/binary_search_merger.h
new file mode 100644
index 00000000..c887e012
--- /dev/null
+++ b/extractor/binary_search_merger.h
@@ -0,0 +1,75 @@
+#ifndef _BINARY_SEARCH_MERGER_H_
+#define _BINARY_SEARCH_MERGER_H_
+
+#include <memory>
+#include <vector>
+
+using namespace std;
+
+class DataArray;
+class LinearMerger;
+class MatchingComparator;
+class Phrase;
+class Vocabulary;
+
+class BinarySearchMerger {
+ public:
+ BinarySearchMerger(shared_ptr<Vocabulary> vocabulary,
+ shared_ptr<LinearMerger> linear_merger,
+ shared_ptr<DataArray> data_array,
+ shared_ptr<MatchingComparator> comparator,
+ bool force_binary_search_merge = false);
+
+ virtual ~BinarySearchMerger();
+
+ virtual void Merge(
+ vector<int>& locations, const Phrase& phrase, const Phrase& suffix,
+ const vector<int>::iterator& prefix_start,
+ const vector<int>::iterator& prefix_end,
+ const vector<int>::iterator& suffix_start,
+ const vector<int>::iterator& suffix_end,
+ int prefix_subpatterns, int suffix_subpatterns) const;
+
+ static double BAEZA_YATES_FACTOR;
+
+ protected:
+ BinarySearchMerger();
+
+ private:
+ bool IsIntersectionVoid(
+ vector<int>::iterator prefix_start, vector<int>::iterator prefix_end,
+ vector<int>::iterator suffix_start, vector<int>::iterator suffix_end,
+ int prefix_subpatterns, int suffix_subpatterns,
+ const Phrase& suffix) const;
+
+ bool ShouldUseLinearMerge(int prefix_set_size, int suffix_set_size) const;
+
+ vector<int>::iterator GetMiddle(vector<int>::iterator low,
+ vector<int>::iterator high,
+ int num_subpatterns) const;
+
+ void GetComparableMatchings(
+ const vector<int>::iterator& prefix_start,
+ const vector<int>::iterator& prefix_end,
+ const vector<int>::iterator& prefix_mid,
+ int num_subpatterns,
+ vector<int>::iterator& prefix_low,
+ vector<int>::iterator& prefix_high) const;
+
+ int CompareMatchingsSet(
+ const vector<int>::iterator& prefix_low,
+ const vector<int>::iterator& prefix_high,
+ const vector<int>::iterator& suffix_mid,
+ int prefix_subpatterns,
+ int suffix_subpatterns,
+ const Phrase& suffix) const;
+
+ shared_ptr<Vocabulary> vocabulary;
+ shared_ptr<LinearMerger> linear_merger;
+ shared_ptr<DataArray> data_array;
+ shared_ptr<MatchingComparator> comparator;
+ // Should be true only for testing.
+ bool force_binary_search_merge;
+};
+
+#endif
diff --git a/extractor/binary_search_merger_test.cc b/extractor/binary_search_merger_test.cc
new file mode 100644
index 00000000..b1baa62f
--- /dev/null
+++ b/extractor/binary_search_merger_test.cc
@@ -0,0 +1,157 @@
+#include <gtest/gtest.h>
+
+#include <memory>
+
+#include "binary_search_merger.h"
+#include "matching_comparator.h"
+#include "mocks/mock_data_array.h"
+#include "mocks/mock_vocabulary.h"
+#include "mocks/mock_linear_merger.h"
+#include "phrase.h"
+#include "phrase_location.h"
+#include "phrase_builder.h"
+
+using namespace std;
+using namespace ::testing;
+
+namespace {
+
+class BinarySearchMergerTest : public Test {
+ protected:
+ virtual void SetUp() {
+ shared_ptr<MockVocabulary> vocabulary = make_shared<MockVocabulary>();
+ EXPECT_CALL(*vocabulary, GetTerminalValue(_))
+ .WillRepeatedly(Return("word"));
+
+ shared_ptr<MockDataArray> data_array = make_shared<MockDataArray>();
+ EXPECT_CALL(*data_array, GetSentenceId(_))
+ .WillRepeatedly(Return(1));
+
+ shared_ptr<MatchingComparator> comparator =
+ make_shared<MatchingComparator>(1, 20);
+
+ phrase_builder = make_shared<PhraseBuilder>(vocabulary);
+
+ // We are going to force the binary_search_merger to do all the work, so we
+ // need to check that the linear_merger never gets called.
+ shared_ptr<MockLinearMerger> linear_merger =
+ make_shared<MockLinearMerger>();
+ EXPECT_CALL(*linear_merger, Merge(_, _, _, _, _, _, _, _, _)).Times(0);
+
+ binary_search_merger = make_shared<BinarySearchMerger>(
+ vocabulary, linear_merger, data_array, comparator, true);
+ }
+
+ shared_ptr<BinarySearchMerger> binary_search_merger;
+ shared_ptr<PhraseBuilder> phrase_builder;
+};
+
+TEST_F(BinarySearchMergerTest, aXbTest) {
+ vector<int> locations;
+ // Encoding for him X it (see Adam's dissertation).
+ vector<int> symbols{1, -1, 2};
+ Phrase phrase = phrase_builder->Build(symbols);
+ vector<int> suffix_symbols{-1, 2};
+ Phrase suffix = phrase_builder->Build(suffix_symbols);
+
+ vector<int> prefix_locs{2, 6, 10, 15};
+ vector<int> suffix_locs{0, 4, 8, 13};
+
+ binary_search_merger->Merge(locations, phrase, suffix, prefix_locs.begin(),
+ prefix_locs.end(), suffix_locs.begin(), suffix_locs.end(), 1, 1);
+
+ vector<int> expected_locations{2, 4, 2, 8, 2, 13, 6, 8, 6, 13, 10, 13};
+ EXPECT_EQ(expected_locations, locations);
+}
+
+TEST_F(BinarySearchMergerTest, aXbXcTest) {
+ vector<int> locations;
+ // Encoding for it X him X it (see Adam's dissertation).
+ vector<int> symbols{1, -1, 2, -2, 1};
+ Phrase phrase = phrase_builder->Build(symbols);
+ vector<int> suffix_symbols{-1, 2, -2, 1};
+ Phrase suffix = phrase_builder->Build(suffix_symbols);
+
+ vector<int> prefix_locs{0, 2, 0, 6, 0, 10, 4, 6, 4, 10, 4, 15, 8, 10, 8, 15,
+ 13, 15};
+ vector<int> suffix_locs{2, 4, 2, 8, 2, 13, 6, 8, 6, 13, 10, 13};
+
+ binary_search_merger->Merge(locations, phrase, suffix, prefix_locs.begin(),
+ prefix_locs.end(), suffix_locs.begin(), suffix_locs.end(), 2, 2);
+
+ vector<int> expected_locs{0, 2, 4, 0, 2, 8, 0, 2, 13, 0, 6, 8, 0, 6, 13, 0,
+ 10, 13, 4, 6, 8, 4, 6, 13, 4, 10, 13, 8, 10, 13};
+ EXPECT_EQ(expected_locs, locations);
+}
+
+TEST_F(BinarySearchMergerTest, abXcXdTest) {
+ // Sentence: Anna has many many nuts and sour apples and juicy apples.
+ // Phrase: Anna has X and X apples.
+ vector<int> locations;
+ vector<int> symbols{1, 2, -1, 3, -2, 4};
+ Phrase phrase = phrase_builder->Build(symbols);
+ vector<int> suffix_symbols{2, -1, 3, -2, 4};
+ Phrase suffix = phrase_builder->Build(suffix_symbols);
+
+ vector<int> prefix_locs{1, 6, 1, 9};
+ vector<int> suffix_locs{2, 6, 8, 2, 6, 11, 2, 9, 11};
+
+ binary_search_merger->Merge(locations, phrase, suffix, prefix_locs.begin(),
+ prefix_locs.end(), suffix_locs.begin(), suffix_locs.end(), 2, 3);
+
+ vector<int> expected_locs{1, 6, 8, 1, 6, 11, 1, 9, 11};
+ EXPECT_EQ(expected_locs, locations);
+}
+
+TEST_F(BinarySearchMergerTest, LargeTest) {
+ vector<int> locations;
+ vector<int> symbols{1, -1, 2};
+ Phrase phrase = phrase_builder->Build(symbols);
+ vector<int> suffix_symbols{-1, 2};
+ Phrase suffix = phrase_builder->Build(suffix_symbols);
+
+ vector<int> prefix_locs;
+ for (int i = 0; i < 100; ++i) {
+ prefix_locs.push_back(i * 20 + 1);
+ }
+ vector<int> suffix_locs;
+ for (int i = 0; i < 100; ++i) {
+ suffix_locs.push_back(i * 20 + 5);
+ suffix_locs.push_back(i * 20 + 13);
+ }
+
+ binary_search_merger->Merge(locations, phrase, suffix, prefix_locs.begin(),
+ prefix_locs.end(), suffix_locs.begin(), suffix_locs.end(), 1, 1);
+
+ EXPECT_EQ(400, locations.size());
+ for (int i = 0; i < 100; ++i) {
+ EXPECT_EQ(i * 20 + 1, locations[4 * i]);
+ EXPECT_EQ(i * 20 + 5, locations[4 * i + 1]);
+ EXPECT_EQ(i * 20 + 1, locations[4 * i + 2]);
+ EXPECT_EQ(i * 20 + 13, locations[4 * i + 3]);
+ }
+}
+
+TEST_F(BinarySearchMergerTest, EmptyResultTest) {
+ vector<int> locations;
+ vector<int> symbols{1, -1, 2};
+ Phrase phrase = phrase_builder->Build(symbols);
+ vector<int> suffix_symbols{-1, 2};
+ Phrase suffix = phrase_builder->Build(suffix_symbols);
+
+ vector<int> prefix_locs;
+ for (int i = 0; i < 100; ++i) {
+ prefix_locs.push_back(i * 200 + 1);
+ }
+ vector<int> suffix_locs;
+ for (int i = 0; i < 100; ++i) {
+ suffix_locs.push_back(i * 200 + 101);
+ }
+
+ binary_search_merger->Merge(locations, phrase, suffix, prefix_locs.begin(),
+ prefix_locs.end(), suffix_locs.begin(), suffix_locs.end(), 1, 1);
+
+ EXPECT_EQ(0, locations.size());
+}
+
+} // namespace
diff --git a/extractor/compile.cc b/extractor/compile.cc
new file mode 100644
index 00000000..f5cd41f4
--- /dev/null
+++ b/extractor/compile.cc
@@ -0,0 +1,99 @@
+#include <iostream>
+#include <string>
+
+#include <boost/filesystem.hpp>
+#include <boost/program_options.hpp>
+#include <boost/program_options/variables_map.hpp>
+
+#include "alignment.h"
+#include "data_array.h"
+#include "precomputation.h"
+#include "suffix_array.h"
+#include "translation_table.h"
+
+namespace fs = boost::filesystem;
+namespace po = boost::program_options;
+using namespace std;
+
+int main(int argc, char** argv) {
+ po::options_description desc("Command line options");
+ desc.add_options()
+ ("help,h", "Show available options")
+ ("source,f", po::value<string>(), "Source language corpus")
+ ("target,e", po::value<string>(), "Target language corpus")
+ ("bitext,b", po::value<string>(), "Parallel text (source ||| target)")
+ ("alignment,a", po::value<string>()->required(), "Bitext word alignment")
+ ("output,o", po::value<string>()->required(), "Output path")
+ ("frequent", po::value<int>()->default_value(100),
+ "Number of precomputed frequent patterns")
+ ("super_frequent", po::value<int>()->default_value(10),
+ "Number of precomputed super frequent patterns")
+ ("max_rule_span,s", po::value<int>()->default_value(15),
+ "Maximum rule span")
+ ("max_rule_symbols,l", po::value<int>()->default_value(5),
+ "Maximum number of symbols (terminals + nontermals) in a rule")
+ ("min_gap_size,g", po::value<int>()->default_value(1), "Minimum gap size")
+ ("max_phrase_len,p", po::value<int>()->default_value(4),
+ "Maximum frequent phrase length")
+ ("min_frequency", po::value<int>()->default_value(1000),
+ "Minimum number of occurences for a pharse to be considered frequent");
+
+ po::variables_map vm;
+ po::store(po::parse_command_line(argc, argv, desc), vm);
+
+ // Check for help argument before notify, so we don't need to pass in the
+ // required parameters.
+ if (vm.count("help")) {
+ cout << desc << endl;
+ return 0;
+ }
+
+ po::notify(vm);
+
+ if (!((vm.count("source") && vm.count("target")) || vm.count("bitext"))) {
+ cerr << "A paralel corpus is required. "
+ << "Use -f (source) with -e (target) or -b (bitext)."
+ << endl;
+ return 1;
+ }
+
+ fs::path output_dir(vm["output"].as<string>().c_str());
+ if (!fs::exists(output_dir)) {
+ fs::create_directory(output_dir);
+ }
+
+ shared_ptr<DataArray> source_data_array, target_data_array;
+ if (vm.count("bitext")) {
+ source_data_array = make_shared<DataArray>(
+ vm["bitext"].as<string>(), SOURCE);
+ target_data_array = make_shared<DataArray>(
+ vm["bitext"].as<string>(), TARGET);
+ } else {
+ source_data_array = make_shared<DataArray>(vm["source"].as<string>());
+ target_data_array = make_shared<DataArray>(vm["target"].as<string>());
+ }
+ shared_ptr<SuffixArray> source_suffix_array =
+ make_shared<SuffixArray>(source_data_array);
+ source_suffix_array->WriteBinary(output_dir / fs::path("f.bin"));
+ target_data_array->WriteBinary(output_dir / fs::path("e.bin"));
+
+ shared_ptr<Alignment> alignment =
+ make_shared<Alignment>(vm["alignment"].as<string>());
+ alignment->WriteBinary(output_dir / fs::path("a.bin"));
+
+ Precomputation precomputation(
+ source_suffix_array,
+ vm["frequent"].as<int>(),
+ vm["super_frequent"].as<int>(),
+ vm["max_rule_span"].as<int>(),
+ vm["max_rule_symbols"].as<int>(),
+ vm["min_gap_size"].as<int>(),
+ vm["max_phrase_len"].as<int>(),
+ vm["min_frequency"].as<int>());
+ precomputation.WriteBinary(output_dir / fs::path("precompute.bin"));
+
+ TranslationTable table(source_data_array, target_data_array, alignment);
+ table.WriteBinary(output_dir / fs::path("lex.bin"));
+
+ return 0;
+}
diff --git a/extractor/data_array.cc b/extractor/data_array.cc
new file mode 100644
index 00000000..cd430c69
--- /dev/null
+++ b/extractor/data_array.cc
@@ -0,0 +1,156 @@
+#include "data_array.h"
+
+#include <fstream>
+#include <iostream>
+#include <sstream>
+#include <string>
+
+#include <boost/filesystem.hpp>
+
+namespace fs = boost::filesystem;
+using namespace std;
+
+int DataArray::NULL_WORD = 0;
+int DataArray::END_OF_LINE = 1;
+string DataArray::NULL_WORD_STR = "__NULL__";
+string DataArray::END_OF_LINE_STR = "__END_OF_LINE__";
+
+DataArray::DataArray() {
+ InitializeDataArray();
+}
+
+DataArray::DataArray(const string& filename) {
+ InitializeDataArray();
+ ifstream infile(filename.c_str());
+ vector<string> lines;
+ string line;
+ while (getline(infile, line)) {
+ lines.push_back(line);
+ }
+ CreateDataArray(lines);
+}
+
+DataArray::DataArray(const string& filename, const Side& side) {
+ InitializeDataArray();
+ ifstream infile(filename.c_str());
+ vector<string> lines;
+ string line, delimiter = "|||";
+ while (getline(infile, line)) {
+ int position = line.find(delimiter);
+ if (side == SOURCE) {
+ lines.push_back(line.substr(0, position));
+ } else {
+ lines.push_back(line.substr(position + delimiter.size()));
+ }
+ }
+ CreateDataArray(lines);
+}
+
+void DataArray::InitializeDataArray() {
+ word2id[NULL_WORD_STR] = NULL_WORD;
+ id2word.push_back(NULL_WORD_STR);
+ word2id[END_OF_LINE_STR] = END_OF_LINE;
+ id2word.push_back(END_OF_LINE_STR);
+}
+
+void DataArray::CreateDataArray(const vector<string>& lines) {
+ for (size_t i = 0; i < lines.size(); ++i) {
+ sentence_start.push_back(data.size());
+
+ istringstream iss(lines[i]);
+ string word;
+ while (iss >> word) {
+ if (word2id.count(word) == 0) {
+ word2id[word] = id2word.size();
+ id2word.push_back(word);
+ }
+ data.push_back(word2id[word]);
+ sentence_id.push_back(i);
+ }
+ data.push_back(END_OF_LINE);
+ sentence_id.push_back(i);
+ }
+ sentence_start.push_back(data.size());
+
+ data.shrink_to_fit();
+ sentence_id.shrink_to_fit();
+ sentence_start.shrink_to_fit();
+}
+
+DataArray::~DataArray() {}
+
+const vector<int>& DataArray::GetData() const {
+ return data;
+}
+
+int DataArray::AtIndex(int index) const {
+ return data[index];
+}
+
+string DataArray::GetWordAtIndex(int index) const {
+ return id2word[data[index]];
+}
+
+int DataArray::GetSize() const {
+ return data.size();
+}
+
+int DataArray::GetVocabularySize() const {
+ return id2word.size();
+}
+
+int DataArray::GetNumSentences() const {
+ return sentence_start.size() - 1;
+}
+
+int DataArray::GetSentenceStart(int position) const {
+ return sentence_start[position];
+}
+
+int DataArray::GetSentenceLength(int sentence_id) const {
+ // Ignore end of line markers.
+ return sentence_start[sentence_id + 1] - sentence_start[sentence_id] - 1;
+}
+
+int DataArray::GetSentenceId(int position) const {
+ return sentence_id[position];
+}
+
+void DataArray::WriteBinary(const fs::path& filepath) const {
+ WriteBinary(fopen(filepath.string().c_str(), "w"));
+}
+
+void DataArray::WriteBinary(FILE* file) const {
+ int size = id2word.size();
+ fwrite(&size, sizeof(int), 1, file);
+ for (string word: id2word) {
+ size = word.size();
+ fwrite(&size, sizeof(int), 1, file);
+ fwrite(word.data(), sizeof(char), size, file);
+ }
+
+ size = data.size();
+ fwrite(&size, sizeof(int), 1, file);
+ fwrite(data.data(), sizeof(int), size, file);
+
+ size = sentence_id.size();
+ fwrite(&size, sizeof(int), 1, file);
+ fwrite(sentence_id.data(), sizeof(int), size, file);
+
+ size = sentence_start.size();
+ fwrite(&size, sizeof(int), 1, file);
+ fwrite(sentence_start.data(), sizeof(int), 1, file);
+}
+
+bool DataArray::HasWord(const string& word) const {
+ return word2id.count(word);
+}
+
+int DataArray::GetWordId(const string& word) const {
+ auto result = word2id.find(word);
+ return result == word2id.end() ? -1 : result->second;
+}
+
+string DataArray::GetWord(int word_id) const {
+ return id2word[word_id];
+}
diff --git a/extractor/data_array.h b/extractor/data_array.h
new file mode 100644
index 00000000..7c120b3c
--- /dev/null
+++ b/extractor/data_array.h
@@ -0,0 +1,76 @@
+#ifndef _DATA_ARRAY_H_
+#define _DATA_ARRAY_H_
+
+#include <string>
+#include <unordered_map>
+#include <vector>
+
+#include <boost/filesystem.hpp>
+
+namespace fs = boost::filesystem;
+using namespace std;
+
+enum Side {
+ SOURCE,
+ TARGET
+};
+
+class DataArray {
+ public:
+ static int NULL_WORD;
+ static int END_OF_LINE;
+ static string NULL_WORD_STR;
+ static string END_OF_LINE_STR;
+
+ DataArray(const string& filename);
+
+ DataArray(const string& filename, const Side& side);
+
+ virtual ~DataArray();
+
+ virtual const vector<int>& GetData() const;
+
+ virtual int AtIndex(int index) const;
+
+ virtual string GetWordAtIndex(int index) const;
+
+ virtual int GetSize() const;
+
+ virtual int GetVocabularySize() const;
+
+ virtual bool HasWord(const string& word) const;
+
+ virtual int GetWordId(const string& word) const;
+
+ virtual string GetWord(int word_id) const;
+
+ virtual int GetNumSentences() const;
+
+ virtual int GetSentenceStart(int position) const;
+
+ //TODO(pauldb): Add unit tests.
+ virtual int GetSentenceLength(int sentence_id) const;
+
+ virtual int GetSentenceId(int position) const;
+
+ void WriteBinary(const fs::path& filepath) const;
+
+ void WriteBinary(FILE* file) const;
+
+ protected:
+ DataArray();
+
+ private:
+ void InitializeDataArray();
+ void CreateDataArray(const vector<string>& lines);
+
+ unordered_map<string, int> word2id;
+ vector<string> id2word;
+ vector<int> data;
+ // TODO(pauldb): We only need sentence_id for the source language. Maybe we
+ // can save some memory here.
+ vector<int> sentence_id;
+ vector<int> sentence_start;
+};
+
+#endif
diff --git a/extractor/data_array_test.cc b/extractor/data_array_test.cc
new file mode 100644
index 00000000..772ba10e
--- /dev/null
+++ b/extractor/data_array_test.cc
@@ -0,0 +1,70 @@
+#include <gtest/gtest.h>
+
+#include <memory>
+#include <string>
+
+#include <boost/filesystem.hpp>
+
+#include "data_array.h"
+
+using namespace std;
+using namespace ::testing;
+namespace fs = boost::filesystem;
+
+namespace {
+
+class DataArrayTest : public Test {
+ protected:
+ virtual void SetUp() {
+ string sample_test_file("sample_bitext.txt");
+ source_data = make_shared<DataArray>(sample_test_file, SOURCE);
+ target_data = make_shared<DataArray>(sample_test_file, TARGET);
+ }
+
+ shared_ptr<DataArray> source_data;
+ shared_ptr<DataArray> target_data;
+};
+
+TEST_F(DataArrayTest, TestGetData) {
+ vector<int> expected_source_data{2, 3, 4, 5, 1, 2, 6, 7, 8, 5, 1};
+ EXPECT_EQ(expected_source_data, source_data->GetData());
+ EXPECT_EQ(expected_source_data.size(), source_data->GetSize());
+ for (size_t i = 0; i < expected_source_data.size(); ++i) {
+ EXPECT_EQ(expected_source_data[i], source_data->AtIndex(i));
+ }
+
+ vector<int> expected_target_data{2, 3, 4, 5, 1, 2, 6, 7, 8, 9, 10, 5, 1};
+ EXPECT_EQ(expected_target_data, target_data->GetData());
+ EXPECT_EQ(expected_target_data.size(), target_data->GetSize());
+ for (size_t i = 0; i < expected_target_data.size(); ++i) {
+ EXPECT_EQ(expected_target_data[i], target_data->AtIndex(i));
+ }
+}
+
+TEST_F(DataArrayTest, TestVocabulary) {
+ EXPECT_EQ(9, source_data->GetVocabularySize());
+ EXPECT_TRUE(source_data->HasWord("mere"));
+ EXPECT_EQ(4, source_data->GetWordId("mere"));
+ EXPECT_EQ("mere", source_data->GetWord(4));
+ EXPECT_FALSE(source_data->HasWord("banane"));
+
+ EXPECT_EQ(11, target_data->GetVocabularySize());
+ EXPECT_TRUE(target_data->HasWord("apples"));
+ EXPECT_EQ(4, target_data->GetWordId("apples"));
+ EXPECT_EQ("apples", target_data->GetWord(4));
+ EXPECT_FALSE(target_data->HasWord("bananas"));
+}
+
+TEST_F(DataArrayTest, TestSentenceData) {
+ EXPECT_EQ(2, source_data->GetNumSentences());
+ EXPECT_EQ(0, source_data->GetSentenceStart(0));
+ EXPECT_EQ(5, source_data->GetSentenceStart(1));
+ EXPECT_EQ(11, source_data->GetSentenceStart(2));
+
+ EXPECT_EQ(2, target_data->GetNumSentences());
+ EXPECT_EQ(0, target_data->GetSentenceStart(0));
+ EXPECT_EQ(5, target_data->GetSentenceStart(1));
+ EXPECT_EQ(13, target_data->GetSentenceStart(2));
+}
+
+} // namespace
diff --git a/extractor/fast_intersector.cc b/extractor/fast_intersector.cc
new file mode 100644
index 00000000..8c7a7af8
--- /dev/null
+++ b/extractor/fast_intersector.cc
@@ -0,0 +1,191 @@
+#include "fast_intersector.h"
+
+#include <cassert>
+
+#include "data_array.h"
+#include "phrase.h"
+#include "phrase_location.h"
+#include "precomputation.h"
+#include "suffix_array.h"
+#include "vocabulary.h"
+
+FastIntersector::FastIntersector(shared_ptr<SuffixArray> suffix_array,
+ shared_ptr<Precomputation> precomputation,
+ shared_ptr<Vocabulary> vocabulary,
+ int max_rule_span,
+ int min_gap_size) :
+ suffix_array(suffix_array),
+ vocabulary(vocabulary),
+ max_rule_span(max_rule_span),
+ min_gap_size(min_gap_size) {
+ Index precomputed_collocations = precomputation->GetCollocations();
+ for (pair<vector<int>, vector<int> > entry: precomputed_collocations) {
+ vector<int> phrase = ConvertPhrase(entry.first);
+ collocations[phrase] = entry.second;
+ }
+}
+
+FastIntersector::FastIntersector() {}
+
+FastIntersector::~FastIntersector() {}
+
+vector<int> FastIntersector::ConvertPhrase(const vector<int>& old_phrase) {
+ vector<int> new_phrase;
+ new_phrase.reserve(old_phrase.size());
+ shared_ptr<DataArray> data_array = suffix_array->GetData();
+ int num_nonterminals = 0;
+ for (int word_id: old_phrase) {
+ // TODO(pauldb): Remove overhead for relabelling the nonterminals here.
+ if (word_id == Precomputation::NON_TERMINAL) {
+ ++num_nonterminals;
+ new_phrase.push_back(vocabulary->GetNonterminalIndex(num_nonterminals));
+ } else {
+ new_phrase.push_back(
+ vocabulary->GetTerminalIndex(data_array->GetWord(word_id)));
+ }
+ }
+ return new_phrase;
+}
+
+PhraseLocation FastIntersector::Intersect(
+ PhraseLocation& prefix_location,
+ PhraseLocation& suffix_location,
+ const Phrase& phrase) {
+ vector<int> symbols = phrase.Get();
+
+ // We should never attempt to do an intersect query for a pattern starting or
+ // ending with a non terminal. The RuleFactory should handle these cases,
+ // initializing the matchings list with the one for the pattern without the
+ // starting or ending terminal.
+ assert(vocabulary->IsTerminal(symbols.front())
+ && vocabulary->IsTerminal(symbols.back()));
+
+ if (collocations.count(symbols)) {
+ return PhraseLocation(collocations[symbols], phrase.Arity() + 1);
+ }
+
+ bool prefix_ends_with_x =
+ !vocabulary->IsTerminal(symbols[symbols.size() - 2]);
+ bool suffix_starts_with_x = !vocabulary->IsTerminal(symbols[1]);
+ if (EstimateNumOperations(prefix_location, prefix_ends_with_x) <=
+ EstimateNumOperations(suffix_location, suffix_starts_with_x)) {
+ return ExtendPrefixPhraseLocation(prefix_location, phrase,
+ prefix_ends_with_x, symbols.back());
+ } else {
+ return ExtendSuffixPhraseLocation(suffix_location, phrase,
+ suffix_starts_with_x, symbols.front());
+ }
+}
+
+int FastIntersector::EstimateNumOperations(
+ const PhraseLocation& phrase_location, bool has_margin_x) const {
+ int num_locations = phrase_location.GetSize();
+ return has_margin_x ? num_locations * max_rule_span : num_locations;
+}
+
+PhraseLocation FastIntersector::ExtendPrefixPhraseLocation(
+ PhraseLocation& prefix_location, const Phrase& phrase,
+ bool prefix_ends_with_x, int next_symbol) const {
+ ExtendPhraseLocation(prefix_location);
+ vector<int> positions = *prefix_location.matchings;
+ int num_subpatterns = prefix_location.num_subpatterns;
+
+ vector<int> new_positions;
+ shared_ptr<DataArray> data_array = suffix_array->GetData();
+ int data_array_symbol = data_array->GetWordId(
+ vocabulary->GetTerminalValue(next_symbol));
+ if (data_array_symbol == -1) {
+ return PhraseLocation(new_positions, num_subpatterns);
+ }
+
+ pair<int, int> range = GetSearchRange(prefix_ends_with_x);
+ for (size_t i = 0; i < positions.size(); i += num_subpatterns) {
+ int sent_id = data_array->GetSentenceId(positions[i]);
+ int sent_end = data_array->GetSentenceStart(sent_id + 1) - 1;
+ int pattern_end = positions[i + num_subpatterns - 1] + range.first;
+ if (prefix_ends_with_x) {
+ pattern_end += phrase.GetChunkLen(phrase.Arity() - 1) - 1;
+ } else {
+ pattern_end += phrase.GetChunkLen(phrase.Arity()) - 2;
+ }
+ for (int j = range.first; j < range.second; ++j) {
+ if (pattern_end >= sent_end ||
+ pattern_end - positions[i] >= max_rule_span) {
+ break;
+ }
+
+ if (data_array->AtIndex(pattern_end) == data_array_symbol) {
+ new_positions.insert(new_positions.end(), positions.begin() + i,
+ positions.begin() + i + num_subpatterns);
+ if (prefix_ends_with_x) {
+ new_positions.push_back(pattern_end);
+ }
+ }
+ ++pattern_end;
+ }
+ }
+
+ return PhraseLocation(new_positions, phrase.Arity() + 1);
+}
+
+PhraseLocation FastIntersector::ExtendSuffixPhraseLocation(
+ PhraseLocation& suffix_location, const Phrase& phrase,
+ bool suffix_starts_with_x, int prev_symbol) const {
+ ExtendPhraseLocation(suffix_location);
+ vector<int> positions = *suffix_location.matchings;
+ int num_subpatterns = suffix_location.num_subpatterns;
+
+ vector<int> new_positions;
+ shared_ptr<DataArray> data_array = suffix_array->GetData();
+ int data_array_symbol = data_array->GetWordId(
+ vocabulary->GetTerminalValue(prev_symbol));
+ if (data_array_symbol == -1) {
+ return PhraseLocation(new_positions, num_subpatterns);
+ }
+
+ pair<int, int> range = GetSearchRange(suffix_starts_with_x);
+ for (size_t i = 0; i < positions.size(); i += num_subpatterns) {
+ int sent_id = data_array->GetSentenceId(positions[i]);
+ int sent_start = data_array->GetSentenceStart(sent_id);
+ int pattern_start = positions[i] - range.first;
+ int pattern_end = positions[i + num_subpatterns - 1] +
+ phrase.GetChunkLen(phrase.Arity()) - 1;
+ for (int j = range.first; j < range.second; ++j) {
+ if (pattern_start < sent_start ||
+ pattern_end - pattern_start >= max_rule_span) {
+ break;
+ }
+
+ if (data_array->AtIndex(pattern_start) == data_array_symbol) {
+ new_positions.push_back(pattern_start);
+ new_positions.insert(new_positions.end(),
+ positions.begin() + i + !suffix_starts_with_x,
+ positions.begin() + i + num_subpatterns);
+ }
+ --pattern_start;
+ }
+ }
+
+ return PhraseLocation(new_positions, phrase.Arity() + 1);
+}
+
+void FastIntersector::ExtendPhraseLocation(PhraseLocation& location) const {
+ if (location.matchings != NULL) {
+ return;
+ }
+
+ location.num_subpatterns = 1;
+ location.matchings = make_shared<vector<int> >();
+ for (int i = location.sa_low; i < location.sa_high; ++i) {
+ location.matchings->push_back(suffix_array->GetSuffix(i));
+ }
+ location.sa_low = location.sa_high = 0;
+}
+
+pair<int, int> FastIntersector::GetSearchRange(bool has_marginal_x) const {
+ if (has_marginal_x) {
+ return make_pair(min_gap_size + 1, max_rule_span);
+ } else {
+ return make_pair(1, 2);
+ }
+}
diff --git a/extractor/fast_intersector.h b/extractor/fast_intersector.h
new file mode 100644
index 00000000..785e428e
--- /dev/null
+++ b/extractor/fast_intersector.h
@@ -0,0 +1,65 @@
+#ifndef _FAST_INTERSECTOR_H_
+#define _FAST_INTERSECTOR_H_
+
+#include <memory>
+#include <unordered_map>
+#include <vector>
+
+#include <boost/functional/hash.hpp>
+
+using namespace std;
+
+typedef boost::hash<vector<int> > VectorHash;
+typedef unordered_map<vector<int>, vector<int>, VectorHash> Index;
+
+class Phrase;
+class PhraseLocation;
+class Precomputation;
+class SuffixArray;
+class Vocabulary;
+
+class FastIntersector {
+ public:
+ FastIntersector(shared_ptr<SuffixArray> suffix_array,
+ shared_ptr<Precomputation> precomputation,
+ shared_ptr<Vocabulary> vocabulary,
+ int max_rule_span,
+ int min_gap_size);
+
+ virtual ~FastIntersector();
+
+ virtual PhraseLocation Intersect(PhraseLocation& prefix_location,
+ PhraseLocation& suffix_location,
+ const Phrase& phrase);
+
+ protected:
+ FastIntersector();
+
+ private:
+ vector<int> ConvertPhrase(const vector<int>& old_phrase);
+
+ int EstimateNumOperations(const PhraseLocation& phrase_location,
+ bool has_margin_x) const;
+
+ PhraseLocation ExtendPrefixPhraseLocation(PhraseLocation& prefix_location,
+ const Phrase& phrase,
+ bool prefix_ends_with_x,
+ int next_symbol) const;
+
+ PhraseLocation ExtendSuffixPhraseLocation(PhraseLocation& suffix_location,
+ const Phrase& phrase,
+ bool suffix_starts_with_x,
+ int prev_symbol) const;
+
+ void ExtendPhraseLocation(PhraseLocation& location) const;
+
+ pair<int, int> GetSearchRange(bool has_marginal_x) const;
+
+ shared_ptr<SuffixArray> suffix_array;
+ shared_ptr<Vocabulary> vocabulary;
+ int max_rule_span;
+ int min_gap_size;
+ Index collocations;
+};
+
+#endif
diff --git a/extractor/fast_intersector_test.cc b/extractor/fast_intersector_test.cc
new file mode 100644
index 00000000..0d6ef367
--- /dev/null
+++ b/extractor/fast_intersector_test.cc
@@ -0,0 +1,146 @@
+#include <gtest/gtest.h>
+
+#include <memory>
+
+#include "fast_intersector.h"
+#include "mocks/mock_data_array.h"
+#include "mocks/mock_suffix_array.h"
+#include "mocks/mock_precomputation.h"
+#include "mocks/mock_vocabulary.h"
+#include "phrase.h"
+#include "phrase_location.h"
+#include "phrase_builder.h"
+
+using namespace std;
+using namespace ::testing;
+
+namespace {
+
+class FastIntersectorTest : public Test {
+ protected:
+ virtual void SetUp() {
+ vector<string> words = {"EOL", "it", "makes", "him", "and", "mars", ",",
+ "sets", "on", "takes", "off", "."};
+ vocabulary = make_shared<MockVocabulary>();
+ for (size_t i = 0; i < words.size(); ++i) {
+ EXPECT_CALL(*vocabulary, GetTerminalIndex(words[i]))
+ .WillRepeatedly(Return(i));
+ EXPECT_CALL(*vocabulary, GetTerminalValue(i))
+ .WillRepeatedly(Return(words[i]));
+ }
+
+ vector<int> data = {1, 2, 3, 4, 1, 5, 3, 6, 1,
+ 7, 3, 8, 4, 1, 9, 3, 10, 11, 0};
+ data_array = make_shared<MockDataArray>();
+ for (size_t i = 0; i < data.size(); ++i) {
+ EXPECT_CALL(*data_array, AtIndex(i)).WillRepeatedly(Return(data[i]));
+ EXPECT_CALL(*data_array, GetSentenceId(i))
+ .WillRepeatedly(Return(0));
+ }
+ EXPECT_CALL(*data_array, GetSentenceStart(0))
+ .WillRepeatedly(Return(0));
+ EXPECT_CALL(*data_array, GetSentenceStart(1))
+ .WillRepeatedly(Return(19));
+ for (size_t i = 0; i < words.size(); ++i) {
+ EXPECT_CALL(*data_array, GetWordId(words[i]))
+ .WillRepeatedly(Return(i));
+ EXPECT_CALL(*data_array, GetWord(i))
+ .WillRepeatedly(Return(words[i]));
+ }
+
+ vector<int> suffixes = {18, 0, 4, 8, 13, 1, 2, 6, 10, 15, 3, 12, 5, 7, 9,
+ 11, 14, 16, 17};
+ suffix_array = make_shared<MockSuffixArray>();
+ EXPECT_CALL(*suffix_array, GetData()).WillRepeatedly(Return(data_array));
+ for (size_t i = 0; i < suffixes.size(); ++i) {
+ EXPECT_CALL(*suffix_array, GetSuffix(i)).
+ WillRepeatedly(Return(suffixes[i]));
+ }
+
+ precomputation = make_shared<MockPrecomputation>();
+ EXPECT_CALL(*precomputation, GetCollocations())
+ .WillRepeatedly(ReturnRef(collocations));
+
+ phrase_builder = make_shared<PhraseBuilder>(vocabulary);
+ intersector = make_shared<FastIntersector>(suffix_array, precomputation,
+ vocabulary, 15, 1);
+ }
+
+ Index collocations;
+ shared_ptr<MockDataArray> data_array;
+ shared_ptr<MockSuffixArray> suffix_array;
+ shared_ptr<MockPrecomputation> precomputation;
+ shared_ptr<MockVocabulary> vocabulary;
+ shared_ptr<FastIntersector> intersector;
+ shared_ptr<PhraseBuilder> phrase_builder;
+};
+
+TEST_F(FastIntersectorTest, TestCachedCollocation) {
+ vector<int> symbols = {8, -1, 9};
+ vector<int> expected_location = {11};
+ Phrase phrase = phrase_builder->Build(symbols);
+ PhraseLocation prefix_location(15, 16), suffix_location(16, 17);
+
+ collocations[symbols] = expected_location;
+ EXPECT_CALL(*precomputation, GetCollocations())
+ .WillRepeatedly(ReturnRef(collocations));
+ intersector = make_shared<FastIntersector>(suffix_array, precomputation,
+ vocabulary, 15, 1);
+
+ PhraseLocation result = intersector->Intersect(
+ prefix_location, suffix_location, phrase);
+
+ EXPECT_EQ(PhraseLocation(expected_location, 2), result);
+ EXPECT_EQ(PhraseLocation(15, 16), prefix_location);
+ EXPECT_EQ(PhraseLocation(16, 17), suffix_location);
+}
+
+TEST_F(FastIntersectorTest, TestIntersectaXbXcExtendSuffix) {
+ vector<int> symbols = {1, -1, 3, -1, 1};
+ Phrase phrase = phrase_builder->Build(symbols);
+ vector<int> prefix_locs = {0, 2, 0, 6, 0, 10, 4, 6, 4, 10, 4, 15, 8, 10,
+ 8, 15, 3, 15};
+ vector<int> suffix_locs = {2, 4, 2, 8, 2, 13, 6, 8, 6, 13, 10, 13};
+ PhraseLocation prefix_location(prefix_locs, 2);
+ PhraseLocation suffix_location(suffix_locs, 2);
+
+ vector<int> expected_locs = {0, 2, 4, 0, 2, 8, 0, 2, 13, 4, 6, 8, 0, 6, 8,
+ 4, 6, 13, 0, 6, 13, 8, 10, 13, 4, 10, 13,
+ 0, 10, 13};
+ PhraseLocation result = intersector->Intersect(
+ prefix_location, suffix_location, phrase);
+ EXPECT_EQ(PhraseLocation(expected_locs, 3), result);
+}
+
+/*
+TEST_F(FastIntersectorTest, TestIntersectaXbExtendPrefix) {
+ vector<int> symbols = {1, -1, 3};
+ Phrase phrase = phrase_builder->Build(symbols);
+ PhraseLocation prefix_location(1, 5), suffix_location(6, 10);
+
+ vector<int> expected_prefix_locs = {0, 4, 8, 13};
+ vector<int> expected_locs = {0, 2, 0, 6, 0, 10, 4, 6, 4, 10, 4, 15, 8, 10,
+ 8, 15, 13, 15};
+ PhraseLocation result = intersector->Intersect(
+ prefix_location, suffix_location, phrase);
+ EXPECT_EQ(PhraseLocation(expected_locs, 2), result);
+ EXPECT_EQ(PhraseLocation(expected_prefix_locs, 1), prefix_location);
+}
+
+TEST_F(FastIntersectorTest, TestIntersectCheckEstimates) {
+ // The suffix matches in fewer positions, but because it starts with an X
+ // it requires more operations and we prefer extending the prefix.
+ vector<int> symbols = {1, -1, 4, 1};
+ Phrase phrase = phrase_builder->Build(symbols);
+ vector<int> prefix_locs = {0, 3, 0, 12, 4, 12, 8, 12};
+ PhraseLocation prefix_location(prefix_locs, 2), suffix_location(10, 12);
+
+ vector<int> expected_locs = {0, 3, 0, 12, 4, 12, 8, 12};
+ PhraseLocation result = intersector->Intersect(
+ prefix_location, suffix_location, phrase);
+ EXPECT_EQ(PhraseLocation(expected_locs, 2), result);
+ EXPECT_EQ(PhraseLocation(10, 12), suffix_location);
+}
+*/
+
+} // namespace
diff --git a/extractor/features/count_source_target.cc b/extractor/features/count_source_target.cc
new file mode 100644
index 00000000..9441b451
--- /dev/null
+++ b/extractor/features/count_source_target.cc
@@ -0,0 +1,11 @@
+#include "count_source_target.h"
+
+#include <cmath>
+
+double CountSourceTarget::Score(const FeatureContext& context) const {
+ return log10(1 + context.pair_count);
+}
+
+string CountSourceTarget::GetName() const {
+ return "CountEF";
+}
diff --git a/extractor/features/count_source_target.h b/extractor/features/count_source_target.h
new file mode 100644
index 00000000..a2481944
--- /dev/null
+++ b/extractor/features/count_source_target.h
@@ -0,0 +1,13 @@
+#ifndef _COUNT_SOURCE_TARGET_H_
+#define _COUNT_SOURCE_TARGET_H_
+
+#include "feature.h"
+
+class CountSourceTarget : public Feature {
+ public:
+ double Score(const FeatureContext& context) const;
+
+ string GetName() const;
+};
+
+#endif
diff --git a/extractor/features/count_source_target_test.cc b/extractor/features/count_source_target_test.cc
new file mode 100644
index 00000000..22633bb6
--- /dev/null
+++ b/extractor/features/count_source_target_test.cc
@@ -0,0 +1,32 @@
+#include <gtest/gtest.h>
+
+#include <memory>
+#include <string>
+
+#include "count_source_target.h"
+
+using namespace std;
+using namespace ::testing;
+
+namespace {
+
+class CountSourceTargetTest : public Test {
+ protected:
+ virtual void SetUp() {
+ feature = make_shared<CountSourceTarget>();
+ }
+
+ shared_ptr<CountSourceTarget> feature;
+};
+
+TEST_F(CountSourceTargetTest, TestGetName) {
+ EXPECT_EQ("CountEF", feature->GetName());
+}
+
+TEST_F(CountSourceTargetTest, TestScore) {
+ Phrase phrase;
+ FeatureContext context(phrase, phrase, 0.5, 9, 13);
+ EXPECT_EQ(1.0, feature->Score(context));
+}
+
+} // namespace
diff --git a/extractor/features/feature.cc b/extractor/features/feature.cc
new file mode 100644
index 00000000..876f5f8f
--- /dev/null
+++ b/extractor/features/feature.cc
@@ -0,0 +1,5 @@
+#include "feature.h"
+
+const double Feature::MAX_SCORE = 99.0;
+
+Feature::~Feature() {}
diff --git a/extractor/features/feature.h b/extractor/features/feature.h
new file mode 100644
index 00000000..aca58401
--- /dev/null
+++ b/extractor/features/feature.h
@@ -0,0 +1,36 @@
+#ifndef _FEATURE_H_
+#define _FEATURE_H_
+
+#include <string>
+
+//TODO(pauldb): include headers nicely.
+#include "../phrase.h"
+
+using namespace std;
+
+struct FeatureContext {
+ FeatureContext(const Phrase& source_phrase, const Phrase& target_phrase,
+ double source_phrase_count, int pair_count, int num_samples) :
+ source_phrase(source_phrase), target_phrase(target_phrase),
+ source_phrase_count(source_phrase_count), pair_count(pair_count),
+ num_samples(num_samples) {}
+
+ Phrase source_phrase;
+ Phrase target_phrase;
+ double source_phrase_count;
+ int pair_count;
+ int num_samples;
+};
+
+class Feature {
+ public:
+ virtual double Score(const FeatureContext& context) const = 0;
+
+ virtual string GetName() const = 0;
+
+ virtual ~Feature();
+
+ static const double MAX_SCORE;
+};
+
+#endif
diff --git a/extractor/features/is_source_singleton.cc b/extractor/features/is_source_singleton.cc
new file mode 100644
index 00000000..98d4e5fe
--- /dev/null
+++ b/extractor/features/is_source_singleton.cc
@@ -0,0 +1,11 @@
+#include "is_source_singleton.h"
+
+#include <cmath>
+
+double IsSourceSingleton::Score(const FeatureContext& context) const {
+ return context.source_phrase_count == 1;
+}
+
+string IsSourceSingleton::GetName() const {
+ return "IsSingletonF";
+}
diff --git a/extractor/features/is_source_singleton.h b/extractor/features/is_source_singleton.h
new file mode 100644
index 00000000..7cc72828
--- /dev/null
+++ b/extractor/features/is_source_singleton.h
@@ -0,0 +1,13 @@
+#ifndef _IS_SOURCE_SINGLETON_H_
+#define _IS_SOURCE_SINGLETON_H_
+
+#include "feature.h"
+
+class IsSourceSingleton : public Feature {
+ public:
+ double Score(const FeatureContext& context) const;
+
+ string GetName() const;
+};
+
+#endif
diff --git a/extractor/features/is_source_singleton_test.cc b/extractor/features/is_source_singleton_test.cc
new file mode 100644
index 00000000..8c71e593
--- /dev/null
+++ b/extractor/features/is_source_singleton_test.cc
@@ -0,0 +1,35 @@
+#include <gtest/gtest.h>
+
+#include <memory>
+#include <string>
+
+#include "is_source_singleton.h"
+
+using namespace std;
+using namespace ::testing;
+
+namespace {
+
+class IsSourceSingletonTest : public Test {
+ protected:
+ virtual void SetUp() {
+ feature = make_shared<IsSourceSingleton>();
+ }
+
+ shared_ptr<IsSourceSingleton> feature;
+};
+
+TEST_F(IsSourceSingletonTest, TestGetName) {
+ EXPECT_EQ("IsSingletonF", feature->GetName());
+}
+
+TEST_F(IsSourceSingletonTest, TestScore) {
+ Phrase phrase;
+ FeatureContext context(phrase, phrase, 0.5, 3, 31);
+ EXPECT_EQ(0, feature->Score(context));
+
+ context = FeatureContext(phrase, phrase, 1, 3, 25);
+ EXPECT_EQ(1, feature->Score(context));
+}
+
+} // namespace
diff --git a/extractor/features/is_source_target_singleton.cc b/extractor/features/is_source_target_singleton.cc
new file mode 100644
index 00000000..31d36532
--- /dev/null
+++ b/extractor/features/is_source_target_singleton.cc
@@ -0,0 +1,11 @@
+#include "is_source_target_singleton.h"
+
+#include <cmath>
+
+double IsSourceTargetSingleton::Score(const FeatureContext& context) const {
+ return context.pair_count == 1;
+}
+
+string IsSourceTargetSingleton::GetName() const {
+ return "IsSingletonFE";
+}
diff --git a/extractor/features/is_source_target_singleton.h b/extractor/features/is_source_target_singleton.h
new file mode 100644
index 00000000..58913b74
--- /dev/null
+++ b/extractor/features/is_source_target_singleton.h
@@ -0,0 +1,13 @@
+#ifndef _IS_SOURCE_TARGET_SINGLETON_H_
+#define _IS_SOURCE_TARGET_SINGLETON_H_
+
+#include "feature.h"
+
+class IsSourceTargetSingleton : public Feature {
+ public:
+ double Score(const FeatureContext& context) const;
+
+ string GetName() const;
+};
+
+#endif
diff --git a/extractor/features/is_source_target_singleton_test.cc b/extractor/features/is_source_target_singleton_test.cc
new file mode 100644
index 00000000..a51f77c9
--- /dev/null
+++ b/extractor/features/is_source_target_singleton_test.cc
@@ -0,0 +1,35 @@
+#include <gtest/gtest.h>
+
+#include <memory>
+#include <string>
+
+#include "is_source_target_singleton.h"
+
+using namespace std;
+using namespace ::testing;
+
+namespace {
+
+class IsSourceTargetSingletonTest : public Test {
+ protected:
+ virtual void SetUp() {
+ feature = make_shared<IsSourceTargetSingleton>();
+ }
+
+ shared_ptr<IsSourceTargetSingleton> feature;
+};
+
+TEST_F(IsSourceTargetSingletonTest, TestGetName) {
+ EXPECT_EQ("IsSingletonFE", feature->GetName());
+}
+
+TEST_F(IsSourceTargetSingletonTest, TestScore) {
+ Phrase phrase;
+ FeatureContext context(phrase, phrase, 0.5, 3, 7);
+ EXPECT_EQ(0, feature->Score(context));
+
+ context = FeatureContext(phrase, phrase, 2.3, 1, 28);
+ EXPECT_EQ(1, feature->Score(context));
+}
+
+} // namespace
diff --git a/extractor/features/max_lex_source_given_target.cc b/extractor/features/max_lex_source_given_target.cc
new file mode 100644
index 00000000..21f5c76a
--- /dev/null
+++ b/extractor/features/max_lex_source_given_target.cc
@@ -0,0 +1,31 @@
+#include "max_lex_source_given_target.h"
+
+#include <cmath>
+
+#include "../data_array.h"
+#include "../translation_table.h"
+
+MaxLexSourceGivenTarget::MaxLexSourceGivenTarget(
+ shared_ptr<TranslationTable> table) :
+ table(table) {}
+
+double MaxLexSourceGivenTarget::Score(const FeatureContext& context) const {
+ vector<string> source_words = context.source_phrase.GetWords();
+ vector<string> target_words = context.target_phrase.GetWords();
+ target_words.push_back(DataArray::NULL_WORD_STR);
+
+ double score = 0;
+ for (string source_word: source_words) {
+ double max_score = 0;
+ for (string target_word: target_words) {
+ max_score = max(max_score,
+ table->GetSourceGivenTargetScore(source_word, target_word));
+ }
+ score += max_score > 0 ? -log10(max_score) : MAX_SCORE;
+ }
+ return score;
+}
+
+string MaxLexSourceGivenTarget::GetName() const {
+ return "MaxLexFgivenE";
+}
diff --git a/extractor/features/max_lex_source_given_target.h b/extractor/features/max_lex_source_given_target.h
new file mode 100644
index 00000000..e87c1c8e
--- /dev/null
+++ b/extractor/features/max_lex_source_given_target.h
@@ -0,0 +1,24 @@
+#ifndef _MAX_LEX_SOURCE_GIVEN_TARGET_H_
+#define _MAX_LEX_SOURCE_GIVEN_TARGET_H_
+
+#include <memory>
+
+#include "feature.h"
+
+using namespace std;
+
+class TranslationTable;
+
+class MaxLexSourceGivenTarget : public Feature {
+ public:
+ MaxLexSourceGivenTarget(shared_ptr<TranslationTable> table);
+
+ double Score(const FeatureContext& context) const;
+
+ string GetName() const;
+
+ private:
+ shared_ptr<TranslationTable> table;
+};
+
+#endif
diff --git a/extractor/features/max_lex_source_given_target_test.cc b/extractor/features/max_lex_source_given_target_test.cc
new file mode 100644
index 00000000..5fd41f8b
--- /dev/null
+++ b/extractor/features/max_lex_source_given_target_test.cc
@@ -0,0 +1,74 @@
+#include <gtest/gtest.h>
+
+#include <cmath>
+#include <memory>
+#include <string>
+
+#include "../mocks/mock_translation_table.h"
+#include "../mocks/mock_vocabulary.h"
+#include "../data_array.h"
+#include "../phrase_builder.h"
+#include "max_lex_source_given_target.h"
+
+using namespace std;
+using namespace ::testing;
+
+namespace {
+
+class MaxLexSourceGivenTargetTest : public Test {
+ protected:
+ virtual void SetUp() {
+ vector<string> source_words = {"f1", "f2", "f3"};
+ vector<string> target_words = {"e1", "e2", "e3"};
+
+ vocabulary = make_shared<MockVocabulary>();
+ for (size_t i = 0; i < source_words.size(); ++i) {
+ EXPECT_CALL(*vocabulary, GetTerminalValue(i))
+ .WillRepeatedly(Return(source_words[i]));
+ }
+ for (size_t i = 0; i < target_words.size(); ++i) {
+ EXPECT_CALL(*vocabulary, GetTerminalValue(i + source_words.size()))
+ .WillRepeatedly(Return(target_words[i]));
+ }
+
+ phrase_builder = make_shared<PhraseBuilder>(vocabulary);
+
+ table = make_shared<MockTranslationTable>();
+ for (size_t i = 0; i < source_words.size(); ++i) {
+ for (size_t j = 0; j < target_words.size(); ++j) {
+ int value = i - j;
+ EXPECT_CALL(*table, GetSourceGivenTargetScore(
+ source_words[i], target_words[j])).WillRepeatedly(Return(value));
+ }
+ }
+
+ for (size_t i = 0; i < source_words.size(); ++i) {
+ int value = i * 3;
+ EXPECT_CALL(*table, GetSourceGivenTargetScore(
+ source_words[i], DataArray::NULL_WORD_STR))
+ .WillRepeatedly(Return(value));
+ }
+
+ feature = make_shared<MaxLexSourceGivenTarget>(table);
+ }
+
+ shared_ptr<MockVocabulary> vocabulary;
+ shared_ptr<PhraseBuilder> phrase_builder;
+ shared_ptr<MockTranslationTable> table;
+ shared_ptr<MaxLexSourceGivenTarget> feature;
+};
+
+TEST_F(MaxLexSourceGivenTargetTest, TestGetName) {
+ EXPECT_EQ("MaxLexFgivenE", feature->GetName());
+}
+
+TEST_F(MaxLexSourceGivenTargetTest, TestScore) {
+ vector<int> source_symbols = {0, 1, 2};
+ Phrase source_phrase = phrase_builder->Build(source_symbols);
+ vector<int> target_symbols = {3, 4, 5};
+ Phrase target_phrase = phrase_builder->Build(target_symbols);
+ FeatureContext context(source_phrase, target_phrase, 0.3, 7, 11);
+ EXPECT_EQ(99 - log10(18), feature->Score(context));
+}
+
+} // namespace
diff --git a/extractor/features/max_lex_target_given_source.cc b/extractor/features/max_lex_target_given_source.cc
new file mode 100644
index 00000000..f2bc2474
--- /dev/null
+++ b/extractor/features/max_lex_target_given_source.cc
@@ -0,0 +1,31 @@
+#include "max_lex_target_given_source.h"
+
+#include <cmath>
+
+#include "../data_array.h"
+#include "../translation_table.h"
+
+MaxLexTargetGivenSource::MaxLexTargetGivenSource(
+ shared_ptr<TranslationTable> table) :
+ table(table) {}
+
+double MaxLexTargetGivenSource::Score(const FeatureContext& context) const {
+ vector<string> source_words = context.source_phrase.GetWords();
+ source_words.push_back(DataArray::NULL_WORD_STR);
+ vector<string> target_words = context.target_phrase.GetWords();
+
+ double score = 0;
+ for (string target_word: target_words) {
+ double max_score = 0;
+ for (string source_word: source_words) {
+ max_score = max(max_score,
+ table->GetTargetGivenSourceScore(source_word, target_word));
+ }
+ score += max_score > 0 ? -log10(max_score) : MAX_SCORE;
+ }
+ return score;
+}
+
+string MaxLexTargetGivenSource::GetName() const {
+ return "MaxLexEgivenF";
+}
diff --git a/extractor/features/max_lex_target_given_source.h b/extractor/features/max_lex_target_given_source.h
new file mode 100644
index 00000000..9585ff04
--- /dev/null
+++ b/extractor/features/max_lex_target_given_source.h
@@ -0,0 +1,24 @@
+#ifndef _MAX_LEX_TARGET_GIVEN_SOURCE_H_
+#define _MAX_LEX_TARGET_GIVEN_SOURCE_H_
+
+#include <memory>
+
+#include "feature.h"
+
+using namespace std;
+
+class TranslationTable;
+
+class MaxLexTargetGivenSource : public Feature {
+ public:
+ MaxLexTargetGivenSource(shared_ptr<TranslationTable> table);
+
+ double Score(const FeatureContext& context) const;
+
+ string GetName() const;
+
+ private:
+ shared_ptr<TranslationTable> table;
+};
+
+#endif
diff --git a/extractor/features/max_lex_target_given_source_test.cc b/extractor/features/max_lex_target_given_source_test.cc
new file mode 100644
index 00000000..c8701bf7
--- /dev/null
+++ b/extractor/features/max_lex_target_given_source_test.cc
@@ -0,0 +1,74 @@
+#include <gtest/gtest.h>
+
+#include <cmath>
+#include <memory>
+#include <string>
+
+#include "../mocks/mock_translation_table.h"
+#include "../mocks/mock_vocabulary.h"
+#include "../data_array.h"
+#include "../phrase_builder.h"
+#include "max_lex_target_given_source.h"
+
+using namespace std;
+using namespace ::testing;
+
+namespace {
+
+class MaxLexTargetGivenSourceTest : public Test {
+ protected:
+ virtual void SetUp() {
+ vector<string> source_words = {"f1", "f2", "f3"};
+ vector<string> target_words = {"e1", "e2", "e3"};
+
+ vocabulary = make_shared<MockVocabulary>();
+ for (size_t i = 0; i < source_words.size(); ++i) {
+ EXPECT_CALL(*vocabulary, GetTerminalValue(i))
+ .WillRepeatedly(Return(source_words[i]));
+ }
+ for (size_t i = 0; i < target_words.size(); ++i) {
+ EXPECT_CALL(*vocabulary, GetTerminalValue(i + source_words.size()))
+ .WillRepeatedly(Return(target_words[i]));
+ }
+
+ phrase_builder = make_shared<PhraseBuilder>(vocabulary);
+
+ table = make_shared<MockTranslationTable>();
+ for (size_t i = 0; i < source_words.size(); ++i) {
+ for (size_t j = 0; j < target_words.size(); ++j) {
+ int value = i - j;
+ EXPECT_CALL(*table, GetTargetGivenSourceScore(
+ source_words[i], target_words[j])).WillRepeatedly(Return(value));
+ }
+ }
+
+ for (size_t i = 0; i < target_words.size(); ++i) {
+ int value = i * 3;
+ EXPECT_CALL(*table, GetTargetGivenSourceScore(
+ DataArray::NULL_WORD_STR, target_words[i]))
+ .WillRepeatedly(Return(value));
+ }
+
+ feature = make_shared<MaxLexTargetGivenSource>(table);
+ }
+
+ shared_ptr<MockVocabulary> vocabulary;
+ shared_ptr<PhraseBuilder> phrase_builder;
+ shared_ptr<MockTranslationTable> table;
+ shared_ptr<MaxLexTargetGivenSource> feature;
+};
+
+TEST_F(MaxLexTargetGivenSourceTest, TestGetName) {
+ EXPECT_EQ("MaxLexEgivenF", feature->GetName());
+}
+
+TEST_F(MaxLexTargetGivenSourceTest, TestScore) {
+ vector<int> source_symbols = {0, 1, 2};
+ Phrase source_phrase = phrase_builder->Build(source_symbols);
+ vector<int> target_symbols = {3, 4, 5};
+ Phrase target_phrase = phrase_builder->Build(target_symbols);
+ FeatureContext context(source_phrase, target_phrase, 0.3, 7, 19);
+ EXPECT_EQ(-log10(36), feature->Score(context));
+}
+
+} // namespace
diff --git a/extractor/features/sample_source_count.cc b/extractor/features/sample_source_count.cc
new file mode 100644
index 00000000..88b645b1
--- /dev/null
+++ b/extractor/features/sample_source_count.cc
@@ -0,0 +1,11 @@
+#include "sample_source_count.h"
+
+#include <cmath>
+
+double SampleSourceCount::Score(const FeatureContext& context) const {
+ return log10(1 + context.num_samples);
+}
+
+string SampleSourceCount::GetName() const {
+ return "SampleCountF";
+}
diff --git a/extractor/features/sample_source_count.h b/extractor/features/sample_source_count.h
new file mode 100644
index 00000000..62d236c8
--- /dev/null
+++ b/extractor/features/sample_source_count.h
@@ -0,0 +1,13 @@
+#ifndef _SAMPLE_SOURCE_COUNT_H_
+#define _SAMPLE_SOURCE_COUNT_H_
+
+#include "feature.h"
+
+class SampleSourceCount : public Feature {
+ public:
+ double Score(const FeatureContext& context) const;
+
+ string GetName() const;
+};
+
+#endif
diff --git a/extractor/features/sample_source_count_test.cc b/extractor/features/sample_source_count_test.cc
new file mode 100644
index 00000000..7d226104
--- /dev/null
+++ b/extractor/features/sample_source_count_test.cc
@@ -0,0 +1,36 @@
+#include <gtest/gtest.h>
+
+#include <cmath>
+#include <memory>
+#include <string>
+
+#include "sample_source_count.h"
+
+using namespace std;
+using namespace ::testing;
+
+namespace {
+
+class SampleSourceCountTest : public Test {
+ protected:
+ virtual void SetUp() {
+ feature = make_shared<SampleSourceCount>();
+ }
+
+ shared_ptr<SampleSourceCount> feature;
+};
+
+TEST_F(SampleSourceCountTest, TestGetName) {
+ EXPECT_EQ("SampleCountF", feature->GetName());
+}
+
+TEST_F(SampleSourceCountTest, TestScore) {
+ Phrase phrase;
+ FeatureContext context(phrase, phrase, 0, 3, 1);
+ EXPECT_EQ(log10(2), feature->Score(context));
+
+ context = FeatureContext(phrase, phrase, 3.2, 3, 9);
+ EXPECT_EQ(1.0, feature->Score(context));
+}
+
+} // namespace
diff --git a/extractor/features/target_given_source_coherent.cc b/extractor/features/target_given_source_coherent.cc
new file mode 100644
index 00000000..274b3364
--- /dev/null
+++ b/extractor/features/target_given_source_coherent.cc
@@ -0,0 +1,12 @@
+#include "target_given_source_coherent.h"
+
+#include <cmath>
+
+double TargetGivenSourceCoherent::Score(const FeatureContext& context) const {
+ double prob = (double) context.pair_count / context.num_samples;
+ return prob > 0 ? -log10(prob) : MAX_SCORE;
+}
+
+string TargetGivenSourceCoherent::GetName() const {
+ return "EgivenFCoherent";
+}
diff --git a/extractor/features/target_given_source_coherent.h b/extractor/features/target_given_source_coherent.h
new file mode 100644
index 00000000..09c8edb1
--- /dev/null
+++ b/extractor/features/target_given_source_coherent.h
@@ -0,0 +1,13 @@
+#ifndef _TARGET_GIVEN_SOURCE_COHERENT_H_
+#define _TARGET_GIVEN_SOURCE_COHERENT_H_
+
+#include "feature.h"
+
+class TargetGivenSourceCoherent : public Feature {
+ public:
+ double Score(const FeatureContext& context) const;
+
+ string GetName() const;
+};
+
+#endif
diff --git a/extractor/features/target_given_source_coherent_test.cc b/extractor/features/target_given_source_coherent_test.cc
new file mode 100644
index 00000000..c54c06c2
--- /dev/null
+++ b/extractor/features/target_given_source_coherent_test.cc
@@ -0,0 +1,35 @@
+#include <gtest/gtest.h>
+
+#include <memory>
+#include <string>
+
+#include "target_given_source_coherent.h"
+
+using namespace std;
+using namespace ::testing;
+
+namespace {
+
+class TargetGivenSourceCoherentTest : public Test {
+ protected:
+ virtual void SetUp() {
+ feature = make_shared<TargetGivenSourceCoherent>();
+ }
+
+ shared_ptr<TargetGivenSourceCoherent> feature;
+};
+
+TEST_F(TargetGivenSourceCoherentTest, TestGetName) {
+ EXPECT_EQ("EgivenFCoherent", feature->GetName());
+}
+
+TEST_F(TargetGivenSourceCoherentTest, TestScore) {
+ Phrase phrase;
+ FeatureContext context(phrase, phrase, 0.3, 2, 20);
+ EXPECT_EQ(1.0, feature->Score(context));
+
+ context = FeatureContext(phrase, phrase, 1.9, 0, 1);
+ EXPECT_EQ(99.0, feature->Score(context));
+}
+
+} // namespace
diff --git a/extractor/grammar.cc b/extractor/grammar.cc
new file mode 100644
index 00000000..8124a804
--- /dev/null
+++ b/extractor/grammar.cc
@@ -0,0 +1,39 @@
+#include "grammar.h"
+
+#include <iomanip>
+
+#include "rule.h"
+
+using namespace std;
+
+Grammar::Grammar(const vector<Rule>& rules,
+ const vector<string>& feature_names) :
+ rules(rules), feature_names(feature_names) {}
+
+vector<Rule> Grammar::GetRules() const {
+ return rules;
+}
+
+vector<string> Grammar::GetFeatureNames() const {
+ return feature_names;
+}
+
+ostream& operator<<(ostream& os, const Grammar& grammar) {
+ vector<Rule> rules = grammar.GetRules();
+ vector<string> feature_names = grammar.GetFeatureNames();
+ os << setprecision(12);
+ for (Rule rule: rules) {
+ os << "[X] ||| " << rule.source_phrase << " ||| "
+ << rule.target_phrase << " |||";
+ for (size_t i = 0; i < rule.scores.size(); ++i) {
+ os << " " << feature_names[i] << "=" << rule.scores[i];
+ }
+ os << " |||";
+ for (auto link: rule.alignment) {
+ os << " " << link.first << "-" << link.second;
+ }
+ os << endl;
+ }
+
+ return os;
+}
diff --git a/extractor/grammar.h b/extractor/grammar.h
new file mode 100644
index 00000000..889cc2f3
--- /dev/null
+++ b/extractor/grammar.h
@@ -0,0 +1,27 @@
+#ifndef _GRAMMAR_H_
+#define _GRAMMAR_H_
+
+#include <iostream>
+#include <string>
+#include <vector>
+
+using namespace std;
+
+class Rule;
+
+class Grammar {
+ public:
+ Grammar(const vector<Rule>& rules, const vector<string>& feature_names);
+
+ vector<Rule> GetRules() const;
+
+ vector<string> GetFeatureNames() const;
+
+ friend ostream& operator<<(ostream& os, const Grammar& grammar);
+
+ private:
+ vector<Rule> rules;
+ vector<string> feature_names;
+};
+
+#endif
diff --git a/extractor/grammar_extractor.cc b/extractor/grammar_extractor.cc
new file mode 100644
index 00000000..a03e805f
--- /dev/null
+++ b/extractor/grammar_extractor.cc
@@ -0,0 +1,58 @@
+#include "grammar_extractor.h"
+
+#include <iterator>
+#include <sstream>
+#include <vector>
+
+#include "grammar.h"
+#include "rule.h"
+#include "vocabulary.h"
+
+using namespace std;
+
+GrammarExtractor::GrammarExtractor(
+ shared_ptr<SuffixArray> source_suffix_array,
+ shared_ptr<DataArray> target_data_array,
+ shared_ptr<Alignment> alignment, shared_ptr<Precomputation> precomputation,
+ shared_ptr<Scorer> scorer, int min_gap_size, int max_rule_span,
+ int max_nonterminals, int max_rule_symbols, int max_samples,
+ bool use_fast_intersect, bool use_baeza_yates, bool require_tight_phrases) :
+ vocabulary(make_shared<Vocabulary>()),
+ rule_factory(make_shared<HieroCachingRuleFactory>(
+ source_suffix_array, target_data_array, alignment, vocabulary,
+ precomputation, scorer, min_gap_size, max_rule_span, max_nonterminals,
+ max_rule_symbols, max_samples, use_fast_intersect, use_baeza_yates,
+ require_tight_phrases)) {}
+
+GrammarExtractor::GrammarExtractor(
+ shared_ptr<Vocabulary> vocabulary,
+ shared_ptr<HieroCachingRuleFactory> rule_factory) :
+ vocabulary(vocabulary),
+ rule_factory(rule_factory) {}
+
+Grammar GrammarExtractor::GetGrammar(const string& sentence) {
+ vector<string> words = TokenizeSentence(sentence);
+ vector<int> word_ids = AnnotateWords(words);
+ return rule_factory->GetGrammar(word_ids);
+}
+
+vector<string> GrammarExtractor::TokenizeSentence(const string& sentence) {
+ vector<string> result;
+ result.push_back("<s>");
+
+ istringstream buffer(sentence);
+ copy(istream_iterator<string>(buffer),
+ istream_iterator<string>(),
+ back_inserter(result));
+
+ result.push_back("</s>");
+ return result;
+}
+
+vector<int> GrammarExtractor::AnnotateWords(const vector<string>& words) {
+ vector<int> result;
+ for (string word: words) {
+ result.push_back(vocabulary->GetTerminalIndex(word));
+ }
+ return result;
+}
diff --git a/extractor/grammar_extractor.h b/extractor/grammar_extractor.h
new file mode 100644
index 00000000..a8f2090d
--- /dev/null
+++ b/extractor/grammar_extractor.h
@@ -0,0 +1,51 @@
+#ifndef _GRAMMAR_EXTRACTOR_H_
+#define _GRAMMAR_EXTRACTOR_H_
+
+#include <string>
+#include <vector>
+
+#include "rule_factory.h"
+
+using namespace std;
+
+class Alignment;
+class DataArray;
+class Grammar;
+class Precomputation;
+class Rule;
+class SuffixArray;
+class Vocabulary;
+
+class GrammarExtractor {
+ public:
+ GrammarExtractor(
+ shared_ptr<SuffixArray> source_suffix_array,
+ shared_ptr<DataArray> target_data_array,
+ shared_ptr<Alignment> alignment,
+ shared_ptr<Precomputation> precomputation,
+ shared_ptr<Scorer> scorer,
+ int min_gap_size,
+ int max_rule_span,
+ int max_nonterminals,
+ int max_rule_symbols,
+ int max_samples,
+ bool use_fast_intersect,
+ bool use_baeza_yates,
+ bool require_tight_phrases);
+
+ // For testing only.
+ GrammarExtractor(shared_ptr<Vocabulary> vocabulary,
+ shared_ptr<HieroCachingRuleFactory> rule_factory);
+
+ Grammar GetGrammar(const string& sentence);
+
+ private:
+ vector<string> TokenizeSentence(const string& sentence);
+
+ vector<int> AnnotateWords(const vector<string>& words);
+
+ shared_ptr<Vocabulary> vocabulary;
+ shared_ptr<HieroCachingRuleFactory> rule_factory;
+};
+
+#endif
diff --git a/extractor/grammar_extractor_test.cc b/extractor/grammar_extractor_test.cc
new file mode 100644
index 00000000..d4ed7d4f
--- /dev/null
+++ b/extractor/grammar_extractor_test.cc
@@ -0,0 +1,49 @@
+#include <gtest/gtest.h>
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "grammar.h"
+#include "grammar_extractor.h"
+#include "mocks/mock_rule_factory.h"
+#include "mocks/mock_vocabulary.h"
+#include "rule.h"
+
+using namespace std;
+using namespace ::testing;
+
+namespace {
+
+TEST(GrammarExtractorTest, TestAnnotatingWords) {
+ shared_ptr<MockVocabulary> vocabulary = make_shared<MockVocabulary>();
+ EXPECT_CALL(*vocabulary, GetTerminalIndex("<s>"))
+ .WillRepeatedly(Return(0));
+ EXPECT_CALL(*vocabulary, GetTerminalIndex("Anna"))
+ .WillRepeatedly(Return(1));
+ EXPECT_CALL(*vocabulary, GetTerminalIndex("has"))
+ .WillRepeatedly(Return(2));
+ EXPECT_CALL(*vocabulary, GetTerminalIndex("many"))
+ .WillRepeatedly(Return(3));
+ EXPECT_CALL(*vocabulary, GetTerminalIndex("apples"))
+ .WillRepeatedly(Return(4));
+ EXPECT_CALL(*vocabulary, GetTerminalIndex("."))
+ .WillRepeatedly(Return(5));
+ EXPECT_CALL(*vocabulary, GetTerminalIndex("</s>"))
+ .WillRepeatedly(Return(6));
+
+ shared_ptr<MockHieroCachingRuleFactory> factory =
+ make_shared<MockHieroCachingRuleFactory>();
+ vector<int> word_ids = {0, 1, 2, 3, 3, 4, 5, 6};
+ vector<Rule> rules;
+ vector<string> feature_names;
+ Grammar grammar(rules, feature_names);
+ EXPECT_CALL(*factory, GetGrammar(word_ids))
+ .WillOnce(Return(grammar));
+
+ GrammarExtractor extractor(vocabulary, factory);
+ string sentence = "Anna has many many apples .";
+ extractor.GetGrammar(sentence);
+}
+
+} // namespace
diff --git a/extractor/intersector.cc b/extractor/intersector.cc
new file mode 100644
index 00000000..39a7648d
--- /dev/null
+++ b/extractor/intersector.cc
@@ -0,0 +1,154 @@
+#include "intersector.h"
+
+#include "data_array.h"
+#include "matching_comparator.h"
+#include "phrase.h"
+#include "phrase_location.h"
+#include "precomputation.h"
+#include "suffix_array.h"
+#include "veb.h"
+#include "vocabulary.h"
+
+Intersector::Intersector(shared_ptr<Vocabulary> vocabulary,
+ shared_ptr<Precomputation> precomputation,
+ shared_ptr<SuffixArray> suffix_array,
+ shared_ptr<MatchingComparator> comparator,
+ bool use_baeza_yates) :
+ vocabulary(vocabulary),
+ suffix_array(suffix_array),
+ use_baeza_yates(use_baeza_yates) {
+ shared_ptr<DataArray> data_array = suffix_array->GetData();
+ linear_merger = make_shared<LinearMerger>(vocabulary, data_array, comparator);
+ binary_search_merger = make_shared<BinarySearchMerger>(
+ vocabulary, linear_merger, data_array, comparator);
+ ConvertIndexes(precomputation, data_array);
+}
+
+Intersector::Intersector(shared_ptr<Vocabulary> vocabulary,
+ shared_ptr<Precomputation> precomputation,
+ shared_ptr<SuffixArray> suffix_array,
+ shared_ptr<LinearMerger> linear_merger,
+ shared_ptr<BinarySearchMerger> binary_search_merger,
+ bool use_baeza_yates) :
+ vocabulary(vocabulary),
+ suffix_array(suffix_array),
+ linear_merger(linear_merger),
+ binary_search_merger(binary_search_merger),
+ use_baeza_yates(use_baeza_yates) {
+ ConvertIndexes(precomputation, suffix_array->GetData());
+}
+
+Intersector::Intersector() {}
+
+Intersector::~Intersector() {}
+
+void Intersector::ConvertIndexes(shared_ptr<Precomputation> precomputation,
+ shared_ptr<DataArray> data_array) {
+ const Index& precomputed_index = precomputation->GetInvertedIndex();
+ for (pair<vector<int>, vector<int> > entry: precomputed_index) {
+ vector<int> phrase = ConvertPhrase(entry.first, data_array);
+ inverted_index[phrase] = entry.second;
+
+ phrase.push_back(vocabulary->GetNonterminalIndex(1));
+ inverted_index[phrase] = entry.second;
+ phrase.pop_back();
+ phrase.insert(phrase.begin(), vocabulary->GetNonterminalIndex(1));
+ inverted_index[phrase] = entry.second;
+ }
+
+ const Index& precomputed_collocations = precomputation->GetCollocations();
+ for (pair<vector<int>, vector<int> > entry: precomputed_collocations) {
+ vector<int> phrase = ConvertPhrase(entry.first, data_array);
+ collocations[phrase] = entry.second;
+ }
+}
+
+vector<int> Intersector::ConvertPhrase(const vector<int>& old_phrase,
+ shared_ptr<DataArray> data_array) {
+ vector<int> new_phrase;
+ new_phrase.reserve(old_phrase.size());
+
+ int arity = 0;
+ for (int word_id: old_phrase) {
+ if (word_id == Precomputation::NON_TERMINAL) {
+ ++arity;
+ new_phrase.push_back(vocabulary->GetNonterminalIndex(arity));
+ } else {
+ new_phrase.push_back(
+ vocabulary->GetTerminalIndex(data_array->GetWord(word_id)));
+ }
+ }
+
+ return new_phrase;
+}
+
+PhraseLocation Intersector::Intersect(
+ const Phrase& prefix, PhraseLocation& prefix_location,
+ const Phrase& suffix, PhraseLocation& suffix_location,
+ const Phrase& phrase) {
+ vector<int> symbols = phrase.Get();
+
+ // We should never attempt to do an intersect query for a pattern starting or
+ // ending with a non terminal. The RuleFactory should handle these cases,
+ // initializing the matchings list with the one for the pattern without the
+ // starting or ending terminal.
+ assert(vocabulary->IsTerminal(symbols.front())
+ && vocabulary->IsTerminal(symbols.back()));
+
+ if (collocations.count(symbols)) {
+ return PhraseLocation(collocations[symbols], phrase.Arity() + 1);
+ }
+
+ vector<int> locations;
+ ExtendPhraseLocation(prefix, prefix_location);
+ ExtendPhraseLocation(suffix, suffix_location);
+ shared_ptr<vector<int> > prefix_matchings = prefix_location.matchings;
+ shared_ptr<vector<int> > suffix_matchings = suffix_location.matchings;
+ int prefix_subpatterns = prefix_location.num_subpatterns;
+ int suffix_subpatterns = suffix_location.num_subpatterns;
+ if (use_baeza_yates) {
+ binary_search_merger->Merge(locations, phrase, suffix,
+ prefix_matchings->begin(), prefix_matchings->end(),
+ suffix_matchings->begin(), suffix_matchings->end(),
+ prefix_subpatterns, suffix_subpatterns);
+ } else {
+ linear_merger->Merge(locations, phrase, suffix, prefix_matchings->begin(),
+ prefix_matchings->end(), suffix_matchings->begin(),
+ suffix_matchings->end(), prefix_subpatterns, suffix_subpatterns);
+ }
+ return PhraseLocation(locations, phrase.Arity() + 1);
+}
+
+void Intersector::ExtendPhraseLocation(
+ const Phrase& phrase, PhraseLocation& phrase_location) {
+ int low = phrase_location.sa_low, high = phrase_location.sa_high;
+ if (phrase_location.matchings != NULL) {
+ return;
+ }
+
+
+ phrase_location.num_subpatterns = 1;
+ phrase_location.sa_low = phrase_location.sa_high = 0;
+
+ vector<int> symbols = phrase.Get();
+ if (inverted_index.count(symbols)) {
+ phrase_location.matchings =
+ make_shared<vector<int> >(inverted_index[symbols]);
+ return;
+ }
+
+ vector<int> matchings;
+ matchings.reserve(high - low + 1);
+ shared_ptr<VEB> veb = VEB::Create(suffix_array->GetSize());
+ for (int i = low; i < high; ++i) {
+ veb->Insert(suffix_array->GetSuffix(i));
+ }
+
+ int value = veb->GetMinimum();
+ while (value != -1) {
+ matchings.push_back(value);
+ value = veb->GetSuccessor(value);
+ }
+
+ phrase_location.matchings = make_shared<vector<int> >(matchings);
+}
diff --git a/extractor/intersector.h b/extractor/intersector.h
new file mode 100644
index 00000000..8b159f17
--- /dev/null
+++ b/extractor/intersector.h
@@ -0,0 +1,79 @@
+#ifndef _INTERSECTOR_H_
+#define _INTERSECTOR_H_
+
+#include <memory>
+#include <unordered_map>
+#include <vector>
+
+#include <boost/functional/hash.hpp>
+
+#include "binary_search_merger.h"
+#include "linear_merger.h"
+
+using namespace std;
+
+typedef boost::hash<vector<int> > VectorHash;
+typedef unordered_map<vector<int>, vector<int>, VectorHash> Index;
+
+class DataArray;
+class MatchingComparator;
+class Phrase;
+class PhraseLocation;
+class Precomputation;
+class SuffixArray;
+class Vocabulary;
+
+class Intersector {
+ public:
+ Intersector(
+ shared_ptr<Vocabulary> vocabulary,
+ shared_ptr<Precomputation> precomputation,
+ shared_ptr<SuffixArray> source_suffix_array,
+ shared_ptr<MatchingComparator> comparator,
+ bool use_baeza_yates);
+
+ // For testing.
+ Intersector(
+ shared_ptr<Vocabulary> vocabulary,
+ shared_ptr<Precomputation> precomputation,
+ shared_ptr<SuffixArray> source_suffix_array,
+ shared_ptr<LinearMerger> linear_merger,
+ shared_ptr<BinarySearchMerger> binary_search_merger,
+ bool use_baeza_yates);
+
+ virtual ~Intersector();
+
+ virtual PhraseLocation Intersect(
+ const Phrase& prefix, PhraseLocation& prefix_location,
+ const Phrase& suffix, PhraseLocation& suffix_location,
+ const Phrase& phrase);
+
+ protected:
+ Intersector();
+
+ private:
+ void ConvertIndexes(shared_ptr<Precomputation> precomputation,
+ shared_ptr<DataArray> data_array);
+
+ vector<int> ConvertPhrase(const vector<int>& old_phrase,
+ shared_ptr<DataArray> data_array);
+
+ void ExtendPhraseLocation(const Phrase& phrase,
+ PhraseLocation& phrase_location);
+
+ shared_ptr<Vocabulary> vocabulary;
+ shared_ptr<SuffixArray> suffix_array;
+ shared_ptr<LinearMerger> linear_merger;
+ shared_ptr<BinarySearchMerger> binary_search_merger;
+ Index inverted_index;
+ Index collocations;
+ bool use_baeza_yates;
+
+ // TODO(pauldb): Don't forget to remove these.
+ public:
+ double sort_time;
+ double linear_merge_time;
+ double binary_merge_time;
+};
+
+#endif
diff --git a/extractor/intersector_test.cc b/extractor/intersector_test.cc
new file mode 100644
index 00000000..ec318362
--- /dev/null
+++ b/extractor/intersector_test.cc
@@ -0,0 +1,193 @@
+#include <gtest/gtest.h>
+
+#include <memory>
+#include <vector>
+
+#include "intersector.h"
+#include "mocks/mock_binary_search_merger.h"
+#include "mocks/mock_data_array.h"
+#include "mocks/mock_linear_merger.h"
+#include "mocks/mock_precomputation.h"
+#include "mocks/mock_suffix_array.h"
+#include "mocks/mock_vocabulary.h"
+
+using namespace std;
+using namespace ::testing;
+
+namespace {
+
+class IntersectorTest : public Test {
+ protected:
+ virtual void SetUp() {
+ data = {2, 3, 4, 3, 4, 3};
+ vector<string> words = {"a", "b", "c", "b", "c", "b"};
+ data_array = make_shared<MockDataArray>();
+ EXPECT_CALL(*data_array, GetData()).WillRepeatedly(ReturnRef(data));
+
+ vocabulary = make_shared<MockVocabulary>();
+ for (size_t i = 0; i < data.size(); ++i) {
+ EXPECT_CALL(*data_array, GetWord(data[i]))
+ .WillRepeatedly(Return(words[i]));
+ EXPECT_CALL(*vocabulary, GetTerminalIndex(words[i]))
+ .WillRepeatedly(Return(data[i]));
+ EXPECT_CALL(*vocabulary, GetTerminalValue(data[i]))
+ .WillRepeatedly(Return(words[i]));
+ }
+
+ vector<int> suffixes = {6, 0, 5, 3, 1, 4, 2};
+ suffix_array = make_shared<MockSuffixArray>();
+ EXPECT_CALL(*suffix_array, GetData())
+ .WillRepeatedly(Return(data_array));
+ EXPECT_CALL(*suffix_array, GetSize())
+ .WillRepeatedly(Return(suffixes.size()));
+ for (size_t i = 0; i < suffixes.size(); ++i) {
+ EXPECT_CALL(*suffix_array, GetSuffix(i))
+ .WillRepeatedly(Return(suffixes[i]));
+ }
+
+ vector<int> key = {2, -1, 4};
+ vector<int> values = {0, 2};
+ collocations[key] = values;
+ precomputation = make_shared<MockPrecomputation>();
+ EXPECT_CALL(*precomputation, GetInvertedIndex())
+ .WillRepeatedly(ReturnRef(inverted_index));
+ EXPECT_CALL(*precomputation, GetCollocations())
+ .WillRepeatedly(ReturnRef(collocations));
+
+ linear_merger = make_shared<MockLinearMerger>();
+ binary_search_merger = make_shared<MockBinarySearchMerger>();
+
+ phrase_builder = make_shared<PhraseBuilder>(vocabulary);
+ }
+
+ Index inverted_index;
+ Index collocations;
+ vector<int> data;
+ shared_ptr<MockVocabulary> vocabulary;
+ shared_ptr<MockDataArray> data_array;
+ shared_ptr<MockSuffixArray> suffix_array;
+ shared_ptr<MockPrecomputation> precomputation;
+ shared_ptr<MockLinearMerger> linear_merger;
+ shared_ptr<MockBinarySearchMerger> binary_search_merger;
+ shared_ptr<PhraseBuilder> phrase_builder;
+ shared_ptr<Intersector> intersector;
+};
+
+TEST_F(IntersectorTest, TestCachedCollocation) {
+ intersector = make_shared<Intersector>(vocabulary, precomputation,
+ suffix_array, linear_merger, binary_search_merger, false);
+
+ vector<int> prefix_symbols = {2, -1};
+ Phrase prefix = phrase_builder->Build(prefix_symbols);
+ vector<int> suffix_symbols = {-1, 4};
+ Phrase suffix = phrase_builder->Build(suffix_symbols);
+ vector<int> symbols = {2, -1, 4};
+ Phrase phrase = phrase_builder->Build(symbols);
+ PhraseLocation prefix_locs(0, 1), suffix_locs(2, 3);
+
+ PhraseLocation result = intersector->Intersect(
+ prefix, prefix_locs, suffix, suffix_locs, phrase);
+
+ vector<int> expected_locs = {0, 2};
+ PhraseLocation expected_result(expected_locs, 2);
+
+ EXPECT_EQ(expected_result, result);
+ EXPECT_EQ(PhraseLocation(0, 1), prefix_locs);
+ EXPECT_EQ(PhraseLocation(2, 3), suffix_locs);
+}
+
+TEST_F(IntersectorTest, TestLinearMergeaXb) {
+ vector<int> prefix_symbols = {3, -1};
+ Phrase prefix = phrase_builder->Build(prefix_symbols);
+ vector<int> suffix_symbols = {-1, 4};
+ Phrase suffix = phrase_builder->Build(suffix_symbols);
+ vector<int> symbols = {3, -1, 4};
+ Phrase phrase = phrase_builder->Build(symbols);
+ PhraseLocation prefix_locs(2, 5), suffix_locs(5, 7);
+
+ vector<int> ex_prefix_locs = {1, 3, 5};
+ PhraseLocation extended_prefix_locs(ex_prefix_locs, 1);
+ vector<int> ex_suffix_locs = {2, 4};
+ PhraseLocation extended_suffix_locs(ex_suffix_locs, 1);
+
+ vector<int> expected_locs = {1, 4};
+ EXPECT_CALL(*linear_merger, Merge(_, _, _, _, _, _, _, _, _))
+ .Times(1)
+ .WillOnce(SetArgReferee<0>(expected_locs));
+ EXPECT_CALL(*binary_search_merger, Merge(_, _, _, _, _, _, _, _, _)).Times(0);
+
+ intersector = make_shared<Intersector>(vocabulary, precomputation,
+ suffix_array, linear_merger, binary_search_merger, false);
+
+ PhraseLocation result = intersector->Intersect(
+ prefix, prefix_locs, suffix, suffix_locs, phrase);
+ PhraseLocation expected_result(expected_locs, 2);
+
+ EXPECT_EQ(expected_result, result);
+ EXPECT_EQ(extended_prefix_locs, prefix_locs);
+ EXPECT_EQ(extended_suffix_locs, suffix_locs);
+}
+
+TEST_F(IntersectorTest, TestBinarySearchMergeaXb) {
+ vector<int> prefix_symbols = {3, -1};
+ Phrase prefix = phrase_builder->Build(prefix_symbols);
+ vector<int> suffix_symbols = {-1, 4};
+ Phrase suffix = phrase_builder->Build(suffix_symbols);
+ vector<int> symbols = {3, -1, 4};
+ Phrase phrase = phrase_builder->Build(symbols);
+ PhraseLocation prefix_locs(2, 5), suffix_locs(5, 7);
+
+ vector<int> ex_prefix_locs = {1, 3, 5};
+ PhraseLocation extended_prefix_locs(ex_prefix_locs, 1);
+ vector<int> ex_suffix_locs = {2, 4};
+ PhraseLocation extended_suffix_locs(ex_suffix_locs, 1);
+
+ vector<int> expected_locs = {1, 4};
+ EXPECT_CALL(*binary_search_merger, Merge(_, _, _, _, _, _, _, _, _))
+ .Times(1)
+ .WillOnce(SetArgReferee<0>(expected_locs));
+ EXPECT_CALL(*linear_merger, Merge(_, _, _, _, _, _, _, _, _)).Times(0);
+
+ intersector = make_shared<Intersector>(vocabulary, precomputation,
+ suffix_array, linear_merger, binary_search_merger, true);
+
+ PhraseLocation result = intersector->Intersect(
+ prefix, prefix_locs, suffix, suffix_locs, phrase);
+ PhraseLocation expected_result(expected_locs, 2);
+
+ EXPECT_EQ(expected_result, result);
+ EXPECT_EQ(extended_prefix_locs, prefix_locs);
+ EXPECT_EQ(extended_suffix_locs, suffix_locs);
+}
+
+TEST_F(IntersectorTest, TestMergeaXbXc) {
+ vector<int> prefix_symbols = {2, -1, 4, -1};
+ Phrase prefix = phrase_builder->Build(prefix_symbols);
+ vector<int> suffix_symbols = {-1, 4, -1, 4};
+ Phrase suffix = phrase_builder->Build(suffix_symbols);
+ vector<int> symbols = {2, -1, 4, -1, 4};
+ Phrase phrase = phrase_builder->Build(symbols);
+
+ vector<int> ex_prefix_locs = {0, 2, 0, 4};
+ PhraseLocation extended_prefix_locs(ex_prefix_locs, 2);
+ vector<int> ex_suffix_locs = {2, 4};
+ PhraseLocation extended_suffix_locs(ex_suffix_locs, 2);
+ vector<int> expected_locs = {0, 2, 4};
+ EXPECT_CALL(*linear_merger, Merge(_, _, _, _, _, _, _, _, _))
+ .Times(1)
+ .WillOnce(SetArgReferee<0>(expected_locs));
+ EXPECT_CALL(*binary_search_merger, Merge(_, _, _, _, _, _, _, _, _)).Times(0);
+
+ intersector = make_shared<Intersector>(vocabulary, precomputation,
+ suffix_array, linear_merger, binary_search_merger, false);
+
+ PhraseLocation result = intersector->Intersect(
+ prefix, extended_prefix_locs, suffix, extended_suffix_locs, phrase);
+ PhraseLocation expected_result(expected_locs, 3);
+
+ EXPECT_EQ(expected_result, result);
+ EXPECT_EQ(ex_prefix_locs, *extended_prefix_locs.matchings);
+ EXPECT_EQ(ex_suffix_locs, *extended_suffix_locs.matchings);
+}
+
+} // namespace
diff --git a/extractor/linear_merger.cc b/extractor/linear_merger.cc
new file mode 100644
index 00000000..e7a32788
--- /dev/null
+++ b/extractor/linear_merger.cc
@@ -0,0 +1,65 @@
+#include "linear_merger.h"
+
+#include <cmath>
+
+#include "data_array.h"
+#include "matching.h"
+#include "matching_comparator.h"
+#include "phrase.h"
+#include "phrase_location.h"
+#include "vocabulary.h"
+
+LinearMerger::LinearMerger(shared_ptr<Vocabulary> vocabulary,
+ shared_ptr<DataArray> data_array,
+ shared_ptr<MatchingComparator> comparator) :
+ vocabulary(vocabulary), data_array(data_array), comparator(comparator) {}
+
+LinearMerger::LinearMerger() {}
+
+LinearMerger::~LinearMerger() {}
+
+void LinearMerger::Merge(
+ vector<int>& locations, const Phrase& phrase, const Phrase& suffix,
+ vector<int>::iterator prefix_start, vector<int>::iterator prefix_end,
+ vector<int>::iterator suffix_start, vector<int>::iterator suffix_end,
+ int prefix_subpatterns, int suffix_subpatterns) {
+ int last_chunk_len = suffix.GetChunkLen(suffix.Arity());
+ bool offset = !vocabulary->IsTerminal(suffix.GetSymbol(0));
+
+ while (prefix_start != prefix_end) {
+ Matching left(prefix_start, prefix_subpatterns,
+ data_array->GetSentenceId(*prefix_start));
+
+ while (suffix_start != suffix_end) {
+ Matching right(suffix_start, suffix_subpatterns,
+ data_array->GetSentenceId(*suffix_start));
+ if (comparator->Compare(left, right, last_chunk_len, offset) > 0) {
+ suffix_start += suffix_subpatterns;
+ } else {
+ break;
+ }
+ }
+
+ int start_position = *prefix_start;
+ vector<int> :: iterator i = suffix_start;
+ while (prefix_start != prefix_end && *prefix_start == start_position) {
+ Matching left(prefix_start, prefix_subpatterns,
+ data_array->GetSentenceId(*prefix_start));
+
+ while (i != suffix_end) {
+ Matching right(i, suffix_subpatterns, data_array->GetSentenceId(*i));
+ int comparison = comparator->Compare(left, right, last_chunk_len,
+ offset);
+ if (comparison == 0) {
+ vector<int> merged = left.Merge(right, phrase.Arity() + 1);
+ locations.insert(locations.end(), merged.begin(), merged.end());
+ } else if (comparison < 0) {
+ break;
+ }
+ i += suffix_subpatterns;
+ }
+
+ prefix_start += prefix_subpatterns;
+ }
+ }
+}
diff --git a/extractor/linear_merger.h b/extractor/linear_merger.h
new file mode 100644
index 00000000..c3c7111e
--- /dev/null
+++ b/extractor/linear_merger.h
@@ -0,0 +1,38 @@
+#ifndef _LINEAR_MERGER_H_
+#define _LINEAR_MERGER_H_
+
+#include <memory>
+#include <vector>
+
+using namespace std;
+
+class MatchingComparator;
+class Phrase;
+class PhraseLocation;
+class DataArray;
+class Vocabulary;
+
+class LinearMerger {
+ public:
+ LinearMerger(shared_ptr<Vocabulary> vocabulary,
+ shared_ptr<DataArray> data_array,
+ shared_ptr<MatchingComparator> comparator);
+
+ virtual ~LinearMerger();
+
+ virtual void Merge(
+ vector<int>& locations, const Phrase& phrase, const Phrase& suffix,
+ vector<int>::iterator prefix_start, vector<int>::iterator prefix_end,
+ vector<int>::iterator suffix_start, vector<int>::iterator suffix_end,
+ int prefix_subpatterns, int suffix_subpatterns);
+
+ protected:
+ LinearMerger();
+
+ private:
+ shared_ptr<Vocabulary> vocabulary;
+ shared_ptr<DataArray> data_array;
+ shared_ptr<MatchingComparator> comparator;
+};
+
+#endif
diff --git a/extractor/linear_merger_test.cc b/extractor/linear_merger_test.cc
new file mode 100644
index 00000000..a6963430
--- /dev/null
+++ b/extractor/linear_merger_test.cc
@@ -0,0 +1,149 @@
+#include <gtest/gtest.h>
+
+#include <memory>
+
+#include "linear_merger.h"
+#include "matching_comparator.h"
+#include "mocks/mock_data_array.h"
+#include "mocks/mock_vocabulary.h"
+#include "phrase.h"
+#include "phrase_location.h"
+#include "phrase_builder.h"
+
+using namespace std;
+using namespace ::testing;
+
+namespace {
+
+class LinearMergerTest : public Test {
+ protected:
+ virtual void SetUp() {
+ shared_ptr<MockVocabulary> vocabulary = make_shared<MockVocabulary>();
+ EXPECT_CALL(*vocabulary, GetTerminalValue(_))
+ .WillRepeatedly(Return("word"));
+
+ shared_ptr<MockDataArray> data_array = make_shared<MockDataArray>();
+ EXPECT_CALL(*data_array, GetSentenceId(_))
+ .WillRepeatedly(Return(1));
+
+ shared_ptr<MatchingComparator> comparator =
+ make_shared<MatchingComparator>(1, 20);
+
+ phrase_builder = make_shared<PhraseBuilder>(vocabulary);
+ linear_merger = make_shared<LinearMerger>(vocabulary, data_array,
+ comparator);
+ }
+
+ shared_ptr<LinearMerger> linear_merger;
+ shared_ptr<PhraseBuilder> phrase_builder;
+};
+
+TEST_F(LinearMergerTest, aXbTest) {
+ vector<int> locations;
+ // Encoding for him X it (see Adam's dissertation).
+ vector<int> symbols{1, -1, 2};
+ Phrase phrase = phrase_builder->Build(symbols);
+ vector<int> suffix_symbols{-1, 2};
+ Phrase suffix = phrase_builder->Build(suffix_symbols);
+
+ vector<int> prefix_locs{2, 6, 10, 15};
+ vector<int> suffix_locs{0, 4, 8, 13};
+
+ linear_merger->Merge(locations, phrase, suffix, prefix_locs.begin(),
+ prefix_locs.end(), suffix_locs.begin(), suffix_locs.end(), 1, 1);
+
+ vector<int> expected_locations{2, 4, 2, 8, 2, 13, 6, 8, 6, 13, 10, 13};
+ EXPECT_EQ(expected_locations, locations);
+}
+
+TEST_F(LinearMergerTest, aXbXcTest) {
+ vector<int> locations;
+ // Encoding for it X him X it (see Adam's dissertation).
+ vector<int> symbols{1, -1, 2, -2, 1};
+ Phrase phrase = phrase_builder->Build(symbols);
+ vector<int> suffix_symbols{-1, 2, -2, 1};
+ Phrase suffix = phrase_builder->Build(suffix_symbols);
+
+ vector<int> prefix_locs{0, 2, 0, 6, 0, 10, 4, 6, 4, 10, 4, 15, 8, 10, 8, 15,
+ 13, 15};
+ vector<int> suffix_locs{2, 4, 2, 8, 2, 13, 6, 8, 6, 13, 10, 13};
+
+ linear_merger->Merge(locations, phrase, suffix, prefix_locs.begin(),
+ prefix_locs.end(), suffix_locs.begin(), suffix_locs.end(), 2, 2);
+
+ vector<int> expected_locs{0, 2, 4, 0, 2, 8, 0, 2, 13, 0, 6, 8, 0, 6, 13, 0,
+ 10, 13, 4, 6, 8, 4, 6, 13, 4, 10, 13, 8, 10, 13};
+ EXPECT_EQ(expected_locs, locations);
+}
+
+TEST_F(LinearMergerTest, abXcXdTest) {
+ // Sentence: Anna has many many nuts and sour apples and juicy apples.
+ // Phrase: Anna has X and X apples.
+ vector<int> locations;
+ vector<int> symbols{1, 2, -1, 3, -2, 4};
+ Phrase phrase = phrase_builder->Build(symbols);
+ vector<int> suffix_symbols{2, -1, 3, -2, 4};
+ Phrase suffix = phrase_builder->Build(suffix_symbols);
+
+ vector<int> prefix_locs{1, 6, 1, 9};
+ vector<int> suffix_locs{2, 6, 8, 2, 6, 11, 2, 9, 11};
+
+ linear_merger->Merge(locations, phrase, suffix, prefix_locs.begin(),
+ prefix_locs.end(), suffix_locs.begin(), suffix_locs.end(), 2, 3);
+
+ vector<int> expected_locs{1, 6, 8, 1, 6, 11, 1, 9, 11};
+ EXPECT_EQ(expected_locs, locations);
+}
+
+TEST_F(LinearMergerTest, LargeTest) {
+ vector<int> locations;
+ vector<int> symbols{1, -1, 2};
+ Phrase phrase = phrase_builder->Build(symbols);
+ vector<int> suffix_symbols{-1, 2};
+ Phrase suffix = phrase_builder->Build(suffix_symbols);
+
+ vector<int> prefix_locs;
+ for (int i = 0; i < 100; ++i) {
+ prefix_locs.push_back(i * 20 + 1);
+ }
+ vector<int> suffix_locs;
+ for (int i = 0; i < 100; ++i) {
+ suffix_locs.push_back(i * 20 + 5);
+ suffix_locs.push_back(i * 20 + 13);
+ }
+
+ linear_merger->Merge(locations, phrase, suffix, prefix_locs.begin(),
+ prefix_locs.end(), suffix_locs.begin(), suffix_locs.end(), 1, 1);
+
+ EXPECT_EQ(400, locations.size());
+ for (int i = 0; i < 100; ++i) {
+ EXPECT_EQ(i * 20 + 1, locations[4 * i]);
+ EXPECT_EQ(i * 20 + 5, locations[4 * i + 1]);
+ EXPECT_EQ(i * 20 + 1, locations[4 * i + 2]);
+ EXPECT_EQ(i * 20 + 13, locations[4 * i + 3]);
+ }
+}
+
+TEST_F(LinearMergerTest, EmptyResultTest) {
+ vector<int> locations;
+ vector<int> symbols{1, -1, 2};
+ Phrase phrase = phrase_builder->Build(symbols);
+ vector<int> suffix_symbols{-1, 2};
+ Phrase suffix = phrase_builder->Build(suffix_symbols);
+
+ vector<int> prefix_locs;
+ for (int i = 0; i < 100; ++i) {
+ prefix_locs.push_back(i * 200 + 1);
+ }
+ vector<int> suffix_locs;
+ for (int i = 0; i < 100; ++i) {
+ suffix_locs.push_back(i * 200 + 101);
+ }
+
+ linear_merger->Merge(locations, phrase, suffix, prefix_locs.begin(),
+ prefix_locs.end(), suffix_locs.begin(), suffix_locs.end(), 1, 1);
+
+ EXPECT_EQ(0, locations.size());
+}
+
+} // namespace
diff --git a/extractor/matching.cc b/extractor/matching.cc
new file mode 100644
index 00000000..16a3ed6f
--- /dev/null
+++ b/extractor/matching.cc
@@ -0,0 +1,12 @@
+#include "matching.h"
+
+Matching::Matching(vector<int>::iterator start, int len, int sentence_id) :
+ positions(start, start + len), sentence_id(sentence_id) {}
+
+vector<int> Matching::Merge(const Matching& other, int num_subpatterns) const {
+ vector<int> result = positions;
+ if (num_subpatterns > positions.size()) {
+ result.push_back(other.positions.back());
+ }
+ return result;
+}
diff --git a/extractor/matching.h b/extractor/matching.h
new file mode 100644
index 00000000..4c46559e
--- /dev/null
+++ b/extractor/matching.h
@@ -0,0 +1,18 @@
+#ifndef _MATCHING_H_
+#define _MATCHING_H_
+
+#include <memory>
+#include <vector>
+
+using namespace std;
+
+struct Matching {
+ Matching(vector<int>::iterator start, int len, int sentence_id);
+
+ vector<int> Merge(const Matching& other, int num_subpatterns) const;
+
+ vector<int> positions;
+ int sentence_id;
+};
+
+#endif
diff --git a/extractor/matching_comparator.cc b/extractor/matching_comparator.cc
new file mode 100644
index 00000000..03db95c0
--- /dev/null
+++ b/extractor/matching_comparator.cc
@@ -0,0 +1,46 @@
+#include "matching_comparator.h"
+
+#include "matching.h"
+#include "vocabulary.h"
+
+MatchingComparator::MatchingComparator(int min_gap_size, int max_rule_span) :
+ min_gap_size(min_gap_size), max_rule_span(max_rule_span) {}
+
+int MatchingComparator::Compare(const Matching& left,
+ const Matching& right,
+ int last_chunk_len,
+ bool offset) const {
+ if (left.sentence_id != right.sentence_id) {
+ return left.sentence_id < right.sentence_id ? -1 : 1;
+ }
+
+ if (left.positions.size() == 1 && right.positions.size() == 1) {
+ // The prefix and the suffix must be separated by a non-terminal, otherwise
+ // we would be doing a suffix array lookup.
+ if (right.positions[0] - left.positions[0] <= min_gap_size) {
+ return 1;
+ }
+ } else if (offset) {
+ for (size_t i = 1; i < left.positions.size(); ++i) {
+ if (left.positions[i] != right.positions[i - 1]) {
+ return left.positions[i] < right.positions[i - 1] ? -1 : 1;
+ }
+ }
+ } else {
+ if (left.positions[0] + 1 != right.positions[0]) {
+ return left.positions[0] + 1 < right.positions[0] ? -1 : 1;
+ }
+ for (size_t i = 1; i < left.positions.size(); ++i) {
+ if (left.positions[i] != right.positions[i]) {
+ return left.positions[i] < right.positions[i] ? -1 : 1;
+ }
+ }
+ }
+
+ if (right.positions.back() + last_chunk_len - left.positions.front() >
+ max_rule_span) {
+ return -1;
+ }
+
+ return 0;
+}
diff --git a/extractor/matching_comparator.h b/extractor/matching_comparator.h
new file mode 100644
index 00000000..6e1bb487
--- /dev/null
+++ b/extractor/matching_comparator.h
@@ -0,0 +1,23 @@
+#ifndef _MATCHING_COMPARATOR_H_
+#define _MATCHING_COMPARATOR_H_
+
+#include <memory>
+
+using namespace std;
+
+class Vocabulary;
+class Matching;
+
+class MatchingComparator {
+ public:
+ MatchingComparator(int min_gap_size, int max_rule_span);
+
+ int Compare(const Matching& left, const Matching& right,
+ int last_chunk_len, bool offset) const;
+
+ private:
+ int min_gap_size;
+ int max_rule_span;
+};
+
+#endif
diff --git a/extractor/matching_comparator_test.cc b/extractor/matching_comparator_test.cc
new file mode 100644
index 00000000..b8f898cf
--- /dev/null
+++ b/extractor/matching_comparator_test.cc
@@ -0,0 +1,139 @@
+#include <gtest/gtest.h>
+
+#include "matching.h"
+#include "matching_comparator.h"
+
+using namespace ::testing;
+
+namespace {
+
+class MatchingComparatorTest : public Test {
+ protected:
+ virtual void SetUp() {
+ comparator = make_shared<MatchingComparator>(1, 20);
+ }
+
+ shared_ptr<MatchingComparator> comparator;
+};
+
+TEST_F(MatchingComparatorTest, SmallerSentenceId) {
+ vector<int> left_locations{1};
+ Matching left(left_locations.begin(), 1, 1);
+ vector<int> right_locations{100};
+ Matching right(right_locations.begin(), 1, 5);
+ EXPECT_EQ(-1, comparator->Compare(left, right, 1, true));
+}
+
+TEST_F(MatchingComparatorTest, GreaterSentenceId) {
+ vector<int> left_locations{100};
+ Matching left(left_locations.begin(), 1, 5);
+ vector<int> right_locations{1};
+ Matching right(right_locations.begin(), 1, 1);
+ EXPECT_EQ(1, comparator->Compare(left, right, 1, true));
+}
+
+TEST_F(MatchingComparatorTest, SmalleraXb) {
+ vector<int> left_locations{1};
+ Matching left(left_locations.begin(), 1, 1);
+ vector<int> right_locations{21};
+ Matching right(right_locations.begin(), 1, 1);
+ // The matching exceeds the max rule span.
+ EXPECT_EQ(-1, comparator->Compare(left, right, 1, true));
+}
+
+TEST_F(MatchingComparatorTest, EqualaXb) {
+ vector<int> left_locations{1};
+ Matching left(left_locations.begin(), 1, 1);
+ vector<int> lower_right_locations{3};
+ Matching right(lower_right_locations.begin(), 1, 1);
+ EXPECT_EQ(0, comparator->Compare(left, right, 1, true));
+
+ vector<int> higher_right_locations{20};
+ right = Matching(higher_right_locations.begin(), 1, 1);
+ EXPECT_EQ(0, comparator->Compare(left, right, 1, true));
+}
+
+TEST_F(MatchingComparatorTest, GreateraXb) {
+ vector<int> left_locations{1};
+ Matching left(left_locations.begin(), 1, 1);
+ vector<int> right_locations{2};
+ Matching right(right_locations.begin(), 1, 1);
+ // The gap between the prefix and the suffix is of size 0, less than the
+ // min gap size.
+ EXPECT_EQ(1, comparator->Compare(left, right, 1, true));
+}
+
+TEST_F(MatchingComparatorTest, SmalleraXbXc) {
+ vector<int> left_locations{1, 3};
+ Matching left(left_locations.begin(), 2, 1);
+ vector<int> right_locations{4, 6};
+ // The common part doesn't match.
+ Matching right(right_locations.begin(), 2, 1);
+ EXPECT_EQ(-1, comparator->Compare(left, right, 1, true));
+
+ // The common part matches, but the rule exceeds the max span.
+ vector<int> other_right_locations{3, 21};
+ right = Matching(other_right_locations.begin(), 2, 1);
+ EXPECT_EQ(-1, comparator->Compare(left, right, 1, true));
+}
+
+TEST_F(MatchingComparatorTest, EqualaXbXc) {
+ vector<int> left_locations{1, 3};
+ Matching left(left_locations.begin(), 2, 1);
+ vector<int> right_locations{3, 5};
+ // The leftmost possible match.
+ Matching right(right_locations.begin(), 2, 1);
+ EXPECT_EQ(0, comparator->Compare(left, right, 1, true));
+
+ // The rightmost possible match.
+ vector<int> other_right_locations{3, 20};
+ right = Matching(other_right_locations.begin(), 2, 1);
+ EXPECT_EQ(0, comparator->Compare(left, right, 1, true));
+}
+
+TEST_F(MatchingComparatorTest, GreateraXbXc) {
+ vector<int> left_locations{1, 4};
+ Matching left(left_locations.begin(), 2, 1);
+ vector<int> right_locations{3, 5};
+ // The common part doesn't match.
+ Matching right(right_locations.begin(), 2, 1);
+ EXPECT_EQ(1, comparator->Compare(left, right, 1, true));
+}
+
+TEST_F(MatchingComparatorTest, SmallerabXcXd) {
+ vector<int> left_locations{9, 13};
+ Matching left(left_locations.begin(), 2, 1);
+ // The suffix doesn't start on the next position.
+ vector<int> right_locations{11, 13, 15};
+ Matching right(right_locations.begin(), 3, 1);
+ EXPECT_EQ(-1, comparator->Compare(left, right, 1, false));
+
+ // The common part doesn't match.
+ vector<int> other_right_locations{10, 16, 18};
+ right = Matching(other_right_locations.begin(), 3, 1);
+ EXPECT_EQ(-1, comparator->Compare(left, right, 1, false));
+}
+
+TEST_F(MatchingComparatorTest, EqualabXcXd) {
+ vector<int> left_locations{10, 13};
+ Matching left(left_locations.begin(), 2, 1);
+ vector<int> right_locations{11, 13, 15};
+ Matching right(right_locations.begin(), 3, 1);
+ EXPECT_EQ(0, comparator->Compare(left, right, 1, false));
+}
+
+TEST_F(MatchingComparatorTest, GreaterabXcXd) {
+ vector<int> left_locations{9, 15};
+ Matching left(left_locations.begin(), 2, 1);
+ // The suffix doesn't start on the next position.
+ vector<int> right_locations{7, 15, 17};
+ Matching right(right_locations.begin(), 3, 1);
+ EXPECT_EQ(1, comparator->Compare(left, right, 1, false));
+
+ // The common part doesn't match.
+ vector<int> other_right_locations{10, 13, 16};
+ right = Matching(other_right_locations.begin(), 3, 1);
+ EXPECT_EQ(1, comparator->Compare(left, right, 1, false));
+}
+
+} // namespace
diff --git a/extractor/matching_test.cc b/extractor/matching_test.cc
new file mode 100644
index 00000000..9593aa86
--- /dev/null
+++ b/extractor/matching_test.cc
@@ -0,0 +1,25 @@
+#include <gtest/gtest.h>
+
+#include <vector>
+
+#include "matching.h"
+
+using namespace std;
+
+namespace {
+
+TEST(MatchingTest, SameSize) {
+ vector<int> positions{1, 2, 3};
+ Matching left(positions.begin(), positions.size(), 0);
+ Matching right(positions.begin(), positions.size(), 0);
+ EXPECT_EQ(positions, left.Merge(right, positions.size()));
+}
+
+TEST(MatchingTest, DifferentSize) {
+ vector<int> positions{1, 2, 3};
+ Matching left(positions.begin(), positions.size() - 1, 0);
+ Matching right(positions.begin() + 1, positions.size() - 1, 0);
+ vector<int> result = left.Merge(right, positions.size());
+}
+
+} // namespace
diff --git a/extractor/matchings_finder.cc b/extractor/matchings_finder.cc
new file mode 100644
index 00000000..eaf493b2
--- /dev/null
+++ b/extractor/matchings_finder.cc
@@ -0,0 +1,21 @@
+#include "matchings_finder.h"
+
+#include "suffix_array.h"
+#include "phrase_location.h"
+
+MatchingsFinder::MatchingsFinder(shared_ptr<SuffixArray> suffix_array) :
+ suffix_array(suffix_array) {}
+
+MatchingsFinder::MatchingsFinder() {}
+
+MatchingsFinder::~MatchingsFinder() {}
+
+PhraseLocation MatchingsFinder::Find(PhraseLocation& location,
+ const string& word, int offset) {
+ if (location.sa_low == -1 && location.sa_high == -1) {
+ location.sa_low = 0;
+ location.sa_high = suffix_array->GetSize();
+ }
+
+ return suffix_array->Lookup(location.sa_low, location.sa_high, word, offset);
+}
diff --git a/extractor/matchings_finder.h b/extractor/matchings_finder.h
new file mode 100644
index 00000000..ed04d8b8
--- /dev/null
+++ b/extractor/matchings_finder.h
@@ -0,0 +1,28 @@
+#ifndef _MATCHINGS_FINDER_H_
+#define _MATCHINGS_FINDER_H_
+
+#include <memory>
+#include <string>
+
+using namespace std;
+
+class PhraseLocation;
+class SuffixArray;
+
+class MatchingsFinder {
+ public:
+ MatchingsFinder(shared_ptr<SuffixArray> suffix_array);
+
+ virtual ~MatchingsFinder();
+
+ virtual PhraseLocation Find(PhraseLocation& location, const string& word,
+ int offset);
+
+ protected:
+ MatchingsFinder();
+
+ private:
+ shared_ptr<SuffixArray> suffix_array;
+};
+
+#endif
diff --git a/extractor/matchings_finder_test.cc b/extractor/matchings_finder_test.cc
new file mode 100644
index 00000000..817f1635
--- /dev/null
+++ b/extractor/matchings_finder_test.cc
@@ -0,0 +1,42 @@
+#include <gtest/gtest.h>
+
+#include <memory>
+
+#include "matchings_finder.h"
+#include "mocks/mock_suffix_array.h"
+#include "phrase_location.h"
+
+using namespace std;
+using namespace ::testing;
+
+namespace {
+
+class MatchingsFinderTest : public Test {
+ protected:
+ virtual void SetUp() {
+ suffix_array = make_shared<MockSuffixArray>();
+ EXPECT_CALL(*suffix_array, Lookup(0, 10, _, _))
+ .Times(1)
+ .WillOnce(Return(PhraseLocation(3, 5)));
+
+ matchings_finder = make_shared<MatchingsFinder>(suffix_array);
+ }
+
+ shared_ptr<MatchingsFinder> matchings_finder;
+ shared_ptr<MockSuffixArray> suffix_array;
+};
+
+TEST_F(MatchingsFinderTest, TestFind) {
+ PhraseLocation phrase_location(0, 10), expected_result(3, 5);
+ EXPECT_EQ(expected_result, matchings_finder->Find(phrase_location, "bla", 2));
+}
+
+TEST_F(MatchingsFinderTest, ResizeUnsetRange) {
+ EXPECT_CALL(*suffix_array, GetSize()).Times(1).WillOnce(Return(10));
+
+ PhraseLocation phrase_location, expected_result(3, 5);
+ EXPECT_EQ(expected_result, matchings_finder->Find(phrase_location, "bla", 2));
+ EXPECT_EQ(PhraseLocation(0, 10), phrase_location);
+}
+
+} // namespace
diff --git a/extractor/matchings_trie.cc b/extractor/matchings_trie.cc
new file mode 100644
index 00000000..921ec582
--- /dev/null
+++ b/extractor/matchings_trie.cc
@@ -0,0 +1,19 @@
+#include "matchings_trie.h"
+
+void MatchingsTrie::Reset() {
+ ResetTree(root);
+ root = make_shared<TrieNode>();
+}
+
+shared_ptr<TrieNode> MatchingsTrie::GetRoot() const {
+ return root;
+}
+
+void MatchingsTrie::ResetTree(shared_ptr<TrieNode> root) {
+ if (root != NULL) {
+ for (auto child: root->children) {
+ ResetTree(child.second);
+ }
+ root.reset();
+ }
+}
diff --git a/extractor/matchings_trie.h b/extractor/matchings_trie.h
new file mode 100644
index 00000000..6e72b2db
--- /dev/null
+++ b/extractor/matchings_trie.h
@@ -0,0 +1,47 @@
+#ifndef _MATCHINGS_TRIE_
+#define _MATCHINGS_TRIE_
+
+#include <memory>
+#include <unordered_map>
+
+#include "phrase.h"
+#include "phrase_location.h"
+
+using namespace std;
+
+struct TrieNode {
+ TrieNode(shared_ptr<TrieNode> suffix_link = shared_ptr<TrieNode>(),
+ Phrase phrase = Phrase(),
+ PhraseLocation matchings = PhraseLocation()) :
+ suffix_link(suffix_link), phrase(phrase), matchings(matchings) {}
+
+ void AddChild(int key, shared_ptr<TrieNode> child_node) {
+ children[key] = child_node;
+ }
+
+ bool HasChild(int key) {
+ return children.count(key);
+ }
+
+ shared_ptr<TrieNode> GetChild(int key) {
+ return children[key];
+ }
+
+ shared_ptr<TrieNode> suffix_link;
+ Phrase phrase;
+ PhraseLocation matchings;
+ unordered_map<int, shared_ptr<TrieNode> > children;
+};
+
+class MatchingsTrie {
+ public:
+ void Reset();
+ shared_ptr<TrieNode> GetRoot() const;
+
+ private:
+ void ResetTree(shared_ptr<TrieNode> root);
+
+ shared_ptr<TrieNode> root;
+};
+
+#endif
diff --git a/extractor/mocks/mock_alignment.h b/extractor/mocks/mock_alignment.h
new file mode 100644
index 00000000..4a5077ad
--- /dev/null
+++ b/extractor/mocks/mock_alignment.h
@@ -0,0 +1,10 @@
+#include <gmock/gmock.h>
+
+#include "../alignment.h"
+
+typedef vector<pair<int, int> > SentenceLinks;
+
+class MockAlignment : public Alignment {
+ public:
+ MOCK_CONST_METHOD1(GetLinks, SentenceLinks(int sentence_id));
+};
diff --git a/extractor/mocks/mock_binary_search_merger.h b/extractor/mocks/mock_binary_search_merger.h
new file mode 100644
index 00000000..e23386f0
--- /dev/null
+++ b/extractor/mocks/mock_binary_search_merger.h
@@ -0,0 +1,15 @@
+#include <gmock/gmock.h>
+
+#include <vector>
+
+#include "../binary_search_merger.h"
+#include "../phrase.h"
+
+using namespace std;
+
+class MockBinarySearchMerger: public BinarySearchMerger {
+ public:
+ MOCK_CONST_METHOD9(Merge, void(vector<int>&, const Phrase&, const Phrase&,
+ const vector<int>::iterator&, const vector<int>::iterator&,
+ const vector<int>::iterator&, const vector<int>::iterator&, int, int));
+};
diff --git a/extractor/mocks/mock_data_array.h b/extractor/mocks/mock_data_array.h
new file mode 100644
index 00000000..004e8906
--- /dev/null
+++ b/extractor/mocks/mock_data_array.h
@@ -0,0 +1,19 @@
+#include <gmock/gmock.h>
+
+#include "../data_array.h"
+
+class MockDataArray : public DataArray {
+ public:
+ MOCK_CONST_METHOD0(GetData, const vector<int>&());
+ MOCK_CONST_METHOD1(AtIndex, int(int index));
+ MOCK_CONST_METHOD1(GetWordAtIndex, string(int index));
+ MOCK_CONST_METHOD0(GetSize, int());
+ MOCK_CONST_METHOD0(GetVocabularySize, int());
+ MOCK_CONST_METHOD1(HasWord, bool(const string& word));
+ MOCK_CONST_METHOD1(GetWordId, int(const string& word));
+ MOCK_CONST_METHOD1(GetWord, string(int word_id));
+ MOCK_CONST_METHOD1(GetSentenceLength, int(int sentence_id));
+ MOCK_CONST_METHOD0(GetNumSentences, int());
+ MOCK_CONST_METHOD1(GetSentenceStart, int(int sentence_id));
+ MOCK_CONST_METHOD1(GetSentenceId, int(int position));
+};
diff --git a/extractor/mocks/mock_fast_intersector.h b/extractor/mocks/mock_fast_intersector.h
new file mode 100644
index 00000000..201386f2
--- /dev/null
+++ b/extractor/mocks/mock_fast_intersector.h
@@ -0,0 +1,11 @@
+#include <gmock/gmock.h>
+
+#include "../fast_intersector.h"
+#include "../phrase.h"
+#include "../phrase_location.h"
+
+class MockFastIntersector : public FastIntersector {
+ public:
+ MOCK_METHOD3(Intersect, PhraseLocation(PhraseLocation&, PhraseLocation&,
+ const Phrase&));
+};
diff --git a/extractor/mocks/mock_feature.h b/extractor/mocks/mock_feature.h
new file mode 100644
index 00000000..d2137629
--- /dev/null
+++ b/extractor/mocks/mock_feature.h
@@ -0,0 +1,9 @@
+#include <gmock/gmock.h>
+
+#include "../features/feature.h"
+
+class MockFeature : public Feature {
+ public:
+ MOCK_CONST_METHOD1(Score, double(const FeatureContext& context));
+ MOCK_CONST_METHOD0(GetName, string());
+};
diff --git a/extractor/mocks/mock_intersector.h b/extractor/mocks/mock_intersector.h
new file mode 100644
index 00000000..372fa7ea
--- /dev/null
+++ b/extractor/mocks/mock_intersector.h
@@ -0,0 +1,11 @@
+#include <gmock/gmock.h>
+
+#include "../intersector.h"
+#include "../phrase.h"
+#include "../phrase_location.h"
+
+class MockIntersector : public Intersector {
+ public:
+ MOCK_METHOD5(Intersect, PhraseLocation(const Phrase&, PhraseLocation&,
+ const Phrase&, PhraseLocation&, const Phrase&));
+};
diff --git a/extractor/mocks/mock_linear_merger.h b/extractor/mocks/mock_linear_merger.h
new file mode 100644
index 00000000..522c1f31
--- /dev/null
+++ b/extractor/mocks/mock_linear_merger.h
@@ -0,0 +1,15 @@
+#include <gmock/gmock.h>
+
+#include <vector>
+
+#include "../linear_merger.h"
+#include "../phrase.h"
+
+using namespace std;
+
+class MockLinearMerger: public LinearMerger {
+ public:
+ MOCK_METHOD9(Merge, void(vector<int>&, const Phrase&, const Phrase&,
+ vector<int>::iterator, vector<int>::iterator, vector<int>::iterator,
+ vector<int>::iterator, int, int));
+};
diff --git a/extractor/mocks/mock_matchings_finder.h b/extractor/mocks/mock_matchings_finder.h
new file mode 100644
index 00000000..3e80d266
--- /dev/null
+++ b/extractor/mocks/mock_matchings_finder.h
@@ -0,0 +1,9 @@
+#include <gmock/gmock.h>
+
+#include "../matchings_finder.h"
+#include "../phrase_location.h"
+
+class MockMatchingsFinder : public MatchingsFinder {
+ public:
+ MOCK_METHOD3(Find, PhraseLocation(PhraseLocation&, const string&, int));
+};
diff --git a/extractor/mocks/mock_precomputation.h b/extractor/mocks/mock_precomputation.h
new file mode 100644
index 00000000..987bdb2f
--- /dev/null
+++ b/extractor/mocks/mock_precomputation.h
@@ -0,0 +1,9 @@
+#include <gmock/gmock.h>
+
+#include "../precomputation.h"
+
+class MockPrecomputation : public Precomputation {
+ public:
+ MOCK_CONST_METHOD0(GetInvertedIndex, const Index&());
+ MOCK_CONST_METHOD0(GetCollocations, const Index&());
+};
diff --git a/extractor/mocks/mock_rule_extractor.h b/extractor/mocks/mock_rule_extractor.h
new file mode 100644
index 00000000..f18e009a
--- /dev/null
+++ b/extractor/mocks/mock_rule_extractor.h
@@ -0,0 +1,12 @@
+#include <gmock/gmock.h>
+
+#include "../phrase.h"
+#include "../phrase_builder.h"
+#include "../rule.h"
+#include "../rule_extractor.h"
+
+class MockRuleExtractor : public RuleExtractor {
+ public:
+ MOCK_CONST_METHOD2(ExtractRules, vector<Rule>(const Phrase&,
+ const PhraseLocation&));
+};
diff --git a/extractor/mocks/mock_rule_extractor_helper.h b/extractor/mocks/mock_rule_extractor_helper.h
new file mode 100644
index 00000000..63ff1048
--- /dev/null
+++ b/extractor/mocks/mock_rule_extractor_helper.h
@@ -0,0 +1,78 @@
+#include <gmock/gmock.h>
+
+#include <vector>
+
+#include "../rule_extractor_helper.h"
+
+using namespace std;
+
+typedef unordered_map<int, int> Indexes;
+
+class MockRuleExtractorHelper : public RuleExtractorHelper {
+ public:
+ MOCK_CONST_METHOD5(GetLinksSpans, void(vector<int>&, vector<int>&,
+ vector<int>&, vector<int>&, int));
+ MOCK_CONST_METHOD3(CheckAlignedTerminals, bool(const vector<int>&,
+ const vector<int>&, const vector<int>&));
+ MOCK_CONST_METHOD3(CheckTightPhrases, bool(const vector<int>&,
+ const vector<int>&, const vector<int>&));
+ MOCK_CONST_METHOD1(GetGapOrder, vector<int>(const vector<pair<int, int> >&));
+ MOCK_CONST_METHOD3(GetSourceIndexes, Indexes(const vector<int>&,
+ const vector<int>&, int));
+
+ // We need to implement these methods, because Google Mock doesn't support
+ // methods with more than 10 arguments.
+ bool FindFixPoint(
+ int, int, const vector<int>&, const vector<int>&, int& target_phrase_low,
+ int& target_phrase_high, const vector<int>&, const vector<int>&,
+ int& source_back_low, int& source_back_high, int, int, int, int, bool,
+ bool, bool) const {
+ target_phrase_low = this->target_phrase_low;
+ target_phrase_high = this->target_phrase_high;
+ source_back_low = this->source_back_low;
+ source_back_high = this->source_back_high;
+ return find_fix_point;
+ }
+
+ bool GetGaps(vector<pair<int, int> >& source_gaps,
+ vector<pair<int, int> >& target_gaps,
+ const vector<int>&, const vector<int>&, const vector<int>&,
+ const vector<int>&, const vector<int>&, const vector<int>&,
+ int, int, int, int, int& num_symbols,
+ bool& met_constraints) const {
+ source_gaps = this->source_gaps;
+ target_gaps = this->target_gaps;
+ num_symbols = this->num_symbols;
+ met_constraints = this->met_constraints;
+ return get_gaps;
+ }
+
+ void SetUp(
+ int target_phrase_low, int target_phrase_high, int source_back_low,
+ int source_back_high, bool find_fix_point,
+ vector<pair<int, int> > source_gaps, vector<pair<int, int> > target_gaps,
+ int num_symbols, bool met_constraints, bool get_gaps) {
+ this->target_phrase_low = target_phrase_low;
+ this->target_phrase_high = target_phrase_high;
+ this->source_back_low = source_back_low;
+ this->source_back_high = source_back_high;
+ this->find_fix_point = find_fix_point;
+ this->source_gaps = source_gaps;
+ this->target_gaps = target_gaps;
+ this->num_symbols = num_symbols;
+ this->met_constraints = met_constraints;
+ this->get_gaps = get_gaps;
+ }
+
+ private:
+ int target_phrase_low;
+ int target_phrase_high;
+ int source_back_low;
+ int source_back_high;
+ bool find_fix_point;
+ vector<pair<int, int> > source_gaps;
+ vector<pair<int, int> > target_gaps;
+ int num_symbols;
+ bool met_constraints;
+ bool get_gaps;
+};
diff --git a/extractor/mocks/mock_rule_factory.h b/extractor/mocks/mock_rule_factory.h
new file mode 100644
index 00000000..2a96be93
--- /dev/null
+++ b/extractor/mocks/mock_rule_factory.h
@@ -0,0 +1,9 @@
+#include <gmock/gmock.h>
+
+#include "../grammar.h"
+#include "../rule_factory.h"
+
+class MockHieroCachingRuleFactory : public HieroCachingRuleFactory {
+ public:
+ MOCK_METHOD1(GetGrammar, Grammar(const vector<int>& word_ids));
+};
diff --git a/extractor/mocks/mock_sampler.h b/extractor/mocks/mock_sampler.h
new file mode 100644
index 00000000..b2306109
--- /dev/null
+++ b/extractor/mocks/mock_sampler.h
@@ -0,0 +1,9 @@
+#include <gmock/gmock.h>
+
+#include "../phrase_location.h"
+#include "../sampler.h"
+
+class MockSampler : public Sampler {
+ public:
+ MOCK_CONST_METHOD1(Sample, PhraseLocation(const PhraseLocation& location));
+};
diff --git a/extractor/mocks/mock_scorer.h b/extractor/mocks/mock_scorer.h
new file mode 100644
index 00000000..48115ef4
--- /dev/null
+++ b/extractor/mocks/mock_scorer.h
@@ -0,0 +1,10 @@
+#include <gmock/gmock.h>
+
+#include "../scorer.h"
+#include "../features/feature.h"
+
+class MockScorer : public Scorer {
+ public:
+ MOCK_CONST_METHOD1(Score, vector<double>(const FeatureContext& context));
+ MOCK_CONST_METHOD0(GetFeatureNames, vector<string>());
+};
diff --git a/extractor/mocks/mock_suffix_array.h b/extractor/mocks/mock_suffix_array.h
new file mode 100644
index 00000000..11a3a443
--- /dev/null
+++ b/extractor/mocks/mock_suffix_array.h
@@ -0,0 +1,19 @@
+#include <gmock/gmock.h>
+
+#include <memory>
+#include <string>
+
+#include "../data_array.h"
+#include "../phrase_location.h"
+#include "../suffix_array.h"
+
+using namespace std;
+
+class MockSuffixArray : public SuffixArray {
+ public:
+ MOCK_CONST_METHOD0(GetSize, int());
+ MOCK_CONST_METHOD0(GetData, shared_ptr<DataArray>());
+ MOCK_CONST_METHOD0(BuildLCPArray, vector<int>());
+ MOCK_CONST_METHOD1(GetSuffix, int(int));
+ MOCK_CONST_METHOD4(Lookup, PhraseLocation(int, int, const string& word, int));
+};
diff --git a/extractor/mocks/mock_target_phrase_extractor.h b/extractor/mocks/mock_target_phrase_extractor.h
new file mode 100644
index 00000000..6dc6bba6
--- /dev/null
+++ b/extractor/mocks/mock_target_phrase_extractor.h
@@ -0,0 +1,12 @@
+#include <gmock/gmock.h>
+
+#include "../target_phrase_extractor.h"
+
+typedef pair<Phrase, PhraseAlignment> PhraseExtract;
+
+class MockTargetPhraseExtractor : public TargetPhraseExtractor {
+ public:
+ MOCK_CONST_METHOD6(ExtractPhrases, vector<PhraseExtract>(
+ const vector<pair<int, int> > &, const vector<int>&, int, int,
+ const unordered_map<int, int>&, int));
+};
diff --git a/extractor/mocks/mock_translation_table.h b/extractor/mocks/mock_translation_table.h
new file mode 100644
index 00000000..a35c9327
--- /dev/null
+++ b/extractor/mocks/mock_translation_table.h
@@ -0,0 +1,9 @@
+#include <gmock/gmock.h>
+
+#include "../translation_table.h"
+
+class MockTranslationTable : public TranslationTable {
+ public:
+ MOCK_METHOD2(GetSourceGivenTargetScore, double(const string&, const string&));
+ MOCK_METHOD2(GetTargetGivenSourceScore, double(const string&, const string&));
+};
diff --git a/extractor/mocks/mock_vocabulary.h b/extractor/mocks/mock_vocabulary.h
new file mode 100644
index 00000000..e5c191f5
--- /dev/null
+++ b/extractor/mocks/mock_vocabulary.h
@@ -0,0 +1,9 @@
+#include <gmock/gmock.h>
+
+#include "../vocabulary.h"
+
+class MockVocabulary : public Vocabulary {
+ public:
+ MOCK_METHOD1(GetTerminalValue, string(int word_id));
+ MOCK_METHOD1(GetTerminalIndex, int(const string& word));
+};
diff --git a/extractor/phrase.cc b/extractor/phrase.cc
new file mode 100644
index 00000000..6dc242db
--- /dev/null
+++ b/extractor/phrase.cc
@@ -0,0 +1,54 @@
+#include "phrase.h"
+
+int Phrase::Arity() const {
+ return var_pos.size();
+}
+
+int Phrase::GetChunkLen(int index) const {
+ if (var_pos.size() == 0) {
+ return symbols.size();
+ } else if (index == 0) {
+ return var_pos[0];
+ } else if (index == var_pos.size()) {
+ return symbols.size() - var_pos.back() - 1;
+ } else {
+ return var_pos[index] - var_pos[index - 1] - 1;
+ }
+}
+
+vector<int> Phrase::Get() const {
+ return symbols;
+}
+
+int Phrase::GetSymbol(int position) const {
+ return symbols[position];
+}
+
+int Phrase::GetNumSymbols() const {
+ return symbols.size();
+}
+
+vector<string> Phrase::GetWords() const {
+ return words;
+}
+
+int Phrase::operator<(const Phrase& other) const {
+ return symbols < other.symbols;
+}
+
+ostream& operator<<(ostream& os, const Phrase& phrase) {
+ int current_word = 0;
+ for (size_t i = 0; i < phrase.symbols.size(); ++i) {
+ if (phrase.symbols[i] < 0) {
+ os << "[X," << -phrase.symbols[i] << "]";
+ } else {
+ os << phrase.words[current_word];
+ ++current_word;
+ }
+
+ if (i + 1 < phrase.symbols.size()) {
+ os << " ";
+ }
+ }
+ return os;
+}
diff --git a/extractor/phrase.h b/extractor/phrase.h
new file mode 100644
index 00000000..f40a8169
--- /dev/null
+++ b/extractor/phrase.h
@@ -0,0 +1,41 @@
+#ifndef _PHRASE_H_
+#define _PHRASE_H_
+
+#include <iostream>
+#include <string>
+#include <vector>
+
+#include "phrase_builder.h"
+
+using namespace std;
+
+class Phrase {
+ public:
+ friend Phrase PhraseBuilder::Build(const vector<int>& phrase);
+
+ int Arity() const;
+
+ int GetChunkLen(int index) const;
+
+ vector<int> Get() const;
+
+ int GetSymbol(int position) const;
+
+ //TODO(pauldb): Unit test this method.
+ int GetNumSymbols() const;
+
+ //TODO(pauldb): Add unit tests.
+ vector<string> GetWords() const;
+
+ //TODO(pauldb): Add unit tests.
+ int operator<(const Phrase& other) const;
+
+ friend ostream& operator<<(ostream& os, const Phrase& phrase);
+
+ private:
+ vector<int> symbols;
+ vector<int> var_pos;
+ vector<string> words;
+};
+
+#endif
diff --git a/extractor/phrase_builder.cc b/extractor/phrase_builder.cc
new file mode 100644
index 00000000..4325390c
--- /dev/null
+++ b/extractor/phrase_builder.cc
@@ -0,0 +1,44 @@
+#include "phrase_builder.h"
+
+#include "phrase.h"
+#include "vocabulary.h"
+
+PhraseBuilder::PhraseBuilder(shared_ptr<Vocabulary> vocabulary) :
+ vocabulary(vocabulary) {}
+
+Phrase PhraseBuilder::Build(const vector<int>& symbols) {
+ Phrase phrase;
+ phrase.symbols = symbols;
+ for (size_t i = 0; i < symbols.size(); ++i) {
+ if (vocabulary->IsTerminal(symbols[i])) {
+ phrase.words.push_back(vocabulary->GetTerminalValue(symbols[i]));
+ } else {
+ phrase.var_pos.push_back(i);
+ }
+ }
+ return phrase;
+}
+
+Phrase PhraseBuilder::Extend(const Phrase& phrase, bool start_x, bool end_x) {
+ vector<int> symbols = phrase.Get();
+ int num_nonterminals = 0;
+ if (start_x) {
+ num_nonterminals = 1;
+ symbols.insert(symbols.begin(),
+ vocabulary->GetNonterminalIndex(num_nonterminals));
+ }
+
+ for (size_t i = start_x; i < symbols.size(); ++i) {
+ if (!vocabulary->IsTerminal(symbols[i])) {
+ ++num_nonterminals;
+ symbols[i] = vocabulary->GetNonterminalIndex(num_nonterminals);
+ }
+ }
+
+ if (end_x) {
+ ++num_nonterminals;
+ symbols.push_back(vocabulary->GetNonterminalIndex(num_nonterminals));
+ }
+
+ return Build(symbols);
+}
diff --git a/extractor/phrase_builder.h b/extractor/phrase_builder.h
new file mode 100644
index 00000000..a49af457
--- /dev/null
+++ b/extractor/phrase_builder.h
@@ -0,0 +1,24 @@
+#ifndef _PHRASE_BUILDER_H_
+#define _PHRASE_BUILDER_H_
+
+#include <memory>
+#include <vector>
+
+using namespace std;
+
+class Phrase;
+class Vocabulary;
+
+class PhraseBuilder {
+ public:
+ PhraseBuilder(shared_ptr<Vocabulary> vocabulary);
+
+ Phrase Build(const vector<int>& symbols);
+
+ Phrase Extend(const Phrase& phrase, bool start_x, bool end_x);
+
+ private:
+ shared_ptr<Vocabulary> vocabulary;
+};
+
+#endif
diff --git a/extractor/phrase_location.cc b/extractor/phrase_location.cc
new file mode 100644
index 00000000..b0bfed80
--- /dev/null
+++ b/extractor/phrase_location.cc
@@ -0,0 +1,39 @@
+#include "phrase_location.h"
+
+PhraseLocation::PhraseLocation(int sa_low, int sa_high) :
+ sa_low(sa_low), sa_high(sa_high), num_subpatterns(0) {}
+
+PhraseLocation::PhraseLocation(const vector<int>& matchings,
+ int num_subpatterns) :
+ sa_low(0), sa_high(0),
+ matchings(make_shared<vector<int> >(matchings)),
+ num_subpatterns(num_subpatterns) {}
+
+bool PhraseLocation::IsEmpty() const {
+ return GetSize() == 0;
+}
+
+int PhraseLocation::GetSize() const {
+ if (num_subpatterns > 0) {
+ return matchings->size();
+ } else {
+ return sa_high - sa_low;
+ }
+}
+
+bool operator==(const PhraseLocation& a, const PhraseLocation& b) {
+ if (a.sa_low != b.sa_low || a.sa_high != b.sa_high ||
+ a.num_subpatterns != b.num_subpatterns) {
+ return false;
+ }
+
+ if (a.matchings == NULL && b.matchings == NULL) {
+ return true;
+ }
+
+ if (a.matchings == NULL || b.matchings == NULL) {
+ return false;
+ }
+
+ return *a.matchings == *b.matchings;
+}
diff --git a/extractor/phrase_location.h b/extractor/phrase_location.h
new file mode 100644
index 00000000..a0eb36c8
--- /dev/null
+++ b/extractor/phrase_location.h
@@ -0,0 +1,25 @@
+#ifndef _PHRASE_LOCATION_H_
+#define _PHRASE_LOCATION_H_
+
+#include <memory>
+#include <vector>
+
+using namespace std;
+
+struct PhraseLocation {
+ PhraseLocation(int sa_low = -1, int sa_high = -1);
+
+ PhraseLocation(const vector<int>& matchings, int num_subpatterns);
+
+ bool IsEmpty() const;
+
+ int GetSize() const;
+
+ friend bool operator==(const PhraseLocation& a, const PhraseLocation& b);
+
+ int sa_low, sa_high;
+ shared_ptr<vector<int> > matchings;
+ int num_subpatterns;
+};
+
+#endif
diff --git a/extractor/phrase_test.cc b/extractor/phrase_test.cc
new file mode 100644
index 00000000..2b553b6f
--- /dev/null
+++ b/extractor/phrase_test.cc
@@ -0,0 +1,61 @@
+#include <gtest/gtest.h>
+
+#include <memory>
+#include <vector>
+
+#include "mocks/mock_vocabulary.h"
+#include "phrase.h"
+#include "phrase_builder.h"
+
+using namespace std;
+using namespace ::testing;
+
+namespace {
+
+class PhraseTest : public Test {
+ protected:
+ virtual void SetUp() {
+ shared_ptr<MockVocabulary> vocabulary = make_shared<MockVocabulary>();
+ EXPECT_CALL(*vocabulary, GetTerminalValue(_))
+ .WillRepeatedly(Return("word"));
+ shared_ptr<PhraseBuilder> phrase_builder =
+ make_shared<PhraseBuilder>(vocabulary);
+
+ symbols1 = vector<int>{1, 2, 3};
+ phrase1 = phrase_builder->Build(symbols1);
+ symbols2 = vector<int>{1, 2, -1, 3, -2, 4};
+ phrase2 = phrase_builder->Build(symbols2);
+ }
+
+ vector<int> symbols1, symbols2;
+ Phrase phrase1, phrase2;
+};
+
+TEST_F(PhraseTest, TestArity) {
+ EXPECT_EQ(0, phrase1.Arity());
+ EXPECT_EQ(2, phrase2.Arity());
+}
+
+TEST_F(PhraseTest, GetChunkLen) {
+ EXPECT_EQ(3, phrase1.GetChunkLen(0));
+
+ EXPECT_EQ(2, phrase2.GetChunkLen(0));
+ EXPECT_EQ(1, phrase2.GetChunkLen(1));
+ EXPECT_EQ(1, phrase2.GetChunkLen(2));
+}
+
+TEST_F(PhraseTest, TestGet) {
+ EXPECT_EQ(symbols1, phrase1.Get());
+ EXPECT_EQ(symbols2, phrase2.Get());
+}
+
+TEST_F(PhraseTest, TestGetSymbol) {
+ for (size_t i = 0; i < symbols1.size(); ++i) {
+ EXPECT_EQ(symbols1[i], phrase1.GetSymbol(i));
+ }
+ for (size_t i = 0; i < symbols2.size(); ++i) {
+ EXPECT_EQ(symbols2[i], phrase2.GetSymbol(i));
+ }
+}
+
+} // namespace
diff --git a/extractor/precomputation.cc b/extractor/precomputation.cc
new file mode 100644
index 00000000..8a76beb1
--- /dev/null
+++ b/extractor/precomputation.cc
@@ -0,0 +1,192 @@
+#include "precomputation.h"
+
+#include <iostream>
+#include <queue>
+
+#include "data_array.h"
+#include "suffix_array.h"
+
+using namespace std;
+
+int Precomputation::NON_TERMINAL = -1;
+
+Precomputation::Precomputation(
+ shared_ptr<SuffixArray> suffix_array, int num_frequent_patterns,
+ int num_super_frequent_patterns, int max_rule_span,
+ int max_rule_symbols, int min_gap_size,
+ int max_frequent_phrase_len, int min_frequency) {
+ vector<int> data = suffix_array->GetData()->GetData();
+ vector<vector<int> > frequent_patterns = FindMostFrequentPatterns(
+ suffix_array, data, num_frequent_patterns, max_frequent_phrase_len,
+ min_frequency);
+
+ unordered_set<vector<int>, VectorHash> frequent_patterns_set;
+ unordered_set<vector<int>, VectorHash> super_frequent_patterns_set;
+ for (size_t i = 0; i < frequent_patterns.size(); ++i) {
+ frequent_patterns_set.insert(frequent_patterns[i]);
+ if (i < num_super_frequent_patterns) {
+ super_frequent_patterns_set.insert(frequent_patterns[i]);
+ }
+ }
+
+ vector<tuple<int, int, int> > matchings;
+ for (size_t i = 0; i < data.size(); ++i) {
+ if (data[i] == DataArray::END_OF_LINE) {
+ AddCollocations(matchings, data, max_rule_span, min_gap_size,
+ max_rule_symbols);
+ matchings.clear();
+ continue;
+ }
+ vector<int> pattern;
+ for (int j = 1; j <= max_frequent_phrase_len && i + j <= data.size(); ++j) {
+ pattern.push_back(data[i + j - 1]);
+ if (frequent_patterns_set.count(pattern)) {
+ inverted_index[pattern].push_back(i);
+ int is_super_frequent = super_frequent_patterns_set.count(pattern);
+ matchings.push_back(make_tuple(i, j, is_super_frequent));
+ } else {
+ // If the current pattern is not frequent, any longer pattern having the
+ // current pattern as prefix will not be frequent.
+ break;
+ }
+ }
+ }
+}
+
+Precomputation::Precomputation() {}
+
+Precomputation::~Precomputation() {}
+
+vector<vector<int> > Precomputation::FindMostFrequentPatterns(
+ shared_ptr<SuffixArray> suffix_array, const vector<int>& data,
+ int num_frequent_patterns, int max_frequent_phrase_len, int min_frequency) {
+ vector<int> lcp = suffix_array->BuildLCPArray();
+ vector<int> run_start(max_frequent_phrase_len);
+
+ priority_queue<pair<int, pair<int, int> > > heap;
+ for (size_t i = 1; i < lcp.size(); ++i) {
+ for (int len = lcp[i]; len < max_frequent_phrase_len; ++len) {
+ int frequency = i - run_start[len];
+ // TODO(pauldb): Only add patterns that don't span across multiple
+ // sentences.
+ if (frequency >= min_frequency) {
+ heap.push(make_pair(frequency,
+ make_pair(suffix_array->GetSuffix(run_start[len]), len + 1)));
+ }
+ run_start[len] = i;
+ }
+ }
+
+ vector<vector<int> > frequent_patterns;
+ while (frequent_patterns.size() < num_frequent_patterns && !heap.empty()) {
+ int start = heap.top().second.first;
+ int len = heap.top().second.second;
+ heap.pop();
+
+ vector<int> pattern(data.begin() + start, data.begin() + start + len);
+ if (find(pattern.begin(), pattern.end(), DataArray::END_OF_LINE) ==
+ pattern.end()) {
+ frequent_patterns.push_back(pattern);
+ }
+ }
+ return frequent_patterns;
+}
+
+void Precomputation::AddCollocations(
+ const vector<tuple<int, int, int> >& matchings, const vector<int>& data,
+ int max_rule_span, int min_gap_size, int max_rule_symbols) {
+ for (size_t i = 0; i < matchings.size(); ++i) {
+ int start1, size1, is_super1;
+ tie(start1, size1, is_super1) = matchings[i];
+
+ for (size_t j = i + 1; j < matchings.size(); ++j) {
+ int start2, size2, is_super2;
+ tie(start2, size2, is_super2) = matchings[j];
+ if (start2 - start1 >= max_rule_span) {
+ break;
+ }
+
+ if (start2 - start1 - size1 >= min_gap_size
+ && start2 + size2 - start1 <= max_rule_span
+ && size1 + size2 + 1 <= max_rule_symbols) {
+ vector<int> pattern(data.begin() + start1,
+ data.begin() + start1 + size1);
+ pattern.push_back(Precomputation::NON_TERMINAL);
+ pattern.insert(pattern.end(), data.begin() + start2,
+ data.begin() + start2 + size2);
+ AddStartPositions(collocations[pattern], start1, start2);
+
+ if (is_super2) {
+ pattern.push_back(Precomputation::NON_TERMINAL);
+ for (size_t k = j + 1; k < matchings.size(); ++k) {
+ int start3, size3, is_super3;
+ tie(start3, size3, is_super3) = matchings[k];
+ if (start3 - start1 >= max_rule_span) {
+ break;
+ }
+
+ if (start3 - start2 - size2 >= min_gap_size
+ && start3 + size3 - start1 <= max_rule_span
+ && size1 + size2 + size3 + 2 <= max_rule_symbols
+ && (is_super1 || is_super3)) {
+ pattern.insert(pattern.end(), data.begin() + start3,
+ data.begin() + start3 + size3);
+ AddStartPositions(collocations[pattern], start1, start2, start3);
+ pattern.erase(pattern.end() - size3);
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+void Precomputation::AddStartPositions(
+ vector<int>& positions, int pos1, int pos2) {
+ positions.push_back(pos1);
+ positions.push_back(pos2);
+}
+
+void Precomputation::AddStartPositions(
+ vector<int>& positions, int pos1, int pos2, int pos3) {
+ positions.push_back(pos1);
+ positions.push_back(pos2);
+ positions.push_back(pos3);
+}
+
+void Precomputation::WriteBinary(const fs::path& filepath) const {
+ FILE* file = fopen(filepath.string().c_str(), "w");
+
+ // TODO(pauldb): Refactor this code.
+ int size = inverted_index.size();
+ fwrite(&size, sizeof(int), 1, file);
+ for (auto entry: inverted_index) {
+ size = entry.first.size();
+ fwrite(&size, sizeof(int), 1, file);
+ fwrite(entry.first.data(), sizeof(int), size, file);
+
+ size = entry.second.size();
+ fwrite(&size, sizeof(int), 1, file);
+ fwrite(entry.second.data(), sizeof(int), size, file);
+ }
+
+ size = collocations.size();
+ fwrite(&size, sizeof(int), 1, file);
+ for (auto entry: collocations) {
+ size = entry.first.size();
+ fwrite(&size, sizeof(int), 1, file);
+ fwrite(entry.first.data(), sizeof(int), size, file);
+
+ size = entry.second.size();
+ fwrite(&size, sizeof(int), 1, file);
+ fwrite(entry.second.data(), sizeof(int), size, file);
+ }
+}
+
+const Index& Precomputation::GetInvertedIndex() const {
+ return inverted_index;
+}
+
+const Index& Precomputation::GetCollocations() const {
+ return collocations;
+}
diff --git a/extractor/precomputation.h b/extractor/precomputation.h
new file mode 100644
index 00000000..28426bfa
--- /dev/null
+++ b/extractor/precomputation.h
@@ -0,0 +1,56 @@
+#ifndef _PRECOMPUTATION_H_
+#define _PRECOMPUTATION_H_
+
+#include <memory>
+#include <unordered_map>
+#include <unordered_set>
+#include <tuple>
+#include <vector>
+
+#include <boost/filesystem.hpp>
+#include <boost/functional/hash.hpp>
+
+namespace fs = boost::filesystem;
+using namespace std;
+
+class SuffixArray;
+
+typedef boost::hash<vector<int> > VectorHash;
+typedef unordered_map<vector<int>, vector<int>, VectorHash> Index;
+
+class Precomputation {
+ public:
+ Precomputation(
+ shared_ptr<SuffixArray> suffix_array, int num_frequent_patterns,
+ int num_super_frequent_patterns, int max_rule_span,
+ int max_rule_symbols, int min_gap_size,
+ int max_frequent_phrase_len, int min_frequency);
+
+ virtual ~Precomputation();
+
+ void WriteBinary(const fs::path& filepath) const;
+
+ virtual const Index& GetInvertedIndex() const;
+ virtual const Index& GetCollocations() const;
+
+ static int NON_TERMINAL;
+
+ protected:
+ Precomputation();
+
+ private:
+ vector<vector<int> > FindMostFrequentPatterns(
+ shared_ptr<SuffixArray> suffix_array, const vector<int>& data,
+ int num_frequent_patterns, int max_frequent_phrase_len,
+ int min_frequency);
+ void AddCollocations(
+ const vector<std::tuple<int, int, int> >& matchings, const vector<int>& data,
+ int max_rule_span, int min_gap_size, int max_rule_symbols);
+ void AddStartPositions(vector<int>& positions, int pos1, int pos2);
+ void AddStartPositions(vector<int>& positions, int pos1, int pos2, int pos3);
+
+ Index inverted_index;
+ Index collocations;
+};
+
+#endif
diff --git a/extractor/precomputation_test.cc b/extractor/precomputation_test.cc
new file mode 100644
index 00000000..9edb29db
--- /dev/null
+++ b/extractor/precomputation_test.cc
@@ -0,0 +1,138 @@
+#include <gtest/gtest.h>
+
+#include <memory>
+#include <vector>
+
+#include "mocks/mock_data_array.h"
+#include "mocks/mock_suffix_array.h"
+#include "precomputation.h"
+
+using namespace std;
+using namespace ::testing;
+
+namespace {
+
+class PrecomputationTest : public Test {
+ protected:
+ virtual void SetUp() {
+ data = {4, 2, 3, 5, 7, 2, 3, 5, 2, 3, 4, 2, 1};
+ data_array = make_shared<MockDataArray>();
+ EXPECT_CALL(*data_array, GetData()).WillRepeatedly(ReturnRef(data));
+
+ vector<int> suffixes{12, 8, 5, 1, 9, 6, 2, 0, 10, 7, 3, 4, 13};
+ vector<int> lcp{-1, 0, 2, 3, 1, 0, 1, 2, 0, 2, 0, 1, 0, 0};
+ suffix_array = make_shared<MockSuffixArray>();
+ EXPECT_CALL(*suffix_array, GetData()).WillRepeatedly(Return(data_array));
+ for (size_t i = 0; i < suffixes.size(); ++i) {
+ EXPECT_CALL(*suffix_array,
+ GetSuffix(i)).WillRepeatedly(Return(suffixes[i]));
+ }
+ EXPECT_CALL(*suffix_array, BuildLCPArray()).WillRepeatedly(Return(lcp));
+ }
+
+ vector<int> data;
+ shared_ptr<MockDataArray> data_array;
+ shared_ptr<MockSuffixArray> suffix_array;
+};
+
+TEST_F(PrecomputationTest, TestInvertedIndex) {
+ Precomputation precomputation(suffix_array, 100, 3, 10, 5, 1, 4, 2);
+ Index inverted_index = precomputation.GetInvertedIndex();
+
+ EXPECT_EQ(8, inverted_index.size());
+ vector<int> key = {2};
+ vector<int> expected_value = {1, 5, 8, 11};
+ EXPECT_EQ(expected_value, inverted_index[key]);
+ key = {3};
+ expected_value = {2, 6, 9};
+ EXPECT_EQ(expected_value, inverted_index[key]);
+ key = {4};
+ expected_value = {0, 10};
+ EXPECT_EQ(expected_value, inverted_index[key]);
+ key = {5};
+ expected_value = {3, 7};
+ EXPECT_EQ(expected_value, inverted_index[key]);
+ key = {4, 2};
+ expected_value = {0, 10};
+ EXPECT_EQ(expected_value, inverted_index[key]);
+ key = {2, 3};
+ expected_value = {1, 5, 8};
+ EXPECT_EQ(expected_value, inverted_index[key]);
+ key = {3, 5};
+ expected_value = {2, 6};
+ EXPECT_EQ(expected_value, inverted_index[key]);
+ key = {2, 3, 5};
+ expected_value = {1, 5};
+ EXPECT_EQ(expected_value, inverted_index[key]);
+
+ key = {2, 4};
+ EXPECT_EQ(0, inverted_index.count(key));
+}
+
+TEST_F(PrecomputationTest, TestCollocations) {
+ Precomputation precomputation(suffix_array, 3, 3, 10, 5, 1, 4, 2);
+ Index collocations = precomputation.GetCollocations();
+
+ EXPECT_EQ(-1, precomputation.NON_TERMINAL);
+ vector<int> key = {2, 3, -1, 2};
+ vector<int> expected_value = {1, 5, 1, 8, 5, 8, 5, 11, 8, 11};
+ EXPECT_EQ(expected_value, collocations[key]);
+ key = {2, 3, -1, 2, 3};
+ expected_value = {1, 5, 1, 8, 5, 8};
+ EXPECT_EQ(expected_value, collocations[key]);
+ key = {2, 3, -1, 3};
+ expected_value = {1, 6, 1, 9, 5, 9};
+ EXPECT_EQ(expected_value, collocations[key]);
+ key = {3, -1, 2};
+ expected_value = {2, 5, 2, 8, 2, 11, 6, 8, 6, 11, 9, 11};
+ EXPECT_EQ(expected_value, collocations[key]);
+ key = {3, -1, 3};
+ expected_value = {2, 6, 2, 9, 6, 9};
+ EXPECT_EQ(expected_value, collocations[key]);
+ key = {3, -1, 2, 3};
+ expected_value = {2, 5, 2, 8, 6, 8};
+ EXPECT_EQ(expected_value, collocations[key]);
+ key = {2, -1, 2};
+ expected_value = {1, 5, 1, 8, 5, 8, 5, 11, 8, 11};
+ EXPECT_EQ(expected_value, collocations[key]);
+ key = {2, -1, 2, 3};
+ expected_value = {1, 5, 1, 8, 5, 8};
+ EXPECT_EQ(expected_value, collocations[key]);
+ key = {2, -1, 3};
+ expected_value = {1, 6, 1, 9, 5, 9};
+ EXPECT_EQ(expected_value, collocations[key]);
+
+ key = {2, -1, 2, -1, 2};
+ expected_value = {1, 5, 8, 5, 8, 11};
+ EXPECT_EQ(expected_value, collocations[key]);
+ key = {2, -1, 2, -1, 3};
+ expected_value = {1, 5, 9};
+ EXPECT_EQ(expected_value, collocations[key]);
+ key = {2, -1, 3, -1, 2};
+ expected_value = {1, 6, 8, 5, 9, 11};
+ EXPECT_EQ(expected_value, collocations[key]);
+ key = {2, -1, 3, -1, 3};
+ expected_value = {1, 6, 9};
+ EXPECT_EQ(expected_value, collocations[key]);
+ key = {3, -1, 2, -1, 2};
+ expected_value = {2, 5, 8, 2, 5, 11, 2, 8, 11, 6, 8, 11};
+ EXPECT_EQ(expected_value, collocations[key]);
+ key = {3, -1, 2, -1, 3};
+ expected_value = {2, 5, 9};
+ EXPECT_EQ(expected_value, collocations[key]);
+ key = {3, -1, 3, -1, 2};
+ expected_value = {2, 6, 8, 2, 6, 11, 2, 9, 11, 6, 9, 11};
+ EXPECT_EQ(expected_value, collocations[key]);
+ key = {3, -1, 3, -1, 3};
+ expected_value = {2, 6, 9};
+ EXPECT_EQ(expected_value, collocations[key]);
+
+ // Exceeds max_rule_symbols.
+ key = {2, -1, 2, -1, 2, 3};
+ EXPECT_EQ(0, collocations.count(key));
+ // Contains non frequent pattern.
+ key = {2, -1, 5};
+ EXPECT_EQ(0, collocations.count(key));
+}
+
+} // namespace
diff --git a/extractor/rule.cc b/extractor/rule.cc
new file mode 100644
index 00000000..9c7ac9b5
--- /dev/null
+++ b/extractor/rule.cc
@@ -0,0 +1,10 @@
+#include "rule.h"
+
+Rule::Rule(const Phrase& source_phrase,
+ const Phrase& target_phrase,
+ const vector<double>& scores,
+ const vector<pair<int, int> >& alignment) :
+ source_phrase(source_phrase),
+ target_phrase(target_phrase),
+ scores(scores),
+ alignment(alignment) {}
diff --git a/extractor/rule.h b/extractor/rule.h
new file mode 100644
index 00000000..64ff8794
--- /dev/null
+++ b/extractor/rule.h
@@ -0,0 +1,20 @@
+#ifndef _RULE_H_
+#define _RULE_H_
+
+#include <vector>
+
+#include "phrase.h"
+
+using namespace std;
+
+struct Rule {
+ Rule(const Phrase& source_phrase, const Phrase& target_phrase,
+ const vector<double>& scores, const vector<pair<int, int> >& alignment);
+
+ Phrase source_phrase;
+ Phrase target_phrase;
+ vector<double> scores;
+ vector<pair<int, int> > alignment;
+};
+
+#endif
diff --git a/extractor/rule_extractor.cc b/extractor/rule_extractor.cc
new file mode 100644
index 00000000..92343241
--- /dev/null
+++ b/extractor/rule_extractor.cc
@@ -0,0 +1,315 @@
+#include "rule_extractor.h"
+
+#include <map>
+
+#include "alignment.h"
+#include "data_array.h"
+#include "features/feature.h"
+#include "phrase_builder.h"
+#include "phrase_location.h"
+#include "rule.h"
+#include "rule_extractor_helper.h"
+#include "scorer.h"
+#include "target_phrase_extractor.h"
+
+using namespace std;
+
+RuleExtractor::RuleExtractor(
+ shared_ptr<DataArray> source_data_array,
+ shared_ptr<DataArray> target_data_array,
+ shared_ptr<Alignment> alignment,
+ shared_ptr<PhraseBuilder> phrase_builder,
+ shared_ptr<Scorer> scorer,
+ shared_ptr<Vocabulary> vocabulary,
+ int max_rule_span,
+ int min_gap_size,
+ int max_nonterminals,
+ int max_rule_symbols,
+ bool require_aligned_terminal,
+ bool require_aligned_chunks,
+ bool require_tight_phrases) :
+ target_data_array(target_data_array),
+ source_data_array(source_data_array),
+ phrase_builder(phrase_builder),
+ scorer(scorer),
+ max_rule_span(max_rule_span),
+ min_gap_size(min_gap_size),
+ max_nonterminals(max_nonterminals),
+ max_rule_symbols(max_rule_symbols),
+ require_tight_phrases(require_tight_phrases) {
+ helper = make_shared<RuleExtractorHelper>(
+ source_data_array, target_data_array, alignment, max_rule_span,
+ max_rule_symbols, require_aligned_terminal, require_aligned_chunks,
+ require_tight_phrases);
+ target_phrase_extractor = make_shared<TargetPhraseExtractor>(
+ target_data_array, alignment, phrase_builder, helper, vocabulary,
+ max_rule_span, require_tight_phrases);
+}
+
+RuleExtractor::RuleExtractor(
+ shared_ptr<DataArray> source_data_array,
+ shared_ptr<PhraseBuilder> phrase_builder,
+ shared_ptr<Scorer> scorer,
+ shared_ptr<TargetPhraseExtractor> target_phrase_extractor,
+ shared_ptr<RuleExtractorHelper> helper,
+ int max_rule_span,
+ int min_gap_size,
+ int max_nonterminals,
+ int max_rule_symbols,
+ bool require_tight_phrases) :
+ source_data_array(source_data_array),
+ phrase_builder(phrase_builder),
+ scorer(scorer),
+ target_phrase_extractor(target_phrase_extractor),
+ helper(helper),
+ max_rule_span(max_rule_span),
+ min_gap_size(min_gap_size),
+ max_nonterminals(max_nonterminals),
+ max_rule_symbols(max_rule_symbols),
+ require_tight_phrases(require_tight_phrases) {}
+
+RuleExtractor::RuleExtractor() {}
+
+RuleExtractor::~RuleExtractor() {}
+
+vector<Rule> RuleExtractor::ExtractRules(const Phrase& phrase,
+ const PhraseLocation& location) const {
+ int num_subpatterns = location.num_subpatterns;
+ vector<int> matchings = *location.matchings;
+
+ map<Phrase, double> source_phrase_counter;
+ map<Phrase, map<Phrase, map<PhraseAlignment, int> > > alignments_counter;
+ for (auto i = matchings.begin(); i != matchings.end(); i += num_subpatterns) {
+ vector<int> matching(i, i + num_subpatterns);
+ vector<Extract> extracts = ExtractAlignments(phrase, matching);
+
+ for (Extract e: extracts) {
+ source_phrase_counter[e.source_phrase] += e.pairs_count;
+ alignments_counter[e.source_phrase][e.target_phrase][e.alignment] += 1;
+ }
+ }
+
+ int num_samples = matchings.size() / num_subpatterns;
+ vector<Rule> rules;
+ for (auto source_phrase_entry: alignments_counter) {
+ Phrase source_phrase = source_phrase_entry.first;
+ for (auto target_phrase_entry: source_phrase_entry.second) {
+ Phrase target_phrase = target_phrase_entry.first;
+
+ int max_locations = 0, num_locations = 0;
+ PhraseAlignment most_frequent_alignment;
+ for (auto alignment_entry: target_phrase_entry.second) {
+ num_locations += alignment_entry.second;
+ if (alignment_entry.second > max_locations) {
+ most_frequent_alignment = alignment_entry.first;
+ max_locations = alignment_entry.second;
+ }
+ }
+
+ FeatureContext context(source_phrase, target_phrase,
+ source_phrase_counter[source_phrase], num_locations, num_samples);
+ vector<double> scores = scorer->Score(context);
+ rules.push_back(Rule(source_phrase, target_phrase, scores,
+ most_frequent_alignment));
+ }
+ }
+ return rules;
+}
+
+vector<Extract> RuleExtractor::ExtractAlignments(
+ const Phrase& phrase, const vector<int>& matching) const {
+ vector<Extract> extracts;
+ int sentence_id = source_data_array->GetSentenceId(matching[0]);
+ int source_sent_start = source_data_array->GetSentenceStart(sentence_id);
+
+ vector<int> source_low, source_high, target_low, target_high;
+ helper->GetLinksSpans(source_low, source_high, target_low, target_high,
+ sentence_id);
+
+ int num_subpatterns = matching.size();
+ vector<int> chunklen(num_subpatterns);
+ for (size_t i = 0; i < num_subpatterns; ++i) {
+ chunklen[i] = phrase.GetChunkLen(i);
+ }
+
+ if (!helper->CheckAlignedTerminals(matching, chunklen, source_low) ||
+ !helper->CheckTightPhrases(matching, chunklen, source_low)) {
+ return extracts;
+ }
+
+ int source_back_low = -1, source_back_high = -1;
+ int source_phrase_low = matching[0] - source_sent_start;
+ int source_phrase_high = matching.back() + chunklen.back() -
+ source_sent_start;
+ int target_phrase_low = -1, target_phrase_high = -1;
+ if (!helper->FindFixPoint(source_phrase_low, source_phrase_high, source_low,
+ source_high, target_phrase_low, target_phrase_high,
+ target_low, target_high, source_back_low,
+ source_back_high, sentence_id, min_gap_size, 0,
+ max_nonterminals - matching.size() + 1, true, true,
+ false)) {
+ return extracts;
+ }
+
+ bool met_constraints = true;
+ int num_symbols = phrase.GetNumSymbols();
+ vector<pair<int, int> > source_gaps, target_gaps;
+ if (!helper->GetGaps(source_gaps, target_gaps, matching, chunklen, source_low,
+ source_high, target_low, target_high, source_phrase_low,
+ source_phrase_high, source_back_low, source_back_high,
+ num_symbols, met_constraints)) {
+ return extracts;
+ }
+
+ bool starts_with_x = source_back_low != source_phrase_low;
+ bool ends_with_x = source_back_high != source_phrase_high;
+ Phrase source_phrase = phrase_builder->Extend(
+ phrase, starts_with_x, ends_with_x);
+ unordered_map<int, int> source_indexes = helper->GetSourceIndexes(
+ matching, chunklen, starts_with_x);
+ if (met_constraints) {
+ AddExtracts(extracts, source_phrase, source_indexes, target_gaps,
+ target_low, target_phrase_low, target_phrase_high, sentence_id);
+ }
+
+ if (source_gaps.size() >= max_nonterminals ||
+ source_phrase.GetNumSymbols() >= max_rule_symbols ||
+ source_back_high - source_back_low + min_gap_size > max_rule_span) {
+ // Cannot add any more nonterminals.
+ return extracts;
+ }
+
+ for (int i = 0; i < 2; ++i) {
+ for (int j = 1 - i; j < 2; ++j) {
+ AddNonterminalExtremities(extracts, matching, chunklen, source_phrase,
+ source_back_low, source_back_high, source_low, source_high,
+ target_low, target_high, target_gaps, sentence_id, starts_with_x,
+ ends_with_x, i, j);
+ }
+ }
+
+ return extracts;
+}
+
+void RuleExtractor::AddExtracts(
+ vector<Extract>& extracts, const Phrase& source_phrase,
+ const unordered_map<int, int>& source_indexes,
+ const vector<pair<int, int> >& target_gaps, const vector<int>& target_low,
+ int target_phrase_low, int target_phrase_high, int sentence_id) const {
+ auto target_phrases = target_phrase_extractor->ExtractPhrases(
+ target_gaps, target_low, target_phrase_low, target_phrase_high,
+ source_indexes, sentence_id);
+
+ if (target_phrases.size() > 0) {
+ double pairs_count = 1.0 / target_phrases.size();
+ for (auto target_phrase: target_phrases) {
+ extracts.push_back(Extract(source_phrase, target_phrase.first,
+ pairs_count, target_phrase.second));
+ }
+ }
+}
+
+void RuleExtractor::AddNonterminalExtremities(
+ vector<Extract>& extracts, const vector<int>& matching,
+ const vector<int>& chunklen, const Phrase& source_phrase,
+ int source_back_low, int source_back_high, const vector<int>& source_low,
+ const vector<int>& source_high, const vector<int>& target_low,
+ const vector<int>& target_high, vector<pair<int, int> > target_gaps,
+ int sentence_id, int starts_with_x, int ends_with_x, int extend_left,
+ int extend_right) const {
+ int source_x_low = source_back_low, source_x_high = source_back_high;
+
+ if (require_tight_phrases) {
+ if (source_low[source_back_low - extend_left] == -1 ||
+ source_low[source_back_high + extend_right - 1] == -1) {
+ return;
+ }
+ }
+
+ if (extend_left) {
+ if (starts_with_x || source_back_low < min_gap_size) {
+ return;
+ }
+
+ source_x_low = source_back_low - min_gap_size;
+ if (require_tight_phrases) {
+ while (source_x_low >= 0 && source_low[source_x_low] == -1) {
+ --source_x_low;
+ }
+ }
+ if (source_x_low < 0) {
+ return;
+ }
+ }
+
+ if (extend_right) {
+ int source_sent_len = source_data_array->GetSentenceLength(sentence_id);
+ if (ends_with_x || source_back_high + min_gap_size > source_sent_len) {
+ return;
+ }
+ source_x_high = source_back_high + min_gap_size;
+ if (require_tight_phrases) {
+ while (source_x_high <= source_sent_len &&
+ source_low[source_x_high - 1] == -1) {
+ ++source_x_high;
+ }
+ }
+
+ if (source_x_high > source_sent_len) {
+ return;
+ }
+ }
+
+ int new_nonterminals = extend_left + extend_right;
+ if (source_x_high - source_x_low > max_rule_span ||
+ target_gaps.size() + new_nonterminals > max_nonterminals ||
+ source_phrase.GetNumSymbols() + new_nonterminals > max_rule_symbols) {
+ return;
+ }
+
+ int target_x_low = -1, target_x_high = -1;
+ if (!helper->FindFixPoint(source_x_low, source_x_high, source_low,
+ source_high, target_x_low, target_x_high,
+ target_low, target_high, source_x_low,
+ source_x_high, sentence_id, 1, 1,
+ new_nonterminals, extend_left, extend_right,
+ true)) {
+ return;
+ }
+
+ if (extend_left) {
+ int source_gap_low = -1, source_gap_high = -1;
+ int target_gap_low = -1, target_gap_high = -1;
+ if ((require_tight_phrases && source_low[source_x_low] == -1) ||
+ !helper->FindFixPoint(source_x_low, source_back_low, source_low,
+ source_high, target_gap_low, target_gap_high,
+ target_low, target_high, source_gap_low,
+ source_gap_high, sentence_id, 0, 0, 0, false,
+ false, false)) {
+ return;
+ }
+ target_gaps.insert(target_gaps.begin(),
+ make_pair(target_gap_low, target_gap_high));
+ }
+
+ if (extend_right) {
+ int target_gap_low = -1, target_gap_high = -1;
+ int source_gap_low = -1, source_gap_high = -1;
+ if ((require_tight_phrases && source_low[source_x_high - 1] == -1) ||
+ !helper->FindFixPoint(source_back_high, source_x_high, source_low,
+ source_high, target_gap_low, target_gap_high,
+ target_low, target_high, source_gap_low,
+ source_gap_high, sentence_id, 0, 0, 0, false,
+ false, false)) {
+ return;
+ }
+ target_gaps.push_back(make_pair(target_gap_low, target_gap_high));
+ }
+
+ Phrase new_source_phrase = phrase_builder->Extend(source_phrase, extend_left,
+ extend_right);
+ unordered_map<int, int> source_indexes = helper->GetSourceIndexes(
+ matching, chunklen, extend_left || starts_with_x);
+ AddExtracts(extracts, new_source_phrase, source_indexes, target_gaps,
+ target_low, target_x_low, target_x_high, sentence_id);
+}
diff --git a/extractor/rule_extractor.h b/extractor/rule_extractor.h
new file mode 100644
index 00000000..a087dc6d
--- /dev/null
+++ b/extractor/rule_extractor.h
@@ -0,0 +1,104 @@
+#ifndef _RULE_EXTRACTOR_H_
+#define _RULE_EXTRACTOR_H_
+
+#include <memory>
+#include <unordered_map>
+#include <vector>
+
+#include "phrase.h"
+
+using namespace std;
+
+class Alignment;
+class DataArray;
+class PhraseBuilder;
+class PhraseLocation;
+class Rule;
+class RuleExtractorHelper;
+class Scorer;
+class TargetPhraseExtractor;
+
+typedef vector<pair<int, int> > PhraseAlignment;
+
+struct Extract {
+ Extract(const Phrase& source_phrase, const Phrase& target_phrase,
+ double pairs_count, const PhraseAlignment& alignment) :
+ source_phrase(source_phrase), target_phrase(target_phrase),
+ pairs_count(pairs_count), alignment(alignment) {}
+
+ Phrase source_phrase;
+ Phrase target_phrase;
+ double pairs_count;
+ PhraseAlignment alignment;
+};
+
+class RuleExtractor {
+ public:
+ RuleExtractor(shared_ptr<DataArray> source_data_array,
+ shared_ptr<DataArray> target_data_array,
+ shared_ptr<Alignment> alingment,
+ shared_ptr<PhraseBuilder> phrase_builder,
+ shared_ptr<Scorer> scorer,
+ shared_ptr<Vocabulary> vocabulary,
+ int min_gap_size,
+ int max_rule_span,
+ int max_nonterminals,
+ int max_rule_symbols,
+ bool require_aligned_terminal,
+ bool require_aligned_chunks,
+ bool require_tight_phrases);
+
+ // For testing only.
+ RuleExtractor(shared_ptr<DataArray> source_data_array,
+ shared_ptr<PhraseBuilder> phrase_builder,
+ shared_ptr<Scorer> scorer,
+ shared_ptr<TargetPhraseExtractor> target_phrase_extractor,
+ shared_ptr<RuleExtractorHelper> helper,
+ int max_rule_span,
+ int min_gap_size,
+ int max_nonterminals,
+ int max_rule_symbols,
+ bool require_tight_phrases);
+
+ virtual ~RuleExtractor();
+
+ virtual vector<Rule> ExtractRules(const Phrase& phrase,
+ const PhraseLocation& location) const;
+
+ protected:
+ RuleExtractor();
+
+ private:
+ vector<Extract> ExtractAlignments(const Phrase& phrase,
+ const vector<int>& matching) const;
+
+ void AddExtracts(
+ vector<Extract>& extracts, const Phrase& source_phrase,
+ const unordered_map<int, int>& source_indexes,
+ const vector<pair<int, int> >& target_gaps, const vector<int>& target_low,
+ int target_phrase_low, int target_phrase_high, int sentence_id) const;
+
+ void AddNonterminalExtremities(
+ vector<Extract>& extracts, const vector<int>& matching,
+ const vector<int>& chunklen, const Phrase& source_phrase,
+ int source_back_low, int source_back_high, const vector<int>& source_low,
+ const vector<int>& source_high, const vector<int>& target_low,
+ const vector<int>& target_high, vector<pair<int, int> > target_gaps,
+ int sentence_id, int starts_with_x, int ends_with_x, int extend_left,
+ int extend_right) const;
+
+ private:
+ shared_ptr<DataArray> target_data_array;
+ shared_ptr<DataArray> source_data_array;
+ shared_ptr<PhraseBuilder> phrase_builder;
+ shared_ptr<Scorer> scorer;
+ shared_ptr<TargetPhraseExtractor> target_phrase_extractor;
+ shared_ptr<RuleExtractorHelper> helper;
+ int max_rule_span;
+ int min_gap_size;
+ int max_nonterminals;
+ int max_rule_symbols;
+ bool require_tight_phrases;
+};
+
+#endif
diff --git a/extractor/rule_extractor_helper.cc b/extractor/rule_extractor_helper.cc
new file mode 100644
index 00000000..ed6ae3a1
--- /dev/null
+++ b/extractor/rule_extractor_helper.cc
@@ -0,0 +1,356 @@
+#include "rule_extractor_helper.h"
+
+#include "data_array.h"
+#include "alignment.h"
+
+RuleExtractorHelper::RuleExtractorHelper(
+ shared_ptr<DataArray> source_data_array,
+ shared_ptr<DataArray> target_data_array,
+ shared_ptr<Alignment> alignment,
+ int max_rule_span,
+ int max_rule_symbols,
+ bool require_aligned_terminal,
+ bool require_aligned_chunks,
+ bool require_tight_phrases) :
+ source_data_array(source_data_array),
+ target_data_array(target_data_array),
+ alignment(alignment),
+ max_rule_span(max_rule_span),
+ max_rule_symbols(max_rule_symbols),
+ require_aligned_terminal(require_aligned_terminal),
+ require_aligned_chunks(require_aligned_chunks),
+ require_tight_phrases(require_tight_phrases) {}
+
+RuleExtractorHelper::RuleExtractorHelper() {}
+
+RuleExtractorHelper::~RuleExtractorHelper() {}
+
+void RuleExtractorHelper::GetLinksSpans(
+ vector<int>& source_low, vector<int>& source_high,
+ vector<int>& target_low, vector<int>& target_high, int sentence_id) const {
+ int source_sent_len = source_data_array->GetSentenceLength(sentence_id);
+ int target_sent_len = target_data_array->GetSentenceLength(sentence_id);
+ source_low = vector<int>(source_sent_len, -1);
+ source_high = vector<int>(source_sent_len, -1);
+
+ // TODO(pauldb): Adam Lopez claims this part is really inefficient. See if we
+ // can speed it up.
+ target_low = vector<int>(target_sent_len, -1);
+ target_high = vector<int>(target_sent_len, -1);
+ vector<pair<int, int> > links = alignment->GetLinks(sentence_id);
+ for (auto link: links) {
+ if (source_low[link.first] == -1 || source_low[link.first] > link.second) {
+ source_low[link.first] = link.second;
+ }
+ source_high[link.first] = max(source_high[link.first], link.second + 1);
+
+ if (target_low[link.second] == -1 || target_low[link.second] > link.first) {
+ target_low[link.second] = link.first;
+ }
+ target_high[link.second] = max(target_high[link.second], link.first + 1);
+ }
+}
+
+bool RuleExtractorHelper::CheckAlignedTerminals(
+ const vector<int>& matching,
+ const vector<int>& chunklen,
+ const vector<int>& source_low) const {
+ if (!require_aligned_terminal) {
+ return true;
+ }
+
+ int sentence_id = source_data_array->GetSentenceId(matching[0]);
+ int source_sent_start = source_data_array->GetSentenceStart(sentence_id);
+
+ int num_aligned_chunks = 0;
+ for (size_t i = 0; i < chunklen.size(); ++i) {
+ for (size_t j = 0; j < chunklen[i]; ++j) {
+ int sent_index = matching[i] - source_sent_start + j;
+ if (source_low[sent_index] != -1) {
+ ++num_aligned_chunks;
+ break;
+ }
+ }
+ }
+
+ if (num_aligned_chunks == 0) {
+ return false;
+ }
+
+ return !require_aligned_chunks || num_aligned_chunks == chunklen.size();
+}
+
+bool RuleExtractorHelper::CheckTightPhrases(
+ const vector<int>& matching,
+ const vector<int>& chunklen,
+ const vector<int>& source_low) const {
+ if (!require_tight_phrases) {
+ return true;
+ }
+
+ int sentence_id = source_data_array->GetSentenceId(matching[0]);
+ int source_sent_start = source_data_array->GetSentenceStart(sentence_id);
+ for (size_t i = 0; i + 1 < chunklen.size(); ++i) {
+ int gap_start = matching[i] + chunklen[i] - source_sent_start;
+ int gap_end = matching[i + 1] - 1 - source_sent_start;
+ if (source_low[gap_start] == -1 || source_low[gap_end] == -1) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool RuleExtractorHelper::FindFixPoint(
+ int source_phrase_low, int source_phrase_high,
+ const vector<int>& source_low, const vector<int>& source_high,
+ int& target_phrase_low, int& target_phrase_high,
+ const vector<int>& target_low, const vector<int>& target_high,
+ int& source_back_low, int& source_back_high, int sentence_id,
+ int min_source_gap_size, int min_target_gap_size,
+ int max_new_x, bool allow_low_x, bool allow_high_x,
+ bool allow_arbitrary_expansion) const {
+ int prev_target_low = target_phrase_low;
+ int prev_target_high = target_phrase_high;
+
+ FindProjection(source_phrase_low, source_phrase_high, source_low,
+ source_high, target_phrase_low, target_phrase_high);
+
+ if (target_phrase_low == -1) {
+ // TODO(pauldb): Low priority corner case inherited from Adam's code:
+ // If w is unaligned, but we don't require aligned terminals, returning an
+ // error here prevents the extraction of the allowed rule
+ // X -> X_1 w X_2 / X_1 X_2
+ return false;
+ }
+
+ int source_sent_len = source_data_array->GetSentenceLength(sentence_id);
+ int target_sent_len = target_data_array->GetSentenceLength(sentence_id);
+ if (prev_target_low != -1 && target_phrase_low != prev_target_low) {
+ if (prev_target_low - target_phrase_low < min_target_gap_size) {
+ target_phrase_low = prev_target_low - min_target_gap_size;
+ if (target_phrase_low < 0) {
+ return false;
+ }
+ }
+ }
+
+ if (prev_target_high != -1 && target_phrase_high != prev_target_high) {
+ if (target_phrase_high - prev_target_high < min_target_gap_size) {
+ target_phrase_high = prev_target_high + min_target_gap_size;
+ if (target_phrase_high > target_sent_len) {
+ return false;
+ }
+ }
+ }
+
+ if (target_phrase_high - target_phrase_low > max_rule_span) {
+ return false;
+ }
+
+ source_back_low = source_back_high = -1;
+ FindProjection(target_phrase_low, target_phrase_high, target_low, target_high,
+ source_back_low, source_back_high);
+ int new_x = 0;
+ bool new_low_x = false, new_high_x = false;
+ while (true) {
+ source_back_low = min(source_back_low, source_phrase_low);
+ source_back_high = max(source_back_high, source_phrase_high);
+
+ if (source_back_low == source_phrase_low &&
+ source_back_high == source_phrase_high) {
+ return true;
+ }
+
+ if (!allow_low_x && source_back_low < source_phrase_low) {
+ // Extension on the left side not allowed.
+ return false;
+ }
+ if (!allow_high_x && source_back_high > source_phrase_high) {
+ // Extension on the right side not allowed.
+ return false;
+ }
+
+ // Extend left side.
+ if (source_back_low < source_phrase_low) {
+ if (new_low_x == false) {
+ if (new_x >= max_new_x) {
+ return false;
+ }
+ new_low_x = true;
+ ++new_x;
+ }
+ if (source_phrase_low - source_back_low < min_source_gap_size) {
+ source_back_low = source_phrase_low - min_source_gap_size;
+ if (source_back_low < 0) {
+ return false;
+ }
+ }
+ }
+
+ // Extend right side.
+ if (source_back_high > source_phrase_high) {
+ if (new_high_x == false) {
+ if (new_x >= max_new_x) {
+ return false;
+ }
+ new_high_x = true;
+ ++new_x;
+ }
+ if (source_back_high - source_phrase_high < min_source_gap_size) {
+ source_back_high = source_phrase_high + min_source_gap_size;
+ if (source_back_high > source_sent_len) {
+ return false;
+ }
+ }
+ }
+
+ if (source_back_high - source_back_low > max_rule_span) {
+ // Rule span too wide.
+ return false;
+ }
+
+ prev_target_low = target_phrase_low;
+ prev_target_high = target_phrase_high;
+ FindProjection(source_back_low, source_phrase_low, source_low, source_high,
+ target_phrase_low, target_phrase_high);
+ FindProjection(source_phrase_high, source_back_high, source_low,
+ source_high, target_phrase_low, target_phrase_high);
+ if (prev_target_low == target_phrase_low &&
+ prev_target_high == target_phrase_high) {
+ return true;
+ }
+
+ if (!allow_arbitrary_expansion) {
+ // Arbitrary expansion not allowed.
+ return false;
+ }
+ if (target_phrase_high - target_phrase_low > max_rule_span) {
+ // Target side too wide.
+ return false;
+ }
+
+ source_phrase_low = source_back_low;
+ source_phrase_high = source_back_high;
+ FindProjection(target_phrase_low, prev_target_low, target_low, target_high,
+ source_back_low, source_back_high);
+ FindProjection(prev_target_high, target_phrase_high, target_low,
+ target_high, source_back_low, source_back_high);
+ }
+
+ return false;
+}
+
+void RuleExtractorHelper::FindProjection(
+ int source_phrase_low, int source_phrase_high,
+ const vector<int>& source_low, const vector<int>& source_high,
+ int& target_phrase_low, int& target_phrase_high) const {
+ for (size_t i = source_phrase_low; i < source_phrase_high; ++i) {
+ if (source_low[i] != -1) {
+ if (target_phrase_low == -1 || source_low[i] < target_phrase_low) {
+ target_phrase_low = source_low[i];
+ }
+ target_phrase_high = max(target_phrase_high, source_high[i]);
+ }
+ }
+}
+
+bool RuleExtractorHelper::GetGaps(
+ vector<pair<int, int> >& source_gaps, vector<pair<int, int> >& target_gaps,
+ const vector<int>& matching, const vector<int>& chunklen,
+ const vector<int>& source_low, const vector<int>& source_high,
+ const vector<int>& target_low, const vector<int>& target_high,
+ int source_phrase_low, int source_phrase_high, int source_back_low,
+ int source_back_high, int& num_symbols, bool& met_constraints) const {
+ int sentence_id = source_data_array->GetSentenceId(matching[0]);
+ int source_sent_start = source_data_array->GetSentenceStart(sentence_id);
+
+ if (source_back_low < source_phrase_low) {
+ source_gaps.push_back(make_pair(source_back_low, source_phrase_low));
+ if (num_symbols >= max_rule_symbols) {
+ // Source side contains too many symbols.
+ return false;
+ }
+ ++num_symbols;
+ if (require_tight_phrases && (source_low[source_back_low] == -1 ||
+ source_low[source_phrase_low - 1] == -1)) {
+ // Inside edges of preceding gap are not tight.
+ return false;
+ }
+ } else if (require_tight_phrases && source_low[source_phrase_low] == -1) {
+ // This is not a hard error. We can't extract this phrase, but we might
+ // still be able to extract a superphrase.
+ met_constraints = false;
+ }
+
+ for (size_t i = 0; i + 1 < chunklen.size(); ++i) {
+ int gap_start = matching[i] + chunklen[i] - source_sent_start;
+ int gap_end = matching[i + 1] - source_sent_start;
+ source_gaps.push_back(make_pair(gap_start, gap_end));
+ }
+
+ if (source_phrase_high < source_back_high) {
+ source_gaps.push_back(make_pair(source_phrase_high, source_back_high));
+ if (num_symbols >= max_rule_symbols) {
+ // Source side contains too many symbols.
+ return false;
+ }
+ ++num_symbols;
+ if (require_tight_phrases && (source_low[source_phrase_high] == -1 ||
+ source_low[source_back_high - 1] == -1)) {
+ // Inside edges of following gap are not tight.
+ return false;
+ }
+ } else if (require_tight_phrases &&
+ source_low[source_phrase_high - 1] == -1) {
+ // This is not a hard error. We can't extract this phrase, but we might
+ // still be able to extract a superphrase.
+ met_constraints = false;
+ }
+
+ target_gaps.resize(source_gaps.size(), make_pair(-1, -1));
+ for (size_t i = 0; i < source_gaps.size(); ++i) {
+ if (!FindFixPoint(source_gaps[i].first, source_gaps[i].second, source_low,
+ source_high, target_gaps[i].first, target_gaps[i].second,
+ target_low, target_high, source_gaps[i].first,
+ source_gaps[i].second, sentence_id, 0, 0, 0, false, false,
+ false)) {
+ // Gap fails integrity check.
+ return false;
+ }
+ }
+
+ return true;
+}
+
+vector<int> RuleExtractorHelper::GetGapOrder(
+ const vector<pair<int, int> >& gaps) const {
+ vector<int> gap_order(gaps.size());
+ for (size_t i = 0; i < gap_order.size(); ++i) {
+ for (size_t j = 0; j < i; ++j) {
+ if (gaps[gap_order[j]] < gaps[i]) {
+ ++gap_order[i];
+ } else {
+ ++gap_order[j];
+ }
+ }
+ }
+ return gap_order;
+}
+
+unordered_map<int, int> RuleExtractorHelper::GetSourceIndexes(
+ const vector<int>& matching, const vector<int>& chunklen,
+ int starts_with_x) const {
+ unordered_map<int, int> source_indexes;
+ int sentence_id = source_data_array->GetSentenceId(matching[0]);
+ int source_sent_start = source_data_array->GetSentenceStart(sentence_id);
+ int num_symbols = starts_with_x;
+ for (size_t i = 0; i < matching.size(); ++i) {
+ for (size_t j = 0; j < chunklen[i]; ++j) {
+ source_indexes[matching[i] + j - source_sent_start] = num_symbols;
+ ++num_symbols;
+ }
+ ++num_symbols;
+ }
+ return source_indexes;
+}
diff --git a/extractor/rule_extractor_helper.h b/extractor/rule_extractor_helper.h
new file mode 100644
index 00000000..3478bfc8
--- /dev/null
+++ b/extractor/rule_extractor_helper.h
@@ -0,0 +1,82 @@
+#ifndef _RULE_EXTRACTOR_HELPER_H_
+#define _RULE_EXTRACTOR_HELPER_H_
+
+#include <memory>
+#include <unordered_map>
+#include <vector>
+
+using namespace std;
+
+class Alignment;
+class DataArray;
+
+class RuleExtractorHelper {
+ public:
+ RuleExtractorHelper(shared_ptr<DataArray> source_data_array,
+ shared_ptr<DataArray> target_data_array,
+ shared_ptr<Alignment> alignment,
+ int max_rule_span,
+ int max_rule_symbols,
+ bool require_aligned_terminal,
+ bool require_aligned_chunks,
+ bool require_tight_phrases);
+
+ virtual ~RuleExtractorHelper();
+
+ virtual void GetLinksSpans(vector<int>& source_low, vector<int>& source_high,
+ vector<int>& target_low, vector<int>& target_high,
+ int sentence_id) const;
+
+ virtual bool CheckAlignedTerminals(const vector<int>& matching,
+ const vector<int>& chunklen,
+ const vector<int>& source_low) const;
+
+ virtual bool CheckTightPhrases(const vector<int>& matching,
+ const vector<int>& chunklen,
+ const vector<int>& source_low) const;
+
+ virtual bool FindFixPoint(
+ int source_phrase_low, int source_phrase_high,
+ const vector<int>& source_low, const vector<int>& source_high,
+ int& target_phrase_low, int& target_phrase_high,
+ const vector<int>& target_low, const vector<int>& target_high,
+ int& source_back_low, int& source_back_high, int sentence_id,
+ int min_source_gap_size, int min_target_gap_size,
+ int max_new_x, bool allow_low_x, bool allow_high_x,
+ bool allow_arbitrary_expansion) const;
+
+ virtual bool GetGaps(
+ vector<pair<int, int> >& source_gaps, vector<pair<int, int> >& target_gaps,
+ const vector<int>& matching, const vector<int>& chunklen,
+ const vector<int>& source_low, const vector<int>& source_high,
+ const vector<int>& target_low, const vector<int>& target_high,
+ int source_phrase_low, int source_phrase_high, int source_back_low,
+ int source_back_high, int& num_symbols, bool& met_constraints) const;
+
+ virtual vector<int> GetGapOrder(const vector<pair<int, int> >& gaps) const;
+
+ // TODO(pauldb): Add unit tests.
+ virtual unordered_map<int, int> GetSourceIndexes(
+ const vector<int>& matching, const vector<int>& chunklen,
+ int starts_with_x) const;
+
+ protected:
+ RuleExtractorHelper();
+
+ private:
+ void FindProjection(
+ int source_phrase_low, int source_phrase_high,
+ const vector<int>& source_low, const vector<int>& source_high,
+ int& target_phrase_low, int& target_phrase_high) const;
+
+ shared_ptr<DataArray> source_data_array;
+ shared_ptr<DataArray> target_data_array;
+ shared_ptr<Alignment> alignment;
+ int max_rule_span;
+ int max_rule_symbols;
+ bool require_aligned_terminal;
+ bool require_aligned_chunks;
+ bool require_tight_phrases;
+};
+
+#endif
diff --git a/extractor/rule_extractor_helper_test.cc b/extractor/rule_extractor_helper_test.cc
new file mode 100644
index 00000000..29213312
--- /dev/null
+++ b/extractor/rule_extractor_helper_test.cc
@@ -0,0 +1,622 @@
+#include <gtest/gtest.h>
+
+#include <memory>
+
+#include "mocks/mock_alignment.h"
+#include "mocks/mock_data_array.h"
+#include "rule_extractor_helper.h"
+
+using namespace std;
+using namespace ::testing;
+
+namespace {
+
+class RuleExtractorHelperTest : public Test {
+ protected:
+ virtual void SetUp() {
+ source_data_array = make_shared<MockDataArray>();
+ EXPECT_CALL(*source_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(12));
+ EXPECT_CALL(*source_data_array, GetSentenceId(_))
+ .WillRepeatedly(Return(5));
+ EXPECT_CALL(*source_data_array, GetSentenceStart(_))
+ .WillRepeatedly(Return(10));
+
+ target_data_array = make_shared<MockDataArray>();
+ EXPECT_CALL(*target_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(12));
+
+ vector<pair<int, int> > links = {
+ make_pair(0, 0), make_pair(0, 1), make_pair(2, 2), make_pair(3, 1)
+ };
+ alignment = make_shared<MockAlignment>();
+ EXPECT_CALL(*alignment, GetLinks(_)).WillRepeatedly(Return(links));
+ }
+
+ shared_ptr<MockDataArray> source_data_array;
+ shared_ptr<MockDataArray> target_data_array;
+ shared_ptr<MockAlignment> alignment;
+ shared_ptr<RuleExtractorHelper> helper;
+};
+
+TEST_F(RuleExtractorHelperTest, TestGetLinksSpans) {
+ helper = make_shared<RuleExtractorHelper>(source_data_array,
+ target_data_array, alignment, 10, 5, true, true, true);
+ EXPECT_CALL(*source_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(4));
+ EXPECT_CALL(*target_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(3));
+
+ vector<int> source_low, source_high, target_low, target_high;
+ helper->GetLinksSpans(source_low, source_high, target_low, target_high, 0);
+
+ vector<int> expected_source_low = {0, -1, 2, 1};
+ EXPECT_EQ(expected_source_low, source_low);
+ vector<int> expected_source_high = {2, -1, 3, 2};
+ EXPECT_EQ(expected_source_high, source_high);
+ vector<int> expected_target_low = {0, 0, 2};
+ EXPECT_EQ(expected_target_low, target_low);
+ vector<int> expected_target_high = {1, 4, 3};
+ EXPECT_EQ(expected_target_high, target_high);
+}
+
+TEST_F(RuleExtractorHelperTest, TestCheckAlignedFalse) {
+ helper = make_shared<RuleExtractorHelper>(source_data_array,
+ target_data_array, alignment, 10, 5, false, false, true);
+ EXPECT_CALL(*source_data_array, GetSentenceId(_)).Times(0);
+ EXPECT_CALL(*source_data_array, GetSentenceStart(_)).Times(0);
+
+ vector<int> matching, chunklen, source_low;
+ EXPECT_TRUE(helper->CheckAlignedTerminals(matching, chunklen, source_low));
+}
+
+TEST_F(RuleExtractorHelperTest, TestCheckAlignedTerminal) {
+ helper = make_shared<RuleExtractorHelper>(source_data_array,
+ target_data_array, alignment, 10, 5, true, false, true);
+
+ vector<int> matching = {10, 12};
+ vector<int> chunklen = {1, 3};
+ vector<int> source_low = {-1, 1, -1, 3, -1};
+ EXPECT_TRUE(helper->CheckAlignedTerminals(matching, chunklen, source_low));
+ source_low = {-1, 1, -1, -1, -1};
+ EXPECT_FALSE(helper->CheckAlignedTerminals(matching, chunklen, source_low));
+}
+
+TEST_F(RuleExtractorHelperTest, TestCheckAlignedChunks) {
+ helper = make_shared<RuleExtractorHelper>(source_data_array,
+ target_data_array, alignment, 10, 5, true, true, true);
+
+ vector<int> matching = {10, 12};
+ vector<int> chunklen = {1, 3};
+ vector<int> source_low = {2, 1, -1, 3, -1};
+ EXPECT_TRUE(helper->CheckAlignedTerminals(matching, chunklen, source_low));
+ source_low = {-1, 1, -1, 3, -1};
+ EXPECT_FALSE(helper->CheckAlignedTerminals(matching, chunklen, source_low));
+ source_low = {2, 1, -1, -1, -1};
+ EXPECT_FALSE(helper->CheckAlignedTerminals(matching, chunklen, source_low));
+}
+
+
+TEST_F(RuleExtractorHelperTest, TestCheckTightPhrasesFalse) {
+ helper = make_shared<RuleExtractorHelper>(source_data_array,
+ target_data_array, alignment, 10, 5, true, true, false);
+ EXPECT_CALL(*source_data_array, GetSentenceId(_)).Times(0);
+ EXPECT_CALL(*source_data_array, GetSentenceStart(_)).Times(0);
+
+ vector<int> matching, chunklen, source_low;
+ EXPECT_TRUE(helper->CheckTightPhrases(matching, chunklen, source_low));
+}
+
+TEST_F(RuleExtractorHelperTest, TestCheckTightPhrases) {
+ helper = make_shared<RuleExtractorHelper>(source_data_array,
+ target_data_array, alignment, 10, 5, true, true, true);
+
+ vector<int> matching = {10, 14, 18};
+ vector<int> chunklen = {2, 3, 1};
+ // No missing links.
+ vector<int> source_low = {0, 1, 2, 3, 4, 5, 6, 7, 8};
+ EXPECT_TRUE(helper->CheckTightPhrases(matching, chunklen, source_low));
+
+ // Missing link at the beginning or ending of a gap.
+ source_low = {0, 1, -1, 3, 4, 5, 6, 7, 8};
+ EXPECT_FALSE(helper->CheckTightPhrases(matching, chunklen, source_low));
+ source_low = {0, 1, 2, -1, 4, 5, 6, 7, 8};
+ EXPECT_FALSE(helper->CheckTightPhrases(matching, chunklen, source_low));
+ source_low = {0, 1, 2, 3, 4, 5, 6, -1, 8};
+ EXPECT_FALSE(helper->CheckTightPhrases(matching, chunklen, source_low));
+
+ // Missing link inside the gap.
+ chunklen = {1, 3, 1};
+ source_low = {0, 1, -1, 3, 4, 5, 6, 7, 8};
+ EXPECT_TRUE(helper->CheckTightPhrases(matching, chunklen, source_low));
+}
+
+TEST_F(RuleExtractorHelperTest, TestFindFixPointBadEdgeCase) {
+ helper = make_shared<RuleExtractorHelper>(source_data_array,
+ target_data_array, alignment, 10, 5, true, true, true);
+
+ vector<int> source_low = {0, -1, 2};
+ vector<int> source_high = {1, -1, 3};
+ vector<int> target_low = {0, -1, 2};
+ vector<int> target_high = {1, -1, 3};
+ int source_phrase_low = 1, source_phrase_high = 2;
+ int source_back_low, source_back_high;
+ int target_phrase_low = -1, target_phrase_high = 1;
+
+ // This should be in fact true. See comment about the inherited bug.
+ EXPECT_FALSE(helper->FindFixPoint(source_phrase_low, source_phrase_high,
+ source_low, source_high, target_phrase_low,
+ target_phrase_high, target_low, target_high,
+ source_back_low, source_back_high, 0, 0, 0,
+ 0, false, false, false));
+}
+
+TEST_F(RuleExtractorHelperTest, TestFindFixPointTargetSentenceOutOfBounds) {
+ helper = make_shared<RuleExtractorHelper>(source_data_array,
+ target_data_array, alignment, 10, 5, true, true, true);
+ EXPECT_CALL(*source_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(3));
+ EXPECT_CALL(*target_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(3));
+
+ vector<int> source_low = {0, 0, 2};
+ vector<int> source_high = {1, 2, 3};
+ vector<int> target_low = {0, 1, 2};
+ vector<int> target_high = {2, 2, 3};
+ int source_phrase_low = 1, source_phrase_high = 2;
+ int source_back_low, source_back_high;
+ int target_phrase_low = 1, target_phrase_high = 2;
+
+ // Extend out of sentence to left.
+ EXPECT_FALSE(helper->FindFixPoint(source_phrase_low, source_phrase_high,
+ source_low, source_high, target_phrase_low,
+ target_phrase_high, target_low, target_high,
+ source_back_low, source_back_high, 0, 2, 2,
+ 0, false, false, false));
+ source_low = {0, 1, 2};
+ source_high = {1, 3, 3};
+ target_low = {0, 1, 1};
+ target_high = {1, 2, 3};
+ EXPECT_FALSE(helper->FindFixPoint(source_phrase_low, source_phrase_high,
+ source_low, source_high, target_phrase_low,
+ target_phrase_high, target_low, target_high,
+ source_back_low, source_back_high, 0, 2, 2,
+ 0, false, false, false));
+}
+
+TEST_F(RuleExtractorHelperTest, TestFindFixPointTargetTooWide) {
+ helper = make_shared<RuleExtractorHelper>(source_data_array,
+ target_data_array, alignment, 5, 5, true, true, true);
+ EXPECT_CALL(*source_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(7));
+ EXPECT_CALL(*target_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(7));
+
+ vector<int> source_low = {0, 0, 0, 0, 0, 0, 0};
+ vector<int> source_high = {7, 7, 7, 7, 7, 7, 7};
+ vector<int> target_low = {0, -1, -1, -1, -1, -1, 0};
+ vector<int> target_high = {7, -1, -1, -1, -1, -1, 7};
+ int source_phrase_low = 2, source_phrase_high = 5;
+ int source_back_low, source_back_high;
+ int target_phrase_low = -1, target_phrase_high = -1;
+
+ // Projection is too wide.
+ EXPECT_FALSE(helper->FindFixPoint(source_phrase_low, source_phrase_high,
+ source_low, source_high, target_phrase_low,
+ target_phrase_high, target_low, target_high,
+ source_back_low, source_back_high, 0, 1, 1,
+ 0, false, false, false));
+}
+
+TEST_F(RuleExtractorHelperTest, TestFindFixPoint) {
+ helper = make_shared<RuleExtractorHelper>(source_data_array,
+ target_data_array, alignment, 10, 5, true, true, true);
+ EXPECT_CALL(*source_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(7));
+ EXPECT_CALL(*target_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(7));
+
+ vector<int> source_low = {1, 1, 1, 3, 4, 5, 5};
+ vector<int> source_high = {2, 2, 3, 4, 6, 6, 6};
+ vector<int> target_low = {-1, 0, 2, 3, 4, 4, -1};
+ vector<int> target_high = {-1, 3, 3, 4, 5, 7, -1};
+ int source_phrase_low = 2, source_phrase_high = 5;
+ int source_back_low, source_back_high;
+ int target_phrase_low = 2, target_phrase_high = 5;
+
+ EXPECT_TRUE(helper->FindFixPoint(source_phrase_low, source_phrase_high,
+ source_low, source_high, target_phrase_low,
+ target_phrase_high, target_low, target_high,
+ source_back_low, source_back_high, 1, 1, 1,
+ 2, true, true, false));
+ EXPECT_EQ(1, target_phrase_low);
+ EXPECT_EQ(6, target_phrase_high);
+ EXPECT_EQ(0, source_back_low);
+ EXPECT_EQ(7, source_back_high);
+
+ source_low = {0, -1, 1, 3, 4, -1, 6};
+ source_high = {1, -1, 3, 4, 6, -1, 7};
+ target_low = {0, 2, 2, 3, 4, 4, 6};
+ target_high = {1, 3, 3, 4, 5, 5, 7};
+ source_phrase_low = 2, source_phrase_high = 5;
+ target_phrase_low = -1, target_phrase_high = -1;
+ EXPECT_TRUE(helper->FindFixPoint(source_phrase_low, source_phrase_high,
+ source_low, source_high, target_phrase_low,
+ target_phrase_high, target_low, target_high,
+ source_back_low, source_back_high, 1, 1, 1,
+ 2, true, true, false));
+ EXPECT_EQ(1, target_phrase_low);
+ EXPECT_EQ(6, target_phrase_high);
+ EXPECT_EQ(2, source_back_low);
+ EXPECT_EQ(5, source_back_high);
+}
+
+TEST_F(RuleExtractorHelperTest, TestFindFixPointExtensionsNotAllowed) {
+ helper = make_shared<RuleExtractorHelper>(source_data_array,
+ target_data_array, alignment, 10, 5, true, true, true);
+ EXPECT_CALL(*source_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(3));
+ EXPECT_CALL(*target_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(3));
+
+ vector<int> source_low = {0, 0, 2};
+ vector<int> source_high = {1, 2, 3};
+ vector<int> target_low = {0, 1, 2};
+ vector<int> target_high = {2, 2, 3};
+ int source_phrase_low = 1, source_phrase_high = 2;
+ int source_back_low, source_back_high;
+ int target_phrase_low = -1, target_phrase_high = -1;
+
+ // Extension on the left side not allowed.
+ EXPECT_FALSE(helper->FindFixPoint(source_phrase_low, source_phrase_high,
+ source_low, source_high, target_phrase_low,
+ target_phrase_high, target_low, target_high,
+ source_back_low, source_back_high, 0, 1, 1,
+ 1, false, true, false));
+ // Extension on the left side is allowed, but we can't add anymore X.
+ target_phrase_low = -1, target_phrase_high = -1;
+ EXPECT_FALSE(helper->FindFixPoint(source_phrase_low, source_phrase_high,
+ source_low, source_high, target_phrase_low,
+ target_phrase_high, target_low, target_high,
+ source_back_low, source_back_high, 0, 1, 1,
+ 0, true, true, false));
+ source_low = {0, 1, 2};
+ source_high = {1, 3, 3};
+ target_low = {0, 1, 1};
+ target_high = {1, 2, 3};
+ // Extension on the right side not allowed.
+ target_phrase_low = -1, target_phrase_high = -1;
+ EXPECT_FALSE(helper->FindFixPoint(source_phrase_low, source_phrase_high,
+ source_low, source_high, target_phrase_low,
+ target_phrase_high, target_low, target_high,
+ source_back_low, source_back_high, 0, 1, 1,
+ 1, true, false, false));
+ // Extension on the right side is allowed, but we can't add anymore X.
+ target_phrase_low = -1, target_phrase_high = -1;
+ EXPECT_FALSE(helper->FindFixPoint(source_phrase_low, source_phrase_high,
+ source_low, source_high, target_phrase_low,
+ target_phrase_high, target_low, target_high,
+ source_back_low, source_back_high, 0, 1, 1,
+ 0, true, true, false));
+}
+
+TEST_F(RuleExtractorHelperTest, TestFindFixPointSourceSentenceOutOfBounds) {
+ helper = make_shared<RuleExtractorHelper>(source_data_array,
+ target_data_array, alignment, 10, 5, true, true, true);
+ EXPECT_CALL(*source_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(3));
+ EXPECT_CALL(*target_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(3));
+
+ vector<int> source_low = {0, 0, 2};
+ vector<int> source_high = {1, 2, 3};
+ vector<int> target_low = {0, 1, 2};
+ vector<int> target_high = {2, 2, 3};
+ int source_phrase_low = 1, source_phrase_high = 2;
+ int source_back_low, source_back_high;
+ int target_phrase_low = 1, target_phrase_high = 2;
+ // Extend out of sentence to left.
+ EXPECT_FALSE(helper->FindFixPoint(source_phrase_low, source_phrase_high,
+ source_low, source_high, target_phrase_low,
+ target_phrase_high, target_low, target_high,
+ source_back_low, source_back_high, 0, 2, 1,
+ 1, true, true, false));
+ source_low = {0, 1, 2};
+ source_high = {1, 3, 3};
+ target_low = {0, 1, 1};
+ target_high = {1, 2, 3};
+ target_phrase_low = 1, target_phrase_high = 2;
+ EXPECT_FALSE(helper->FindFixPoint(source_phrase_low, source_phrase_high,
+ source_low, source_high, target_phrase_low,
+ target_phrase_high, target_low, target_high,
+ source_back_low, source_back_high, 0, 2, 1,
+ 1, true, true, false));
+}
+
+TEST_F(RuleExtractorHelperTest, TestFindFixPointTargetSourceWide) {
+ helper = make_shared<RuleExtractorHelper>(source_data_array,
+ target_data_array, alignment, 5, 5, true, true, true);
+ EXPECT_CALL(*source_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(7));
+ EXPECT_CALL(*target_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(7));
+
+ vector<int> source_low = {2, -1, 2, 3, 4, -1, 4};
+ vector<int> source_high = {3, -1, 3, 4, 5, -1, 5};
+ vector<int> target_low = {-1, -1, 0, 3, 4, -1, -1};
+ vector<int> target_high = {-1, -1, 3, 4, 7, -1, -1};
+ int source_phrase_low = 2, source_phrase_high = 5;
+ int source_back_low, source_back_high;
+ int target_phrase_low = -1, target_phrase_high = -1;
+
+ // Second projection (on source side) is too wide.
+ EXPECT_FALSE(helper->FindFixPoint(source_phrase_low, source_phrase_high,
+ source_low, source_high, target_phrase_low,
+ target_phrase_high, target_low, target_high,
+ source_back_low, source_back_high, 0, 1, 1,
+ 2, true, true, false));
+}
+
+TEST_F(RuleExtractorHelperTest, TestFindFixPointArbitraryExpansion) {
+ helper = make_shared<RuleExtractorHelper>(source_data_array,
+ target_data_array, alignment, 20, 5, true, true, true);
+ EXPECT_CALL(*source_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(11));
+ EXPECT_CALL(*target_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(11));
+
+ vector<int> source_low = {1, 1, 2, 3, 4, 5, 6, 7, 7, 8, 9};
+ vector<int> source_high = {2, 3, 4, 5, 5, 6, 7, 8, 9, 10, 10};
+ vector<int> target_low = {-1, 0, 1, 2, 3, 5, 6, 7, 8, 9, -1};
+ vector<int> target_high = {-1, 2, 3, 4, 5, 6, 8, 9, 10, 11, -1};
+ int source_phrase_low = 4, source_phrase_high = 7;
+ int source_back_low, source_back_high;
+ int target_phrase_low = -1, target_phrase_high = -1;
+ EXPECT_FALSE(helper->FindFixPoint(source_phrase_low, source_phrase_high,
+ source_low, source_high, target_phrase_low,
+ target_phrase_high, target_low, target_high,
+ source_back_low, source_back_high, 0, 1, 1,
+ 10, true, true, false));
+
+ source_phrase_low = 4, source_phrase_high = 7;
+ target_phrase_low = -1, target_phrase_high = -1;
+ EXPECT_TRUE(helper->FindFixPoint(source_phrase_low, source_phrase_high,
+ source_low, source_high, target_phrase_low,
+ target_phrase_high, target_low, target_high,
+ source_back_low, source_back_high, 0, 1, 1,
+ 10, true, true, true));
+}
+
+TEST_F(RuleExtractorHelperTest, TestGetGapOrder) {
+ helper = make_shared<RuleExtractorHelper>(source_data_array,
+ target_data_array, alignment, 10, 5, true, true, true);
+
+ vector<pair<int, int> > gaps =
+ {make_pair(0, 3), make_pair(5, 8), make_pair(11, 12), make_pair(15, 17)};
+ vector<int> expected_gap_order = {0, 1, 2, 3};
+ EXPECT_EQ(expected_gap_order, helper->GetGapOrder(gaps));
+
+ gaps = {make_pair(15, 17), make_pair(8, 9), make_pair(5, 6), make_pair(0, 3)};
+ expected_gap_order = {3, 2, 1, 0};
+ EXPECT_EQ(expected_gap_order, helper->GetGapOrder(gaps));
+
+ gaps = {make_pair(8, 9), make_pair(5, 6), make_pair(0, 3), make_pair(15, 17)};
+ expected_gap_order = {2, 1, 0, 3};
+ EXPECT_EQ(expected_gap_order, helper->GetGapOrder(gaps));
+}
+
+TEST_F(RuleExtractorHelperTest, TestGetGapsExceedNumSymbols) {
+ helper = make_shared<RuleExtractorHelper>(source_data_array,
+ target_data_array, alignment, 10, 5, true, true, true);
+ EXPECT_CALL(*source_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(7));
+ EXPECT_CALL(*target_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(7));
+
+ bool met_constraints = true;
+ vector<int> source_low = {1, 1, 2, 3, 4, 5, 6};
+ vector<int> source_high = {2, 2, 3, 4, 5, 6, 7};
+ vector<int> target_low = {-1, 0, 2, 3, 4, 5, 6};
+ vector<int> target_high = {-1, 2, 3, 4, 5, 6, 7};
+ int source_phrase_low = 1, source_phrase_high = 6;
+ int source_back_low = 0, source_back_high = 6;
+ vector<int> matching = {11, 13, 15};
+ vector<int> chunklen = {1, 1, 1};
+ vector<pair<int, int> > source_gaps, target_gaps;
+ int num_symbols = 5;
+ EXPECT_FALSE(helper->GetGaps(source_gaps, target_gaps, matching, chunklen,
+ source_low, source_high, target_low, target_high,
+ source_phrase_low, source_phrase_high,
+ source_back_low, source_back_high, num_symbols,
+ met_constraints));
+
+ source_low = {0, 1, 2, 3, 4, 5, 5};
+ source_high = {1, 2, 3, 4, 5, 6, 6};
+ target_low = {0, 1, 2, 3, 4, 5, -1};
+ target_high = {1, 2, 3, 4, 5, 7, -1};
+ source_phrase_low = 1, source_phrase_high = 6;
+ source_back_low = 1, source_back_high = 7;
+ num_symbols = 5;
+ EXPECT_FALSE(helper->GetGaps(source_gaps, target_gaps, matching, chunklen,
+ source_low, source_high, target_low, target_high,
+ source_phrase_low, source_phrase_high,
+ source_back_low, source_back_high, num_symbols,
+ met_constraints));
+}
+
+TEST_F(RuleExtractorHelperTest, TestGetGapsExtensionsNotTight) {
+ helper = make_shared<RuleExtractorHelper>(source_data_array,
+ target_data_array, alignment, 10, 7, true, true, true);
+ EXPECT_CALL(*source_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(7));
+ EXPECT_CALL(*target_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(7));
+
+ bool met_constraints = true;
+ vector<int> source_low = {-1, 1, 2, 3, 4, 5, -1};
+ vector<int> source_high = {-1, 2, 3, 4, 5, 6, -1};
+ vector<int> target_low = {-1, 1, 2, 3, 4, 5, -1};
+ vector<int> target_high = {-1, 2, 3, 4, 5, 6, -1};
+ int source_phrase_low = 1, source_phrase_high = 6;
+ int source_back_low = 0, source_back_high = 6;
+ vector<int> matching = {11, 13, 15};
+ vector<int> chunklen = {1, 1, 1};
+ vector<pair<int, int> > source_gaps, target_gaps;
+ int num_symbols = 5;
+ EXPECT_FALSE(helper->GetGaps(source_gaps, target_gaps, matching, chunklen,
+ source_low, source_high, target_low, target_high,
+ source_phrase_low, source_phrase_high,
+ source_back_low, source_back_high, num_symbols,
+ met_constraints));
+
+ source_phrase_low = 1, source_phrase_high = 6;
+ source_back_low = 1, source_back_high = 7;
+ num_symbols = 5;
+ EXPECT_FALSE(helper->GetGaps(source_gaps, target_gaps, matching, chunklen,
+ source_low, source_high, target_low, target_high,
+ source_phrase_low, source_phrase_high,
+ source_back_low, source_back_high, num_symbols,
+ met_constraints));
+}
+
+TEST_F(RuleExtractorHelperTest, TestGetGapsNotTightExtremities) {
+ helper = make_shared<RuleExtractorHelper>(source_data_array,
+ target_data_array, alignment, 10, 7, true, true, true);
+ EXPECT_CALL(*source_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(7));
+ EXPECT_CALL(*target_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(7));
+
+ bool met_constraints = true;
+ vector<int> source_low = {-1, -1, 2, 3, 4, 5, 6};
+ vector<int> source_high = {-1, -1, 3, 4, 5, 6, 7};
+ vector<int> target_low = {-1, -1, 2, 3, 4, 5, 6};
+ vector<int> target_high = {-1, -1, 3, 4, 5, 6, 7};
+ int source_phrase_low = 1, source_phrase_high = 6;
+ int source_back_low = 1, source_back_high = 6;
+ vector<int> matching = {11, 13, 15};
+ vector<int> chunklen = {1, 1, 1};
+ vector<pair<int, int> > source_gaps, target_gaps;
+ int num_symbols = 5;
+ EXPECT_TRUE(helper->GetGaps(source_gaps, target_gaps, matching, chunklen,
+ source_low, source_high, target_low, target_high,
+ source_phrase_low, source_phrase_high,
+ source_back_low, source_back_high, num_symbols,
+ met_constraints));
+ EXPECT_FALSE(met_constraints);
+ vector<pair<int, int> > expected_gaps = {make_pair(2, 3), make_pair(4, 5)};
+ EXPECT_EQ(expected_gaps, source_gaps);
+ EXPECT_EQ(expected_gaps, target_gaps);
+
+ source_low = {-1, 1, 2, 3, 4, -1, 6};
+ source_high = {-1, 2, 3, 4, 5, -1, 7};
+ target_low = {-1, 1, 2, 3, 4, -1, 6};
+ target_high = {-1, 2, 3, 4, 5, -1, 7};
+ met_constraints = true;
+ source_gaps.clear();
+ target_gaps.clear();
+ EXPECT_TRUE(helper->GetGaps(source_gaps, target_gaps, matching, chunklen,
+ source_low, source_high, target_low, target_high,
+ source_phrase_low, source_phrase_high,
+ source_back_low, source_back_high, num_symbols,
+ met_constraints));
+ EXPECT_FALSE(met_constraints);
+ EXPECT_EQ(expected_gaps, source_gaps);
+ EXPECT_EQ(expected_gaps, target_gaps);
+}
+
+TEST_F(RuleExtractorHelperTest, TestGetGapsWithExtensions) {
+ helper = make_shared<RuleExtractorHelper>(source_data_array,
+ target_data_array, alignment, 10, 5, true, true, true);
+ EXPECT_CALL(*source_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(7));
+ EXPECT_CALL(*target_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(7));
+
+ bool met_constraints = true;
+ vector<int> source_low = {-1, 5, 2, 3, 4, 1, -1};
+ vector<int> source_high = {-1, 6, 3, 4, 5, 2, -1};
+ vector<int> target_low = {-1, 5, 2, 3, 4, 1, -1};
+ vector<int> target_high = {-1, 6, 3, 4, 5, 2, -1};
+ int source_phrase_low = 2, source_phrase_high = 5;
+ int source_back_low = 1, source_back_high = 6;
+ vector<int> matching = {12, 14};
+ vector<int> chunklen = {1, 1};
+ vector<pair<int, int> > source_gaps, target_gaps;
+ int num_symbols = 3;
+ EXPECT_TRUE(helper->GetGaps(source_gaps, target_gaps, matching, chunklen,
+ source_low, source_high, target_low, target_high,
+ source_phrase_low, source_phrase_high,
+ source_back_low, source_back_high, num_symbols,
+ met_constraints));
+ vector<pair<int, int> > expected_source_gaps = {
+ make_pair(1, 2), make_pair(3, 4), make_pair(5, 6)
+ };
+ EXPECT_EQ(expected_source_gaps, source_gaps);
+ vector<pair<int, int> > expected_target_gaps = {
+ make_pair(5, 6), make_pair(3, 4), make_pair(1, 2)
+ };
+ EXPECT_EQ(expected_target_gaps, target_gaps);
+}
+
+TEST_F(RuleExtractorHelperTest, TestGetGaps) {
+ helper = make_shared<RuleExtractorHelper>(source_data_array,
+ target_data_array, alignment, 10, 5, true, true, true);
+ EXPECT_CALL(*source_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(7));
+ EXPECT_CALL(*target_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(7));
+
+ bool met_constraints = true;
+ vector<int> source_low = {-1, 1, 4, 3, 2, 5, -1};
+ vector<int> source_high = {-1, 2, 5, 4, 3, 6, -1};
+ vector<int> target_low = {-1, 1, 4, 3, 2, 5, -1};
+ vector<int> target_high = {-1, 2, 5, 4, 3, 6, -1};
+ int source_phrase_low = 1, source_phrase_high = 6;
+ int source_back_low = 1, source_back_high = 6;
+ vector<int> matching = {11, 13, 15};
+ vector<int> chunklen = {1, 1, 1};
+ vector<pair<int, int> > source_gaps, target_gaps;
+ int num_symbols = 5;
+ EXPECT_TRUE(helper->GetGaps(source_gaps, target_gaps, matching, chunklen,
+ source_low, source_high, target_low, target_high,
+ source_phrase_low, source_phrase_high,
+ source_back_low, source_back_high, num_symbols,
+ met_constraints));
+ vector<pair<int, int> > expected_source_gaps = {
+ make_pair(2, 3), make_pair(4, 5)
+ };
+ EXPECT_EQ(expected_source_gaps, source_gaps);
+ vector<pair<int, int> > expected_target_gaps = {
+ make_pair(4, 5), make_pair(2, 3)
+ };
+ EXPECT_EQ(expected_target_gaps, target_gaps);
+}
+
+TEST_F(RuleExtractorHelperTest, TestGetGapIntegrityChecksFailed) {
+ helper = make_shared<RuleExtractorHelper>(source_data_array,
+ target_data_array, alignment, 10, 5, true, true, true);
+ EXPECT_CALL(*source_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(7));
+ EXPECT_CALL(*target_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(7));
+
+ bool met_constraints = true;
+ vector<int> source_low = {-1, 3, 2, 3, 4, 3, -1};
+ vector<int> source_high = {-1, 4, 3, 4, 5, 4, -1};
+ vector<int> target_low = {-1, -1, 2, 1, 4, -1, -1};
+ vector<int> target_high = {-1, -1, 3, 6, 5, -1, -1};
+ int source_phrase_low = 2, source_phrase_high = 5;
+ int source_back_low = 2, source_back_high = 5;
+ vector<int> matching = {12, 14};
+ vector<int> chunklen = {1, 1};
+ vector<pair<int, int> > source_gaps, target_gaps;
+ int num_symbols = 3;
+ EXPECT_FALSE(helper->GetGaps(source_gaps, target_gaps, matching, chunklen,
+ source_low, source_high, target_low, target_high,
+ source_phrase_low, source_phrase_high,
+ source_back_low, source_back_high, num_symbols,
+ met_constraints));
+}
+
+} // namespace
diff --git a/extractor/rule_extractor_test.cc b/extractor/rule_extractor_test.cc
new file mode 100644
index 00000000..0be44d4d
--- /dev/null
+++ b/extractor/rule_extractor_test.cc
@@ -0,0 +1,166 @@
+#include <gtest/gtest.h>
+
+#include <memory>
+
+#include "mocks/mock_alignment.h"
+#include "mocks/mock_data_array.h"
+#include "mocks/mock_rule_extractor_helper.h"
+#include "mocks/mock_scorer.h"
+#include "mocks/mock_target_phrase_extractor.h"
+#include "mocks/mock_vocabulary.h"
+#include "phrase.h"
+#include "phrase_builder.h"
+#include "phrase_location.h"
+#include "rule_extractor.h"
+#include "rule.h"
+
+using namespace std;
+using namespace ::testing;
+
+namespace {
+
+class RuleExtractorTest : public Test {
+ protected:
+ virtual void SetUp() {
+ source_data_array = make_shared<MockDataArray>();
+ EXPECT_CALL(*source_data_array, GetSentenceId(_))
+ .WillRepeatedly(Return(0));
+ EXPECT_CALL(*source_data_array, GetSentenceStart(_))
+ .WillRepeatedly(Return(0));
+ EXPECT_CALL(*source_data_array, GetSentenceLength(_))
+ .WillRepeatedly(Return(10));
+
+ helper = make_shared<MockRuleExtractorHelper>();
+ EXPECT_CALL(*helper, CheckAlignedTerminals(_, _, _))
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(*helper, CheckTightPhrases(_, _, _))
+ .WillRepeatedly(Return(true));
+ unordered_map<int, int> source_indexes;
+ EXPECT_CALL(*helper, GetSourceIndexes(_, _, _))
+ .WillRepeatedly(Return(source_indexes));
+
+ vocabulary = make_shared<MockVocabulary>();
+ EXPECT_CALL(*vocabulary, GetTerminalValue(87))
+ .WillRepeatedly(Return("a"));
+ phrase_builder = make_shared<PhraseBuilder>(vocabulary);
+ vector<int> symbols = {87};
+ Phrase target_phrase = phrase_builder->Build(symbols);
+ PhraseAlignment phrase_alignment = {make_pair(0, 0)};
+
+ target_phrase_extractor = make_shared<MockTargetPhraseExtractor>();
+ vector<pair<Phrase, PhraseAlignment> > target_phrases = {
+ make_pair(target_phrase, phrase_alignment)
+ };
+ EXPECT_CALL(*target_phrase_extractor, ExtractPhrases(_, _, _, _, _, _))
+ .WillRepeatedly(Return(target_phrases));
+
+ scorer = make_shared<MockScorer>();
+ vector<double> scores = {0.3, 7.2};
+ EXPECT_CALL(*scorer, Score(_)).WillRepeatedly(Return(scores));
+
+ extractor = make_shared<RuleExtractor>(source_data_array, phrase_builder,
+ scorer, target_phrase_extractor, helper, 10, 1, 3, 5, false);
+ }
+
+ shared_ptr<MockDataArray> source_data_array;
+ shared_ptr<MockVocabulary> vocabulary;
+ shared_ptr<PhraseBuilder> phrase_builder;
+ shared_ptr<MockRuleExtractorHelper> helper;
+ shared_ptr<MockScorer> scorer;
+ shared_ptr<MockTargetPhraseExtractor> target_phrase_extractor;
+ shared_ptr<RuleExtractor> extractor;
+};
+
+TEST_F(RuleExtractorTest, TestExtractRulesAlignedTerminalsFail) {
+ vector<int> symbols = {87};
+ Phrase phrase = phrase_builder->Build(symbols);
+ vector<int> matching = {2};
+ PhraseLocation phrase_location(matching, 1);
+ EXPECT_CALL(*helper, GetLinksSpans(_, _, _, _, _)).Times(1);
+ EXPECT_CALL(*helper, CheckAlignedTerminals(_, _, _))
+ .WillRepeatedly(Return(false));
+ vector<Rule> rules = extractor->ExtractRules(phrase, phrase_location);
+ EXPECT_EQ(0, rules.size());
+}
+
+TEST_F(RuleExtractorTest, TestExtractRulesTightPhrasesFail) {
+ vector<int> symbols = {87};
+ Phrase phrase = phrase_builder->Build(symbols);
+ vector<int> matching = {2};
+ PhraseLocation phrase_location(matching, 1);
+ EXPECT_CALL(*helper, GetLinksSpans(_, _, _, _, _)).Times(1);
+ EXPECT_CALL(*helper, CheckTightPhrases(_, _, _))
+ .WillRepeatedly(Return(false));
+ vector<Rule> rules = extractor->ExtractRules(phrase, phrase_location);
+ EXPECT_EQ(0, rules.size());
+}
+
+TEST_F(RuleExtractorTest, TestExtractRulesNoFixPoint) {
+ vector<int> symbols = {87};
+ Phrase phrase = phrase_builder->Build(symbols);
+ vector<int> matching = {2};
+ PhraseLocation phrase_location(matching, 1);
+
+ EXPECT_CALL(*helper, GetLinksSpans(_, _, _, _, _)).Times(1);
+ // Set FindFixPoint to return false.
+ vector<pair<int, int> > gaps;
+ helper->SetUp(0, 0, 0, 0, false, gaps, gaps, 0, true, true);
+
+ vector<Rule> rules = extractor->ExtractRules(phrase, phrase_location);
+ EXPECT_EQ(0, rules.size());
+}
+
+TEST_F(RuleExtractorTest, TestExtractRulesGapsFail) {
+ vector<int> symbols = {87};
+ Phrase phrase = phrase_builder->Build(symbols);
+ vector<int> matching = {2};
+ PhraseLocation phrase_location(matching, 1);
+
+ EXPECT_CALL(*helper, GetLinksSpans(_, _, _, _, _)).Times(1);
+ // Set CheckGaps to return false.
+ vector<pair<int, int> > gaps;
+ helper->SetUp(0, 0, 0, 0, true, gaps, gaps, 0, true, false);
+
+ vector<Rule> rules = extractor->ExtractRules(phrase, phrase_location);
+ EXPECT_EQ(0, rules.size());
+}
+
+TEST_F(RuleExtractorTest, TestExtractRulesNoExtremities) {
+ vector<int> symbols = {87};
+ Phrase phrase = phrase_builder->Build(symbols);
+ vector<int> matching = {2};
+ PhraseLocation phrase_location(matching, 1);
+
+ EXPECT_CALL(*helper, GetLinksSpans(_, _, _, _, _)).Times(1);
+ vector<pair<int, int> > gaps(3);
+ // Set FindFixPoint to return true. The number of gaps equals the number of
+ // nonterminals, so we won't add any extremities.
+ helper->SetUp(0, 0, 0, 0, true, gaps, gaps, 0, true, true);
+
+ vector<Rule> rules = extractor->ExtractRules(phrase, phrase_location);
+ EXPECT_EQ(1, rules.size());
+}
+
+TEST_F(RuleExtractorTest, TestExtractRulesAddExtremities) {
+ vector<int> symbols = {87};
+ Phrase phrase = phrase_builder->Build(symbols);
+ vector<int> matching = {2};
+ PhraseLocation phrase_location(matching, 1);
+
+ vector<int> links(10, -1);
+ EXPECT_CALL(*helper, GetLinksSpans(_, _, _, _, _)).WillOnce(DoAll(
+ SetArgReferee<0>(links),
+ SetArgReferee<1>(links),
+ SetArgReferee<2>(links),
+ SetArgReferee<3>(links)));
+
+ vector<pair<int, int> > gaps;
+ // Set FindFixPoint to return true. The number of gaps equals the number of
+ // nonterminals, so we won't add any extremities.
+ helper->SetUp(0, 0, 2, 3, true, gaps, gaps, 0, true, true);
+
+ vector<Rule> rules = extractor->ExtractRules(phrase, phrase_location);
+ EXPECT_EQ(4, rules.size());
+}
+
+} // namespace
diff --git a/extractor/rule_factory.cc b/extractor/rule_factory.cc
new file mode 100644
index 00000000..4101fcfa
--- /dev/null
+++ b/extractor/rule_factory.cc
@@ -0,0 +1,305 @@
+#include "rule_factory.h"
+
+#include <chrono>
+#include <memory>
+#include <queue>
+#include <vector>
+
+#include "grammar.h"
+#include "fast_intersector.h"
+#include "intersector.h"
+#include "matchings_finder.h"
+#include "matching_comparator.h"
+#include "phrase.h"
+#include "rule.h"
+#include "rule_extractor.h"
+#include "sampler.h"
+#include "scorer.h"
+#include "suffix_array.h"
+#include "time_util.h"
+#include "vocabulary.h"
+
+using namespace std;
+using namespace chrono;
+
+typedef high_resolution_clock Clock;
+
+struct State {
+ State(int start, int end, const vector<int>& phrase,
+ const vector<int>& subpatterns_start, shared_ptr<TrieNode> node,
+ bool starts_with_x) :
+ start(start), end(end), phrase(phrase),
+ subpatterns_start(subpatterns_start), node(node),
+ starts_with_x(starts_with_x) {}
+
+ int start, end;
+ vector<int> phrase, subpatterns_start;
+ shared_ptr<TrieNode> node;
+ bool starts_with_x;
+};
+
+HieroCachingRuleFactory::HieroCachingRuleFactory(
+ shared_ptr<SuffixArray> source_suffix_array,
+ shared_ptr<DataArray> target_data_array,
+ shared_ptr<Alignment> alignment,
+ const shared_ptr<Vocabulary>& vocabulary,
+ shared_ptr<Precomputation> precomputation,
+ shared_ptr<Scorer> scorer,
+ int min_gap_size,
+ int max_rule_span,
+ int max_nonterminals,
+ int max_rule_symbols,
+ int max_samples,
+ bool use_fast_intersect,
+ bool use_baeza_yates,
+ bool require_tight_phrases) :
+ vocabulary(vocabulary),
+ scorer(scorer),
+ min_gap_size(min_gap_size),
+ max_rule_span(max_rule_span),
+ max_nonterminals(max_nonterminals),
+ max_chunks(max_nonterminals + 1),
+ max_rule_symbols(max_rule_symbols),
+ use_fast_intersect(use_fast_intersect) {
+ matchings_finder = make_shared<MatchingsFinder>(source_suffix_array);
+ shared_ptr<MatchingComparator> comparator =
+ make_shared<MatchingComparator>(min_gap_size, max_rule_span);
+ intersector = make_shared<Intersector>(vocabulary, precomputation,
+ source_suffix_array, comparator, use_baeza_yates);
+ fast_intersector = make_shared<FastIntersector>(source_suffix_array,
+ precomputation, vocabulary, max_rule_span, min_gap_size);
+ phrase_builder = make_shared<PhraseBuilder>(vocabulary);
+ rule_extractor = make_shared<RuleExtractor>(source_suffix_array->GetData(),
+ target_data_array, alignment, phrase_builder, scorer, vocabulary,
+ max_rule_span, min_gap_size, max_nonterminals, max_rule_symbols, true,
+ false, require_tight_phrases);
+ sampler = make_shared<Sampler>(source_suffix_array, max_samples);
+}
+
+HieroCachingRuleFactory::HieroCachingRuleFactory(
+ shared_ptr<MatchingsFinder> finder,
+ shared_ptr<Intersector> intersector,
+ shared_ptr<FastIntersector> fast_intersector,
+ shared_ptr<PhraseBuilder> phrase_builder,
+ shared_ptr<RuleExtractor> rule_extractor,
+ shared_ptr<Vocabulary> vocabulary,
+ shared_ptr<Sampler> sampler,
+ shared_ptr<Scorer> scorer,
+ int min_gap_size,
+ int max_rule_span,
+ int max_nonterminals,
+ int max_chunks,
+ int max_rule_symbols,
+ bool use_fast_intersect) :
+ matchings_finder(finder),
+ intersector(intersector),
+ fast_intersector(fast_intersector),
+ phrase_builder(phrase_builder),
+ rule_extractor(rule_extractor),
+ vocabulary(vocabulary),
+ sampler(sampler),
+ scorer(scorer),
+ min_gap_size(min_gap_size),
+ max_rule_span(max_rule_span),
+ max_nonterminals(max_nonterminals),
+ max_chunks(max_chunks),
+ max_rule_symbols(max_rule_symbols),
+ use_fast_intersect(use_fast_intersect) {}
+
+HieroCachingRuleFactory::HieroCachingRuleFactory() {}
+
+HieroCachingRuleFactory::~HieroCachingRuleFactory() {}
+
+Grammar HieroCachingRuleFactory::GetGrammar(const vector<int>& word_ids) {
+ intersector->sort_time = 0;
+ Clock::time_point start_time = Clock::now();
+ double total_extract_time = 0;
+ double total_intersect_time = 0;
+ double total_lookup_time = 0;
+ // Clear cache for every new sentence.
+ trie.Reset();
+ shared_ptr<TrieNode> root = trie.GetRoot();
+
+ int first_x = vocabulary->GetNonterminalIndex(1);
+ shared_ptr<TrieNode> x_root(new TrieNode(root));
+ root->AddChild(first_x, x_root);
+
+ queue<State> states;
+ for (size_t i = 0; i < word_ids.size(); ++i) {
+ states.push(State(i, i, vector<int>(), vector<int>(1, i), root, false));
+ }
+ for (size_t i = min_gap_size; i < word_ids.size(); ++i) {
+ states.push(State(i - min_gap_size, i, vector<int>(1, first_x),
+ vector<int>(1, i), x_root, true));
+ }
+
+ vector<Rule> rules;
+ while (!states.empty()) {
+ State state = states.front();
+ states.pop();
+
+ shared_ptr<TrieNode> node = state.node;
+ vector<int> phrase = state.phrase;
+ int word_id = word_ids[state.end];
+ phrase.push_back(word_id);
+ Phrase next_phrase = phrase_builder->Build(phrase);
+ shared_ptr<TrieNode> next_node;
+
+ if (CannotHaveMatchings(node, word_id)) {
+ if (!node->HasChild(word_id)) {
+ node->AddChild(word_id, shared_ptr<TrieNode>());
+ }
+ continue;
+ }
+
+ if (RequiresLookup(node, word_id)) {
+ shared_ptr<TrieNode> next_suffix_link = node->suffix_link == NULL ?
+ trie.GetRoot() : node->suffix_link->GetChild(word_id);
+ if (state.starts_with_x) {
+ // If the phrase starts with a non terminal, we simply use the matchings
+ // from the suffix link.
+ next_node = make_shared<TrieNode>(
+ next_suffix_link, next_phrase, next_suffix_link->matchings);
+ } else {
+ PhraseLocation phrase_location;
+ if (next_phrase.Arity() > 0) {
+ Clock::time_point intersect_start = Clock::now();
+ if (use_fast_intersect) {
+ phrase_location = fast_intersector->Intersect(
+ node->matchings, next_suffix_link->matchings, next_phrase);
+ } else {
+ phrase_location = intersector->Intersect(
+ node->phrase,
+ node->matchings,
+ next_suffix_link->phrase,
+ next_suffix_link->matchings,
+ next_phrase);
+ }
+ Clock::time_point intersect_stop = Clock::now();
+ total_intersect_time += GetDuration(intersect_start, intersect_stop);
+ } else {
+ Clock::time_point lookup_start = Clock::now();
+ phrase_location = matchings_finder->Find(
+ node->matchings,
+ vocabulary->GetTerminalValue(word_id),
+ state.phrase.size());
+ Clock::time_point lookup_stop = Clock::now();
+ total_lookup_time += GetDuration(lookup_start, lookup_stop);
+ }
+
+ if (phrase_location.IsEmpty()) {
+ continue;
+ }
+ next_node = make_shared<TrieNode>(
+ next_suffix_link, next_phrase, phrase_location);
+ }
+ node->AddChild(word_id, next_node);
+
+ // Automatically adds a trailing non terminal if allowed. Simply copy the
+ // matchings from the prefix node.
+ AddTrailingNonterminal(phrase, next_phrase, next_node,
+ state.starts_with_x);
+
+ Clock::time_point extract_start = Clock::now();
+ if (!state.starts_with_x) {
+ PhraseLocation sample = sampler->Sample(next_node->matchings);
+ vector<Rule> new_rules =
+ rule_extractor->ExtractRules(next_phrase, sample);
+ rules.insert(rules.end(), new_rules.begin(), new_rules.end());
+ }
+ Clock::time_point extract_stop = Clock::now();
+ total_extract_time += GetDuration(extract_start, extract_stop);
+ } else {
+ next_node = node->GetChild(word_id);
+ }
+
+ vector<State> new_states = ExtendState(word_ids, state, phrase, next_phrase,
+ next_node);
+ for (State new_state: new_states) {
+ states.push(new_state);
+ }
+ }
+
+ Clock::time_point stop_time = Clock::now();
+ cerr << "Total time for rule lookup, extraction, and scoring = "
+ << GetDuration(start_time, stop_time) << " seconds" << endl;
+ cerr << "Extract time = " << total_extract_time << " seconds" << endl;
+ cerr << "Intersect time = " << total_intersect_time << " seconds" << endl;
+ cerr << "Lookup time = " << total_lookup_time << " seconds" << endl;
+ return Grammar(rules, scorer->GetFeatureNames());
+}
+
+bool HieroCachingRuleFactory::CannotHaveMatchings(
+ shared_ptr<TrieNode> node, int word_id) {
+ if (node->HasChild(word_id) && node->GetChild(word_id) == NULL) {
+ return true;
+ }
+
+ shared_ptr<TrieNode> suffix_link = node->suffix_link;
+ return suffix_link != NULL && suffix_link->GetChild(word_id) == NULL;
+}
+
+bool HieroCachingRuleFactory::RequiresLookup(
+ shared_ptr<TrieNode> node, int word_id) {
+ return !node->HasChild(word_id);
+}
+
+void HieroCachingRuleFactory::AddTrailingNonterminal(
+ vector<int> symbols,
+ const Phrase& prefix,
+ const shared_ptr<TrieNode>& prefix_node,
+ bool starts_with_x) {
+ if (prefix.Arity() >= max_nonterminals) {
+ return;
+ }
+
+ int var_id = vocabulary->GetNonterminalIndex(prefix.Arity() + 1);
+ symbols.push_back(var_id);
+ Phrase var_phrase = phrase_builder->Build(symbols);
+
+ int suffix_var_id = vocabulary->GetNonterminalIndex(
+ prefix.Arity() + (starts_with_x == 0));
+ shared_ptr<TrieNode> var_suffix_link =
+ prefix_node->suffix_link->GetChild(suffix_var_id);
+
+ prefix_node->AddChild(var_id, make_shared<TrieNode>(
+ var_suffix_link, var_phrase, prefix_node->matchings));
+}
+
+vector<State> HieroCachingRuleFactory::ExtendState(
+ const vector<int>& word_ids,
+ const State& state,
+ vector<int> symbols,
+ const Phrase& phrase,
+ const shared_ptr<TrieNode>& node) {
+ int span = state.end - state.start;
+ vector<State> new_states;
+ if (symbols.size() >= max_rule_symbols || state.end + 1 >= word_ids.size() ||
+ span >= max_rule_span) {
+ return new_states;
+ }
+
+ new_states.push_back(State(state.start, state.end + 1, symbols,
+ state.subpatterns_start, node, state.starts_with_x));
+
+ int num_subpatterns = phrase.Arity() + (state.starts_with_x == 0);
+ if (symbols.size() + 1 >= max_rule_symbols ||
+ phrase.Arity() >= max_nonterminals ||
+ num_subpatterns >= max_chunks) {
+ return new_states;
+ }
+
+ int var_id = vocabulary->GetNonterminalIndex(phrase.Arity() + 1);
+ symbols.push_back(var_id);
+ vector<int> subpatterns_start = state.subpatterns_start;
+ size_t i = state.end + 1 + min_gap_size;
+ while (i < word_ids.size() && i - state.start <= max_rule_span) {
+ subpatterns_start.push_back(i);
+ new_states.push_back(State(state.start, i, symbols, subpatterns_start,
+ node->GetChild(var_id), state.starts_with_x));
+ subpatterns_start.pop_back();
+ ++i;
+ }
+
+ return new_states;
+}
diff --git a/extractor/rule_factory.h b/extractor/rule_factory.h
new file mode 100644
index 00000000..a39386a8
--- /dev/null
+++ b/extractor/rule_factory.h
@@ -0,0 +1,102 @@
+#ifndef _RULE_FACTORY_H_
+#define _RULE_FACTORY_H_
+
+#include <memory>
+#include <vector>
+
+#include "matchings_trie.h"
+#include "phrase_builder.h"
+
+using namespace std;
+
+class Alignment;
+class DataArray;
+class Grammar;
+class MatchingsFinder;
+class FastIntersector;
+class Intersector;
+class Precomputation;
+class Rule;
+class RuleExtractor;
+class Sampler;
+class Scorer;
+class State;
+class SuffixArray;
+class Vocabulary;
+
+class HieroCachingRuleFactory {
+ public:
+ HieroCachingRuleFactory(
+ shared_ptr<SuffixArray> source_suffix_array,
+ shared_ptr<DataArray> target_data_array,
+ shared_ptr<Alignment> alignment,
+ const shared_ptr<Vocabulary>& vocabulary,
+ shared_ptr<Precomputation> precomputation,
+ shared_ptr<Scorer> scorer,
+ int min_gap_size,
+ int max_rule_span,
+ int max_nonterminals,
+ int max_rule_symbols,
+ int max_samples,
+ bool use_fast_intersect,
+ bool use_beaza_yates,
+ bool require_tight_phrases);
+
+ // For testing only.
+ HieroCachingRuleFactory(
+ shared_ptr<MatchingsFinder> finder,
+ shared_ptr<Intersector> intersector,
+ shared_ptr<FastIntersector> fast_intersector,
+ shared_ptr<PhraseBuilder> phrase_builder,
+ shared_ptr<RuleExtractor> rule_extractor,
+ shared_ptr<Vocabulary> vocabulary,
+ shared_ptr<Sampler> sampler,
+ shared_ptr<Scorer> scorer,
+ int min_gap_size,
+ int max_rule_span,
+ int max_nonterminals,
+ int max_chunks,
+ int max_rule_symbols,
+ bool use_fast_intersect);
+
+ virtual ~HieroCachingRuleFactory();
+
+ virtual Grammar GetGrammar(const vector<int>& word_ids);
+
+ protected:
+ HieroCachingRuleFactory();
+
+ private:
+ bool CannotHaveMatchings(shared_ptr<TrieNode> node, int word_id);
+
+ bool RequiresLookup(shared_ptr<TrieNode> node, int word_id);
+
+ void AddTrailingNonterminal(vector<int> symbols,
+ const Phrase& prefix,
+ const shared_ptr<TrieNode>& prefix_node,
+ bool starts_with_x);
+
+ vector<State> ExtendState(const vector<int>& word_ids,
+ const State& state,
+ vector<int> symbols,
+ const Phrase& phrase,
+ const shared_ptr<TrieNode>& node);
+
+ shared_ptr<MatchingsFinder> matchings_finder;
+ shared_ptr<Intersector> intersector;
+ shared_ptr<FastIntersector> fast_intersector;
+ MatchingsTrie trie;
+ shared_ptr<PhraseBuilder> phrase_builder;
+ shared_ptr<RuleExtractor> rule_extractor;
+ shared_ptr<Vocabulary> vocabulary;
+ shared_ptr<Sampler> sampler;
+ shared_ptr<Scorer> scorer;
+ int min_gap_size;
+ int max_rule_span;
+ int max_nonterminals;
+ int max_chunks;
+ int max_rule_symbols;
+ bool use_fast_intersect;
+};
+
+#endif
diff --git a/extractor/rule_factory_test.cc b/extractor/rule_factory_test.cc
new file mode 100644
index 00000000..d329382a
--- /dev/null
+++ b/extractor/rule_factory_test.cc
@@ -0,0 +1,146 @@
+#include <gtest/gtest.h>
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "grammar.h"
+#include "mocks/mock_fast_intersector.h"
+#include "mocks/mock_intersector.h"
+#include "mocks/mock_matchings_finder.h"
+#include "mocks/mock_rule_extractor.h"
+#include "mocks/mock_sampler.h"
+#include "mocks/mock_scorer.h"
+#include "mocks/mock_vocabulary.h"
+#include "phrase_builder.h"
+#include "phrase_location.h"
+#include "rule_factory.h"
+
+using namespace std;
+using namespace ::testing;
+
+namespace {
+
+class RuleFactoryTest : public Test {
+ protected:
+ virtual void SetUp() {
+ finder = make_shared<MockMatchingsFinder>();
+ intersector = make_shared<MockIntersector>();
+ fast_intersector = make_shared<MockFastIntersector>();
+
+ vocabulary = make_shared<MockVocabulary>();
+ EXPECT_CALL(*vocabulary, GetTerminalValue(2)).WillRepeatedly(Return("a"));
+ EXPECT_CALL(*vocabulary, GetTerminalValue(3)).WillRepeatedly(Return("b"));
+ EXPECT_CALL(*vocabulary, GetTerminalValue(4)).WillRepeatedly(Return("c"));
+
+ phrase_builder = make_shared<PhraseBuilder>(vocabulary);
+
+ scorer = make_shared<MockScorer>();
+ feature_names = {"f1"};
+ EXPECT_CALL(*scorer, GetFeatureNames())
+ .WillRepeatedly(Return(feature_names));
+
+ sampler = make_shared<MockSampler>();
+ EXPECT_CALL(*sampler, Sample(_))
+ .WillRepeatedly(Return(PhraseLocation(0, 1)));
+
+ Phrase phrase;
+ vector<double> scores = {0.5};
+ vector<pair<int, int> > phrase_alignment = {make_pair(0, 0)};
+ vector<Rule> rules = {Rule(phrase, phrase, scores, phrase_alignment)};
+ extractor = make_shared<MockRuleExtractor>();
+ EXPECT_CALL(*extractor, ExtractRules(_, _))
+ .WillRepeatedly(Return(rules));
+ }
+
+ vector<string> feature_names;
+ shared_ptr<MockMatchingsFinder> finder;
+ shared_ptr<MockIntersector> intersector;
+ shared_ptr<MockFastIntersector> fast_intersector;
+ shared_ptr<MockVocabulary> vocabulary;
+ shared_ptr<PhraseBuilder> phrase_builder;
+ shared_ptr<MockScorer> scorer;
+ shared_ptr<MockSampler> sampler;
+ shared_ptr<MockRuleExtractor> extractor;
+ shared_ptr<HieroCachingRuleFactory> factory;
+};
+
+TEST_F(RuleFactoryTest, TestGetGrammarDifferentWords) {
+ factory = make_shared<HieroCachingRuleFactory>(finder, intersector,
+ fast_intersector, phrase_builder, extractor, vocabulary, sampler,
+ scorer, 1, 10, 2, 3, 5, false);
+
+ EXPECT_CALL(*finder, Find(_, _, _))
+ .Times(6)
+ .WillRepeatedly(Return(PhraseLocation(0, 1)));
+
+ EXPECT_CALL(*intersector, Intersect(_, _, _, _, _))
+ .Times(1)
+ .WillRepeatedly(Return(PhraseLocation(0, 1)));
+ EXPECT_CALL(*fast_intersector, Intersect(_, _, _)).Times(0);
+
+ vector<int> word_ids = {2, 3, 4};
+ Grammar grammar = factory->GetGrammar(word_ids);
+ EXPECT_EQ(feature_names, grammar.GetFeatureNames());
+ EXPECT_EQ(7, grammar.GetRules().size());
+
+ // Test for fast intersector.
+ factory = make_shared<HieroCachingRuleFactory>(finder, intersector,
+ fast_intersector, phrase_builder, extractor, vocabulary, sampler,
+ scorer, 1, 10, 2, 3, 5, true);
+
+ EXPECT_CALL(*finder, Find(_, _, _))
+ .Times(6)
+ .WillRepeatedly(Return(PhraseLocation(0, 1)));
+
+ EXPECT_CALL(*fast_intersector, Intersect(_, _, _))
+ .Times(1)
+ .WillRepeatedly(Return(PhraseLocation(0, 1)));
+ EXPECT_CALL(*intersector, Intersect(_, _, _, _, _)).Times(0);
+
+ grammar = factory->GetGrammar(word_ids);
+ EXPECT_EQ(feature_names, grammar.GetFeatureNames());
+ EXPECT_EQ(7, grammar.GetRules().size());
+}
+
+TEST_F(RuleFactoryTest, TestGetGrammarRepeatingWords) {
+ factory = make_shared<HieroCachingRuleFactory>(finder, intersector,
+ fast_intersector, phrase_builder, extractor, vocabulary, sampler,
+ scorer, 1, 10, 2, 3, 5, false);
+
+ EXPECT_CALL(*finder, Find(_, _, _))
+ .Times(12)
+ .WillRepeatedly(Return(PhraseLocation(0, 1)));
+
+ EXPECT_CALL(*intersector, Intersect(_, _, _, _, _))
+ .Times(16)
+ .WillRepeatedly(Return(PhraseLocation(0, 1)));
+
+ EXPECT_CALL(*fast_intersector, Intersect(_, _, _)).Times(0);
+
+ vector<int> word_ids = {2, 3, 4, 2, 3};
+ Grammar grammar = factory->GetGrammar(word_ids);
+ EXPECT_EQ(feature_names, grammar.GetFeatureNames());
+ EXPECT_EQ(28, grammar.GetRules().size());
+
+ // Test for fast intersector.
+ factory = make_shared<HieroCachingRuleFactory>(finder, intersector,
+ fast_intersector, phrase_builder, extractor, vocabulary, sampler,
+ scorer, 1, 10, 2, 3, 5, true);
+
+ EXPECT_CALL(*finder, Find(_, _, _))
+ .Times(12)
+ .WillRepeatedly(Return(PhraseLocation(0, 1)));
+
+ EXPECT_CALL(*fast_intersector, Intersect(_, _, _))
+ .Times(16)
+ .WillRepeatedly(Return(PhraseLocation(0, 1)));
+
+ EXPECT_CALL(*intersector, Intersect(_, _, _, _, _)).Times(0);
+
+ grammar = factory->GetGrammar(word_ids);
+ EXPECT_EQ(feature_names, grammar.GetFeatureNames());
+ EXPECT_EQ(28, grammar.GetRules().size());
+}
+
+} // namespace
diff --git a/extractor/run_extractor.cc b/extractor/run_extractor.cc
new file mode 100644
index 00000000..38f10a5f
--- /dev/null
+++ b/extractor/run_extractor.cc
@@ -0,0 +1,208 @@
+#include <chrono>
+#include <fstream>
+#include <iostream>
+#include <string>
+#include <vector>
+
+#include <boost/filesystem.hpp>
+#include <boost/program_options.hpp>
+#include <boost/program_options/variables_map.hpp>
+
+#include "alignment.h"
+#include "data_array.h"
+#include "features/count_source_target.h"
+#include "features/feature.h"
+#include "features/is_source_singleton.h"
+#include "features/is_source_target_singleton.h"
+#include "features/max_lex_source_given_target.h"
+#include "features/max_lex_target_given_source.h"
+#include "features/sample_source_count.h"
+#include "features/target_given_source_coherent.h"
+#include "grammar.h"
+#include "grammar_extractor.h"
+#include "precomputation.h"
+#include "rule.h"
+#include "scorer.h"
+#include "suffix_array.h"
+#include "time_util.h"
+#include "translation_table.h"
+
+namespace fs = boost::filesystem;
+namespace po = boost::program_options;
+using namespace std;
+
+int main(int argc, char** argv) {
+ // TODO(pauldb): Also take arguments from config file.
+ po::options_description desc("Command line options");
+ desc.add_options()
+ ("help,h", "Show available options")
+ ("source,f", po::value<string>(), "Source language corpus")
+ ("target,e", po::value<string>(), "Target language corpus")
+ ("bitext,b", po::value<string>(), "Parallel text (source ||| target)")
+ ("alignment,a", po::value<string>()->required(), "Bitext word alignment")
+ ("grammars,g", po::value<string>()->required(), "Grammars output path")
+ ("frequent", po::value<int>()->default_value(100),
+ "Number of precomputed frequent patterns")
+ ("super_frequent", po::value<int>()->default_value(10),
+ "Number of precomputed super frequent patterns")
+ ("max_rule_span", po::value<int>()->default_value(15),
+ "Maximum rule span")
+ ("max_rule_symbols,l", po::value<int>()->default_value(5),
+ "Maximum number of symbols (terminals + nontermals) in a rule")
+ ("min_gap_size", po::value<int>()->default_value(1), "Minimum gap size")
+ ("max_phrase_len", po::value<int>()->default_value(4),
+ "Maximum frequent phrase length")
+ ("max_nonterminals", po::value<int>()->default_value(2),
+ "Maximum number of nonterminals in a rule")
+ ("min_frequency", po::value<int>()->default_value(1000),
+ "Minimum number of occurences for a pharse to be considered frequent")
+ ("max_samples", po::value<int>()->default_value(300),
+ "Maximum number of samples")
+ ("fast_intersect", po::value<bool>()->default_value(false),
+ "Enable fast intersect")
+ // TODO(pauldb): Check if this works when set to false.
+ ("tight_phrases", po::value<bool>()->default_value(true),
+ "False if phrases may be loose (better, but slower)")
+ ("baeza_yates", po::value<bool>()->default_value(true),
+ "Use double binary search");
+
+ po::variables_map vm;
+ po::store(po::parse_command_line(argc, argv, desc), vm);
+
+ // Check for help argument before notify, so we don't need to pass in the
+ // required parameters.
+ if (vm.count("help")) {
+ cout << desc << endl;
+ return 0;
+ }
+
+ po::notify(vm);
+
+ if (!((vm.count("source") && vm.count("target")) || vm.count("bitext"))) {
+ cerr << "A paralel corpus is required. "
+ << "Use -f (source) with -e (target) or -b (bitext)."
+ << endl;
+ return 1;
+ }
+
+ Clock::time_point preprocess_start_time = Clock::now();
+ cerr << "Reading source and target data..." << endl;
+ Clock::time_point start_time = Clock::now();
+ shared_ptr<DataArray> source_data_array, target_data_array;
+ if (vm.count("bitext")) {
+ source_data_array = make_shared<DataArray>(
+ vm["bitext"].as<string>(), SOURCE);
+ target_data_array = make_shared<DataArray>(
+ vm["bitext"].as<string>(), TARGET);
+ } else {
+ source_data_array = make_shared<DataArray>(vm["source"].as<string>());
+ target_data_array = make_shared<DataArray>(vm["target"].as<string>());
+ }
+ Clock::time_point stop_time = Clock::now();
+ cerr << "Reading data took " << GetDuration(start_time, stop_time)
+ << " seconds" << endl;
+
+ cerr << "Creating source suffix array..." << endl;
+ start_time = Clock::now();
+ shared_ptr<SuffixArray> source_suffix_array =
+ make_shared<SuffixArray>(source_data_array);
+ stop_time = Clock::now();
+ cerr << "Creating suffix array took "
+ << GetDuration(start_time, stop_time) << " seconds" << endl;
+
+ cerr << "Reading alignment..." << endl;
+ start_time = Clock::now();
+ shared_ptr<Alignment> alignment =
+ make_shared<Alignment>(vm["alignment"].as<string>());
+ stop_time = Clock::now();
+ cerr << "Reading alignment took "
+ << GetDuration(start_time, stop_time) << " seconds" << endl;
+
+ cerr << "Precomputating collocations..." << endl;
+ start_time = Clock::now();
+ shared_ptr<Precomputation> precomputation = make_shared<Precomputation>(
+ source_suffix_array,
+ vm["frequent"].as<int>(),
+ vm["super_frequent"].as<int>(),
+ vm["max_rule_span"].as<int>(),
+ vm["max_rule_symbols"].as<int>(),
+ vm["min_gap_size"].as<int>(),
+ vm["max_phrase_len"].as<int>(),
+ vm["min_frequency"].as<int>());
+ stop_time = Clock::now();
+ cerr << "Precomputing collocations took "
+ << GetDuration(start_time, stop_time) << " seconds" << endl;
+
+ cerr << "Precomputing conditional probabilities..." << endl;
+ start_time = Clock::now();
+ shared_ptr<TranslationTable> table = make_shared<TranslationTable>(
+ source_data_array, target_data_array, alignment);
+ stop_time = Clock::now();
+ cerr << "Precomputing conditional probabilities took "
+ << GetDuration(start_time, stop_time) << " seconds" << endl;
+
+ Clock::time_point preprocess_stop_time = Clock::now();
+ cerr << "Overall preprocessing step took "
+ << GetDuration(preprocess_start_time, preprocess_stop_time)
+ << " seconds" << endl;
+
+ Clock::time_point extraction_start_time = Clock::now();
+ vector<shared_ptr<Feature> > features = {
+ make_shared<TargetGivenSourceCoherent>(),
+ make_shared<SampleSourceCount>(),
+ make_shared<CountSourceTarget>(),
+ make_shared<MaxLexSourceGivenTarget>(table),
+ make_shared<MaxLexTargetGivenSource>(table),
+ make_shared<IsSourceSingleton>(),
+ make_shared<IsSourceTargetSingleton>()
+ };
+ shared_ptr<Scorer> scorer = make_shared<Scorer>(features);
+
+ // TODO(pauldb): Add parallelization.
+ GrammarExtractor extractor(
+ source_suffix_array,
+ target_data_array,
+ alignment,
+ precomputation,
+ scorer,
+ vm["min_gap_size"].as<int>(),
+ vm["max_rule_span"].as<int>(),
+ vm["max_nonterminals"].as<int>(),
+ vm["max_rule_symbols"].as<int>(),
+ vm["max_samples"].as<int>(),
+ vm["fast_intersect"].as<bool>(),
+ vm["baeza_yates"].as<bool>(),
+ vm["tight_phrases"].as<bool>());
+
+ int grammar_id = 0;
+ fs::path grammar_path = vm["grammars"].as<string>();
+ if (!fs::is_directory(grammar_path)) {
+ fs::create_directory(grammar_path);
+ }
+
+ string sentence, delimiter = "|||";
+ while (getline(cin, sentence)) {
+ string suffix = "";
+ int position = sentence.find(delimiter);
+ if (position != sentence.npos) {
+ suffix = sentence.substr(position);
+ sentence = sentence.substr(0, position);
+ }
+
+ Grammar grammar = extractor.GetGrammar(sentence);
+ string file_name = "grammar." + to_string(grammar_id);
+ fs::path grammar_file = grammar_path / file_name;
+ ofstream output(grammar_file.c_str());
+ output << grammar;
+
+ cout << "<seg grammar=\"" << grammar_file << "\" id=\"" << grammar_id
+ << "\"> " << sentence << " </seg> " << suffix << endl;
+ ++grammar_id;
+ }
+ Clock::time_point extraction_stop_time = Clock::now();
+ cerr << "Overall extraction step took "
+ << GetDuration(extraction_start_time, extraction_stop_time)
+ << " seconds" << endl;
+
+ return 0;
+}
diff --git a/extractor/sample_alignment.txt b/extractor/sample_alignment.txt
new file mode 100644
index 00000000..80b446a4
--- /dev/null
+++ b/extractor/sample_alignment.txt
@@ -0,0 +1,2 @@
+0-0 1-1 2-2
+1-0 2-1
diff --git a/extractor/sample_bitext.txt b/extractor/sample_bitext.txt
new file mode 100644
index 00000000..93d6b39d
--- /dev/null
+++ b/extractor/sample_bitext.txt
@@ -0,0 +1,2 @@
+ana are mere . ||| anna has apples .
+ana bea mult lapte . ||| anna drinks a lot of milk .
diff --git a/extractor/sampler.cc b/extractor/sampler.cc
new file mode 100644
index 00000000..5067ca8a
--- /dev/null
+++ b/extractor/sampler.cc
@@ -0,0 +1,41 @@
+#include "sampler.h"
+
+#include "phrase_location.h"
+#include "suffix_array.h"
+
+Sampler::Sampler(shared_ptr<SuffixArray> suffix_array, int max_samples) :
+ suffix_array(suffix_array), max_samples(max_samples) {}
+
+Sampler::Sampler() {}
+
+Sampler::~Sampler() {}
+
+PhraseLocation Sampler::Sample(const PhraseLocation& location) const {
+ vector<int> sample;
+ int num_subpatterns;
+ if (location.matchings == NULL) {
+ num_subpatterns = 1;
+ int low = location.sa_low, high = location.sa_high;
+ double step = max(1.0, (double) (high - low) / max_samples);
+ for (double i = low; i < high && sample.size() < max_samples; i += step) {
+ sample.push_back(suffix_array->GetSuffix(Round(i)));
+ }
+ } else {
+ num_subpatterns = location.num_subpatterns;
+ int num_matchings = location.matchings->size() / num_subpatterns;
+ double step = max(1.0, (double) num_matchings / max_samples);
+ for (double i = 0, num_samples = 0;
+ i < num_matchings && num_samples < max_samples;
+ i += step, ++num_samples) {
+ int start = Round(i) * num_subpatterns;
+ sample.insert(sample.end(), location.matchings->begin() + start,
+ location.matchings->begin() + start + num_subpatterns);
+ }
+ }
+ return PhraseLocation(sample, num_subpatterns);
+}
+
+int Sampler::Round(double x) const {
+ // TODO(pauldb): Remove EPS.
+ return x + 0.5 + 1e-8;
+}
diff --git a/extractor/sampler.h b/extractor/sampler.h
new file mode 100644
index 00000000..9cf321fb
--- /dev/null
+++ b/extractor/sampler.h
@@ -0,0 +1,29 @@
+#ifndef _SAMPLER_H_
+#define _SAMPLER_H_
+
+#include <memory>
+
+using namespace std;
+
+class PhraseLocation;
+class SuffixArray;
+
+class Sampler {
+ public:
+ Sampler(shared_ptr<SuffixArray> suffix_array, int max_samples);
+
+ virtual ~Sampler();
+
+ virtual PhraseLocation Sample(const PhraseLocation& location) const;
+
+ protected:
+ Sampler();
+
+ private:
+ int Round(double x) const;
+
+ shared_ptr<SuffixArray> suffix_array;
+ int max_samples;
+};
+
+#endif
diff --git a/extractor/sampler_test.cc b/extractor/sampler_test.cc
new file mode 100644
index 00000000..4f91965b
--- /dev/null
+++ b/extractor/sampler_test.cc
@@ -0,0 +1,72 @@
+#include <gtest/gtest.h>
+
+#include <memory>
+
+#include "mocks/mock_suffix_array.h"
+#include "phrase_location.h"
+#include "sampler.h"
+
+using namespace std;
+using namespace ::testing;
+
+namespace {
+
+class SamplerTest : public Test {
+ protected:
+ virtual void SetUp() {
+ suffix_array = make_shared<MockSuffixArray>();
+ for (int i = 0; i < 10; ++i) {
+ EXPECT_CALL(*suffix_array, GetSuffix(i)).WillRepeatedly(Return(i));
+ }
+ }
+
+ shared_ptr<MockSuffixArray> suffix_array;
+ shared_ptr<Sampler> sampler;
+};
+
+TEST_F(SamplerTest, TestSuffixArrayRange) {
+ PhraseLocation location(0, 10);
+
+ sampler = make_shared<Sampler>(suffix_array, 1);
+ vector<int> expected_locations = {0};
+ EXPECT_EQ(PhraseLocation(expected_locations, 1), sampler->Sample(location));
+
+ sampler = make_shared<Sampler>(suffix_array, 2);
+ expected_locations = {0, 5};
+ EXPECT_EQ(PhraseLocation(expected_locations, 1), sampler->Sample(location));
+
+ sampler = make_shared<Sampler>(suffix_array, 3);
+ expected_locations = {0, 3, 7};
+ EXPECT_EQ(PhraseLocation(expected_locations, 1), sampler->Sample(location));
+
+ sampler = make_shared<Sampler>(suffix_array, 4);
+ expected_locations = {0, 3, 5, 8};
+ EXPECT_EQ(PhraseLocation(expected_locations, 1), sampler->Sample(location));
+
+ sampler = make_shared<Sampler>(suffix_array, 100);
+ expected_locations = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+ EXPECT_EQ(PhraseLocation(expected_locations, 1), sampler->Sample(location));
+}
+
+TEST_F(SamplerTest, TestSubstringsSample) {
+ vector<int> locations = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+ PhraseLocation location(locations, 2);
+
+ sampler = make_shared<Sampler>(suffix_array, 1);
+ vector<int> expected_locations = {0, 1};
+ EXPECT_EQ(PhraseLocation(expected_locations, 2), sampler->Sample(location));
+
+ sampler = make_shared<Sampler>(suffix_array, 2);
+ expected_locations = {0, 1, 6, 7};
+ EXPECT_EQ(PhraseLocation(expected_locations, 2), sampler->Sample(location));
+
+ sampler = make_shared<Sampler>(suffix_array, 3);
+ expected_locations = {0, 1, 4, 5, 6, 7};
+ EXPECT_EQ(PhraseLocation(expected_locations, 2), sampler->Sample(location));
+
+ sampler = make_shared<Sampler>(suffix_array, 7);
+ expected_locations = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
+ EXPECT_EQ(PhraseLocation(expected_locations, 2), sampler->Sample(location));
+}
+
+} // namespace
diff --git a/extractor/scorer.cc b/extractor/scorer.cc
new file mode 100644
index 00000000..f28b3181
--- /dev/null
+++ b/extractor/scorer.cc
@@ -0,0 +1,26 @@
+#include "scorer.h"
+
+#include "features/feature.h"
+
+Scorer::Scorer(const vector<shared_ptr<Feature> >& features) :
+ features(features) {}
+
+Scorer::Scorer() {}
+
+Scorer::~Scorer() {}
+
+vector<double> Scorer::Score(const FeatureContext& context) const {
+ vector<double> scores;
+ for (auto feature: features) {
+ scores.push_back(feature->Score(context));
+ }
+ return scores;
+}
+
+vector<string> Scorer::GetFeatureNames() const {
+ vector<string> feature_names;
+ for (auto feature: features) {
+ feature_names.push_back(feature->GetName());
+ }
+ return feature_names;
+}
diff --git a/extractor/scorer.h b/extractor/scorer.h
new file mode 100644
index 00000000..ba71a6ee
--- /dev/null
+++ b/extractor/scorer.h
@@ -0,0 +1,30 @@
+#ifndef _SCORER_H_
+#define _SCORER_H_
+
+#include <memory>
+#include <string>
+#include <vector>
+
+using namespace std;
+
+class Feature;
+class FeatureContext;
+
+class Scorer {
+ public:
+ Scorer(const vector<shared_ptr<Feature> >& features);
+
+ virtual ~Scorer();
+
+ virtual vector<double> Score(const FeatureContext& context) const;
+
+ virtual vector<string> GetFeatureNames() const;
+
+ protected:
+ Scorer();
+
+ private:
+ vector<shared_ptr<Feature> > features;
+};
+
+#endif
diff --git a/extractor/scorer_test.cc b/extractor/scorer_test.cc
new file mode 100644
index 00000000..56a85762
--- /dev/null
+++ b/extractor/scorer_test.cc
@@ -0,0 +1,47 @@
+#include <gtest/gtest.h>
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "mocks/mock_feature.h"
+#include "scorer.h"
+
+using namespace std;
+using namespace ::testing;
+
+namespace {
+
+class ScorerTest : public Test {
+ protected:
+ virtual void SetUp() {
+ feature1 = make_shared<MockFeature>();
+ EXPECT_CALL(*feature1, Score(_)).WillRepeatedly(Return(0.5));
+ EXPECT_CALL(*feature1, GetName()).WillRepeatedly(Return("f1"));
+
+ feature2 = make_shared<MockFeature>();
+ EXPECT_CALL(*feature2, Score(_)).WillRepeatedly(Return(-1.3));
+ EXPECT_CALL(*feature2, GetName()).WillRepeatedly(Return("f2"));
+
+ vector<shared_ptr<Feature> > features = {feature1, feature2};
+ scorer = make_shared<Scorer>(features);
+ }
+
+ shared_ptr<MockFeature> feature1;
+ shared_ptr<MockFeature> feature2;
+ shared_ptr<Scorer> scorer;
+};
+
+TEST_F(ScorerTest, TestScore) {
+ vector<double> expected_scores = {0.5, -1.3};
+ Phrase phrase;
+ FeatureContext context(phrase, phrase, 0.3, 2, 11);
+ EXPECT_EQ(expected_scores, scorer->Score(context));
+}
+
+TEST_F(ScorerTest, TestGetNames) {
+ vector<string> expected_names = {"f1", "f2"};
+ EXPECT_EQ(expected_names, scorer->GetFeatureNames());
+}
+
+} // namespace
diff --git a/extractor/suffix_array.cc b/extractor/suffix_array.cc
new file mode 100644
index 00000000..23c458a4
--- /dev/null
+++ b/extractor/suffix_array.cc
@@ -0,0 +1,229 @@
+#include "suffix_array.h"
+
+#include <chrono>
+#include <iostream>
+#include <string>
+#include <vector>
+
+#include "data_array.h"
+#include "phrase_location.h"
+#include "time_util.h"
+
+namespace fs = boost::filesystem;
+using namespace std;
+using namespace chrono;
+
+SuffixArray::SuffixArray(shared_ptr<DataArray> data_array) :
+ data_array(data_array) {
+ BuildSuffixArray();
+}
+
+SuffixArray::SuffixArray() {}
+
+SuffixArray::~SuffixArray() {}
+
+void SuffixArray::BuildSuffixArray() {
+ vector<int> groups = data_array->GetData();
+ groups.reserve(groups.size() + 1);
+ groups.push_back(DataArray::NULL_WORD);
+ suffix_array.resize(groups.size());
+ word_start.resize(data_array->GetVocabularySize() + 1);
+
+ InitialBucketSort(groups);
+
+ int combined_group_size = 0;
+ for (size_t i = 1; i < word_start.size(); ++i) {
+ if (word_start[i] - word_start[i - 1] == 1) {
+ ++combined_group_size;
+ suffix_array[word_start[i] - combined_group_size] = -combined_group_size;
+ } else {
+ combined_group_size = 0;
+ }
+ }
+
+ PrefixDoublingSort(groups);
+ cerr << "\tFinalizing sort..." << endl;
+
+ for (size_t i = 0; i < groups.size(); ++i) {
+ suffix_array[groups[i]] = i;
+ }
+}
+
+void SuffixArray::InitialBucketSort(vector<int>& groups) {
+ Clock::time_point start_time = Clock::now();
+ for (size_t i = 0; i < groups.size(); ++i) {
+ ++word_start[groups[i]];
+ }
+
+ for (size_t i = 1; i < word_start.size(); ++i) {
+ word_start[i] += word_start[i - 1];
+ }
+
+ for (size_t i = 0; i < groups.size(); ++i) {
+ --word_start[groups[i]];
+ suffix_array[word_start[groups[i]]] = i;
+ }
+
+ for (size_t i = 0; i < suffix_array.size(); ++i) {
+ groups[i] = word_start[groups[i] + 1] - 1;
+ }
+ Clock::time_point stop_time = Clock::now();
+ cerr << "\tBucket sort took " << GetDuration(start_time, stop_time)
+ << " seconds" << endl;
+}
+
+void SuffixArray::PrefixDoublingSort(vector<int>& groups) {
+ int step = 1;
+ while (suffix_array[0] != -suffix_array.size()) {
+ int combined_group_size = 0;
+ int i = 0;
+ while (i < suffix_array.size()) {
+ if (suffix_array[i] < 0) {
+ int skip = -suffix_array[i];
+ combined_group_size += skip;
+ i += skip;
+ suffix_array[i - combined_group_size] = -combined_group_size;
+ } else {
+ combined_group_size = 0;
+ int j = groups[suffix_array[i]];
+ TernaryQuicksort(i, j, step, groups);
+ i = j + 1;
+ }
+ }
+ step *= 2;
+ }
+}
+
+void SuffixArray::TernaryQuicksort(int left, int right, int step,
+ vector<int>& groups) {
+ if (left > right) {
+ return;
+ }
+
+ int pivot = left + rand() % (right - left + 1);
+ int pivot_value = groups[suffix_array[pivot] + step];
+ swap(suffix_array[pivot], suffix_array[left]);
+ int mid_left = left, mid_right = left;
+ for (int i = left + 1; i <= right; ++i) {
+ if (groups[suffix_array[i] + step] < pivot_value) {
+ ++mid_right;
+ int temp = suffix_array[i];
+ suffix_array[i] = suffix_array[mid_right];
+ suffix_array[mid_right] = suffix_array[mid_left];
+ suffix_array[mid_left] = temp;
+ ++mid_left;
+ } else if (groups[suffix_array[i] + step] == pivot_value) {
+ ++mid_right;
+ int temp = suffix_array[i];
+ suffix_array[i] = suffix_array[mid_right];
+ suffix_array[mid_right] = temp;
+ }
+ }
+
+ TernaryQuicksort(left, mid_left - 1, step, groups);
+
+ if (mid_left == mid_right) {
+ groups[suffix_array[mid_left]] = mid_left;
+ suffix_array[mid_left] = -1;
+ } else {
+ for (int i = mid_left; i <= mid_right; ++i) {
+ groups[suffix_array[i]] = mid_right;
+ }
+ }
+
+ TernaryQuicksort(mid_right + 1, right, step, groups);
+}
+
+vector<int> SuffixArray::BuildLCPArray() const {
+ Clock::time_point start_time = Clock::now();
+ cerr << "Constructing LCP array..." << endl;
+
+ vector<int> lcp(suffix_array.size());
+ vector<int> rank(suffix_array.size());
+ const vector<int>& data = data_array->GetData();
+
+ for (size_t i = 0; i < suffix_array.size(); ++i) {
+ rank[suffix_array[i]] = i;
+ }
+
+ int prefix_len = 0;
+ for (size_t i = 0; i < suffix_array.size(); ++i) {
+ if (rank[i] == 0) {
+ lcp[rank[i]] = -1;
+ } else {
+ int j = suffix_array[rank[i] - 1];
+ while (i + prefix_len < data.size() && j + prefix_len < data.size()
+ && data[i + prefix_len] == data[j + prefix_len]) {
+ ++prefix_len;
+ }
+ lcp[rank[i]] = prefix_len;
+ }
+
+ if (prefix_len > 0) {
+ --prefix_len;
+ }
+ }
+
+ Clock::time_point stop_time = Clock::now();
+ cerr << "Constructing LCP took "
+ << GetDuration(start_time, stop_time) << " seconds" << endl;
+
+ return lcp;
+}
+
+int SuffixArray::GetSuffix(int rank) const {
+ return suffix_array[rank];
+}
+
+int SuffixArray::GetSize() const {
+ return suffix_array.size();
+}
+
+shared_ptr<DataArray> SuffixArray::GetData() const {
+ return data_array;
+}
+
+void SuffixArray::WriteBinary(const fs::path& filepath) const {
+ FILE* file = fopen(filepath.string().c_str(), "r");
+ data_array->WriteBinary(file);
+
+ int size = suffix_array.size();
+ fwrite(&size, sizeof(int), 1, file);
+ fwrite(suffix_array.data(), sizeof(int), size, file);
+
+ size = word_start.size();
+ fwrite(&size, sizeof(int), 1, file);
+ fwrite(word_start.data(), sizeof(int), size, file);
+}
+
+PhraseLocation SuffixArray::Lookup(int low, int high, const string& word,
+ int offset) const {
+ if (!data_array->HasWord(word)) {
+ // Return empty phrase location.
+ return PhraseLocation(0, 0);
+ }
+
+ int word_id = data_array->GetWordId(word);
+ if (offset == 0) {
+ return PhraseLocation(word_start[word_id], word_start[word_id + 1]);
+ }
+
+ return PhraseLocation(LookupRangeStart(low, high, word_id, offset),
+ LookupRangeStart(low, high, word_id + 1, offset));
+}
+
+int SuffixArray::LookupRangeStart(int low, int high, int word_id,
+ int offset) const {
+ int result = high;
+ while (low < high) {
+ int middle = low + (high - low) / 2;
+ if (suffix_array[middle] + offset >= data_array->GetSize() ||
+ data_array->AtIndex(suffix_array[middle] + offset) < word_id) {
+ low = middle + 1;
+ } else {
+ result = middle;
+ high = middle;
+ }
+ }
+ return result;
+}
diff --git a/extractor/suffix_array.h b/extractor/suffix_array.h
new file mode 100644
index 00000000..79a22694
--- /dev/null
+++ b/extractor/suffix_array.h
@@ -0,0 +1,54 @@
+#ifndef _SUFFIX_ARRAY_H_
+#define _SUFFIX_ARRAY_H_
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include <boost/filesystem.hpp>
+
+namespace fs = boost::filesystem;
+using namespace std;
+
+class DataArray;
+class PhraseLocation;
+
+class SuffixArray {
+ public:
+ SuffixArray(shared_ptr<DataArray> data_array);
+
+ virtual ~SuffixArray();
+
+ virtual int GetSize() const;
+
+ virtual shared_ptr<DataArray> GetData() const;
+
+ virtual vector<int> BuildLCPArray() const;
+
+ virtual int GetSuffix(int rank) const;
+
+ virtual PhraseLocation Lookup(int low, int high, const string& word,
+ int offset) const;
+
+ void WriteBinary(const fs::path& filepath) const;
+
+ protected:
+ SuffixArray();
+
+ private:
+ void BuildSuffixArray();
+
+ void InitialBucketSort(vector<int>& groups);
+
+ void TernaryQuicksort(int left, int right, int step, vector<int>& groups);
+
+ void PrefixDoublingSort(vector<int>& groups);
+
+ int LookupRangeStart(int low, int high, int word_id, int offset) const;
+
+ shared_ptr<DataArray> data_array;
+ vector<int> suffix_array;
+ vector<int> word_start;
+};
+
+#endif
diff --git a/extractor/suffix_array_test.cc b/extractor/suffix_array_test.cc
new file mode 100644
index 00000000..60295567
--- /dev/null
+++ b/extractor/suffix_array_test.cc
@@ -0,0 +1,76 @@
+#include <gtest/gtest.h>
+
+#include "mocks/mock_data_array.h"
+#include "phrase_location.h"
+#include "suffix_array.h"
+
+#include <vector>
+
+using namespace std;
+using namespace ::testing;
+
+namespace {
+
+class SuffixArrayTest : public Test {
+ protected:
+ virtual void SetUp() {
+ data = {6, 4, 1, 2, 4, 5, 3, 4, 6, 6, 4, 1, 2};
+ data_array = make_shared<MockDataArray>();
+ EXPECT_CALL(*data_array, GetData()).WillRepeatedly(ReturnRef(data));
+ EXPECT_CALL(*data_array, GetVocabularySize()).WillRepeatedly(Return(7));
+ EXPECT_CALL(*data_array, GetSize()).WillRepeatedly(Return(13));
+ suffix_array = make_shared<SuffixArray>(data_array);
+ }
+
+ vector<int> data;
+ shared_ptr<SuffixArray> suffix_array;
+ shared_ptr<MockDataArray> data_array;
+};
+
+TEST_F(SuffixArrayTest, TestData) {
+ EXPECT_EQ(data_array, suffix_array->GetData());
+ EXPECT_EQ(14, suffix_array->GetSize());
+}
+
+TEST_F(SuffixArrayTest, TestBuildSuffixArray) {
+ vector<int> expected_suffix_array =
+ {13, 11, 2, 12, 3, 6, 10, 1, 4, 7, 5, 9, 0, 8};
+ for (size_t i = 0; i < expected_suffix_array.size(); ++i) {
+ EXPECT_EQ(expected_suffix_array[i], suffix_array->GetSuffix(i));
+ }
+}
+
+TEST_F(SuffixArrayTest, TestBuildLCP) {
+ vector<int> expected_lcp = {-1, 0, 2, 0, 1, 0, 0, 3, 1, 1, 0, 0, 4, 1};
+ EXPECT_EQ(expected_lcp, suffix_array->BuildLCPArray());
+}
+
+TEST_F(SuffixArrayTest, TestLookup) {
+ for (size_t i = 0; i < data.size(); ++i) {
+ EXPECT_CALL(*data_array, AtIndex(i)).WillRepeatedly(Return(data[i]));
+ }
+
+ EXPECT_CALL(*data_array, HasWord("word1")).WillRepeatedly(Return(true));
+ EXPECT_CALL(*data_array, GetWordId("word1")).WillRepeatedly(Return(6));
+ EXPECT_EQ(PhraseLocation(11, 14), suffix_array->Lookup(0, 14, "word1", 0));
+
+ EXPECT_CALL(*data_array, HasWord("word2")).WillRepeatedly(Return(false));
+ EXPECT_EQ(PhraseLocation(0, 0), suffix_array->Lookup(0, 14, "word2", 0));
+
+ EXPECT_CALL(*data_array, HasWord("word3")).WillRepeatedly(Return(true));
+ EXPECT_CALL(*data_array, GetWordId("word3")).WillRepeatedly(Return(4));
+ EXPECT_EQ(PhraseLocation(11, 13), suffix_array->Lookup(11, 14, "word3", 1));
+
+ EXPECT_CALL(*data_array, HasWord("word4")).WillRepeatedly(Return(true));
+ EXPECT_CALL(*data_array, GetWordId("word4")).WillRepeatedly(Return(1));
+ EXPECT_EQ(PhraseLocation(11, 13), suffix_array->Lookup(11, 13, "word4", 2));
+
+ EXPECT_CALL(*data_array, HasWord("word5")).WillRepeatedly(Return(true));
+ EXPECT_CALL(*data_array, GetWordId("word5")).WillRepeatedly(Return(2));
+ EXPECT_EQ(PhraseLocation(11, 13), suffix_array->Lookup(11, 13, "word5", 3));
+
+ EXPECT_EQ(PhraseLocation(12, 13), suffix_array->Lookup(11, 13, "word3", 4));
+ EXPECT_EQ(PhraseLocation(11, 11), suffix_array->Lookup(11, 13, "word5", 1));
+}
+
+} // namespace
diff --git a/extractor/target_phrase_extractor.cc b/extractor/target_phrase_extractor.cc
new file mode 100644
index 00000000..ac583953
--- /dev/null
+++ b/extractor/target_phrase_extractor.cc
@@ -0,0 +1,144 @@
+#include "target_phrase_extractor.h"
+
+#include <unordered_set>
+
+#include "alignment.h"
+#include "data_array.h"
+#include "phrase.h"
+#include "phrase_builder.h"
+#include "rule_extractor_helper.h"
+#include "vocabulary.h"
+
+using namespace std;
+
+TargetPhraseExtractor::TargetPhraseExtractor(
+ shared_ptr<DataArray> target_data_array,
+ shared_ptr<Alignment> alignment,
+ shared_ptr<PhraseBuilder> phrase_builder,
+ shared_ptr<RuleExtractorHelper> helper,
+ shared_ptr<Vocabulary> vocabulary,
+ int max_rule_span,
+ bool require_tight_phrases) :
+ target_data_array(target_data_array),
+ alignment(alignment),
+ phrase_builder(phrase_builder),
+ helper(helper),
+ vocabulary(vocabulary),
+ max_rule_span(max_rule_span),
+ require_tight_phrases(require_tight_phrases) {}
+
+TargetPhraseExtractor::TargetPhraseExtractor() {}
+
+TargetPhraseExtractor::~TargetPhraseExtractor() {}
+
+vector<pair<Phrase, PhraseAlignment> > TargetPhraseExtractor::ExtractPhrases(
+ const vector<pair<int, int> >& target_gaps, const vector<int>& target_low,
+ int target_phrase_low, int target_phrase_high,
+ const unordered_map<int, int>& source_indexes, int sentence_id) const {
+ int target_sent_len = target_data_array->GetSentenceLength(sentence_id);
+
+ vector<int> target_gap_order = helper->GetGapOrder(target_gaps);
+
+ int target_x_low = target_phrase_low, target_x_high = target_phrase_high;
+ if (!require_tight_phrases) {
+ while (target_x_low > 0 &&
+ target_phrase_high - target_x_low < max_rule_span &&
+ target_low[target_x_low - 1] == -1) {
+ --target_x_low;
+ }
+ while (target_x_high < target_sent_len &&
+ target_x_high - target_phrase_low < max_rule_span &&
+ target_low[target_x_high] == -1) {
+ ++target_x_high;
+ }
+ }
+
+ vector<pair<int, int> > gaps(target_gaps.size());
+ for (size_t i = 0; i < gaps.size(); ++i) {
+ gaps[i] = target_gaps[target_gap_order[i]];
+ if (!require_tight_phrases) {
+ while (gaps[i].first > target_x_low &&
+ target_low[gaps[i].first - 1] == -1) {
+ --gaps[i].first;
+ }
+ while (gaps[i].second < target_x_high &&
+ target_low[gaps[i].second] == -1) {
+ ++gaps[i].second;
+ }
+ }
+ }
+
+ vector<pair<int, int> > ranges(2 * gaps.size() + 2);
+ ranges.front() = make_pair(target_x_low, target_phrase_low);
+ ranges.back() = make_pair(target_phrase_high, target_x_high);
+ for (size_t i = 0; i < gaps.size(); ++i) {
+ int j = target_gap_order[i];
+ ranges[i * 2 + 1] = make_pair(gaps[i].first, target_gaps[j].first);
+ ranges[i * 2 + 2] = make_pair(target_gaps[j].second, gaps[i].second);
+ }
+
+ vector<pair<Phrase, PhraseAlignment> > target_phrases;
+ vector<int> subpatterns(ranges.size());
+ GeneratePhrases(target_phrases, ranges, 0, subpatterns, target_gap_order,
+ target_phrase_low, target_phrase_high, source_indexes,
+ sentence_id);
+ return target_phrases;
+}
+
+void TargetPhraseExtractor::GeneratePhrases(
+ vector<pair<Phrase, PhraseAlignment> >& target_phrases,
+ const vector<pair<int, int> >& ranges, int index, vector<int>& subpatterns,
+ const vector<int>& target_gap_order, int target_phrase_low,
+ int target_phrase_high, const unordered_map<int, int>& source_indexes,
+ int sentence_id) const {
+ if (index >= ranges.size()) {
+ if (subpatterns.back() - subpatterns.front() > max_rule_span) {
+ return;
+ }
+
+ vector<int> symbols;
+ unordered_map<int, int> target_indexes;
+
+ int target_sent_start = target_data_array->GetSentenceStart(sentence_id);
+ for (size_t i = 0; i * 2 < subpatterns.size(); ++i) {
+ for (size_t j = subpatterns[i * 2]; j < subpatterns[i * 2 + 1]; ++j) {
+ target_indexes[j] = symbols.size();
+ string target_word = target_data_array->GetWordAtIndex(
+ target_sent_start + j);
+ symbols.push_back(vocabulary->GetTerminalIndex(target_word));
+ }
+ if (i < target_gap_order.size()) {
+ symbols.push_back(vocabulary->GetNonterminalIndex(
+ target_gap_order[i] + 1));
+ }
+ }
+
+ vector<pair<int, int> > links = alignment->GetLinks(sentence_id);
+ vector<pair<int, int> > alignment;
+ for (pair<int, int> link: links) {
+ if (target_indexes.count(link.second)) {
+ alignment.push_back(make_pair(source_indexes.find(link.first)->second,
+ target_indexes[link.second]));
+ }
+ }
+
+ Phrase target_phrase = phrase_builder->Build(symbols);
+ target_phrases.push_back(make_pair(target_phrase, alignment));
+ return;
+ }
+
+ subpatterns[index] = ranges[index].first;
+ if (index > 0) {
+ subpatterns[index] = max(subpatterns[index], subpatterns[index - 1]);
+ }
+ while (subpatterns[index] <= ranges[index].second) {
+ subpatterns[index + 1] = max(subpatterns[index], ranges[index + 1].first);
+ while (subpatterns[index + 1] <= ranges[index + 1].second) {
+ GeneratePhrases(target_phrases, ranges, index + 2, subpatterns,
+ target_gap_order, target_phrase_low, target_phrase_high,
+ source_indexes, sentence_id);
+ ++subpatterns[index + 1];
+ }
+ ++subpatterns[index];
+ }
+}
diff --git a/extractor/target_phrase_extractor.h b/extractor/target_phrase_extractor.h
new file mode 100644
index 00000000..134f24cc
--- /dev/null
+++ b/extractor/target_phrase_extractor.h
@@ -0,0 +1,56 @@
+#ifndef _TARGET_PHRASE_EXTRACTOR_H_
+#define _TARGET_PHRASE_EXTRACTOR_H_
+
+#include <memory>
+#include <unordered_map>
+#include <vector>
+
+using namespace std;
+
+class Alignment;
+class DataArray;
+class Phrase;
+class PhraseBuilder;
+class RuleExtractorHelper;
+class Vocabulary;
+
+typedef vector<pair<int, int> > PhraseAlignment;
+
+class TargetPhraseExtractor {
+ public:
+ TargetPhraseExtractor(shared_ptr<DataArray> target_data_array,
+ shared_ptr<Alignment> alignment,
+ shared_ptr<PhraseBuilder> phrase_builder,
+ shared_ptr<RuleExtractorHelper> helper,
+ shared_ptr<Vocabulary> vocabulary,
+ int max_rule_span,
+ bool require_tight_phrases);
+
+ virtual ~TargetPhraseExtractor();
+
+ virtual vector<pair<Phrase, PhraseAlignment> > ExtractPhrases(
+ const vector<pair<int, int> >& target_gaps, const vector<int>& target_low,
+ int target_phrase_low, int target_phrase_high,
+ const unordered_map<int, int>& source_indexes, int sentence_id) const;
+
+ protected:
+ TargetPhraseExtractor();
+
+ private:
+ void GeneratePhrases(
+ vector<pair<Phrase, PhraseAlignment> >& target_phrases,
+ const vector<pair<int, int> >& ranges, int index,
+ vector<int>& subpatterns, const vector<int>& target_gap_order,
+ int target_phrase_low, int target_phrase_high,
+ const unordered_map<int, int>& source_indexes, int sentence_id) const;
+
+ shared_ptr<DataArray> target_data_array;
+ shared_ptr<Alignment> alignment;
+ shared_ptr<PhraseBuilder> phrase_builder;
+ shared_ptr<RuleExtractorHelper> helper;
+ shared_ptr<Vocabulary> vocabulary;
+ int max_rule_span;
+ bool require_tight_phrases;
+};
+
+#endif
diff --git a/extractor/target_phrase_extractor_test.cc b/extractor/target_phrase_extractor_test.cc
new file mode 100644
index 00000000..7394f4d9
--- /dev/null
+++ b/extractor/target_phrase_extractor_test.cc
@@ -0,0 +1,116 @@
+#include <gtest/gtest.h>
+
+#include <memory>
+#include <vector>
+
+#include "mocks/mock_alignment.h"
+#include "mocks/mock_data_array.h"
+#include "mocks/mock_rule_extractor_helper.h"
+#include "mocks/mock_vocabulary.h"
+#include "phrase.h"
+#include "phrase_builder.h"
+#include "target_phrase_extractor.h"
+
+using namespace std;
+using namespace ::testing;
+
+namespace {
+
+class TargetPhraseExtractorTest : public Test {
+ protected:
+ virtual void SetUp() {
+ data_array = make_shared<MockDataArray>();
+ alignment = make_shared<MockAlignment>();
+ vocabulary = make_shared<MockVocabulary>();
+ phrase_builder = make_shared<PhraseBuilder>(vocabulary);
+ helper = make_shared<MockRuleExtractorHelper>();
+ }
+
+ shared_ptr<MockDataArray> data_array;
+ shared_ptr<MockAlignment> alignment;
+ shared_ptr<MockVocabulary> vocabulary;
+ shared_ptr<PhraseBuilder> phrase_builder;
+ shared_ptr<MockRuleExtractorHelper> helper;
+ shared_ptr<TargetPhraseExtractor> extractor;
+};
+
+TEST_F(TargetPhraseExtractorTest, TestExtractTightPhrasesTrue) {
+ EXPECT_CALL(*data_array, GetSentenceLength(1)).WillRepeatedly(Return(5));
+ EXPECT_CALL(*data_array, GetSentenceStart(1)).WillRepeatedly(Return(3));
+
+ vector<string> target_words = {"a", "b", "c", "d", "e"};
+ vector<int> target_symbols = {20, 21, 22, 23, 24};
+ for (size_t i = 0; i < target_words.size(); ++i) {
+ EXPECT_CALL(*data_array, GetWordAtIndex(i + 3))
+ .WillRepeatedly(Return(target_words[i]));
+ EXPECT_CALL(*vocabulary, GetTerminalIndex(target_words[i]))
+ .WillRepeatedly(Return(target_symbols[i]));
+ EXPECT_CALL(*vocabulary, GetTerminalValue(target_symbols[i]))
+ .WillRepeatedly(Return(target_words[i]));
+ }
+
+ vector<pair<int, int> > links = {
+ make_pair(0, 0), make_pair(1, 3), make_pair(2, 2), make_pair(3, 1),
+ make_pair(4, 4)
+ };
+ EXPECT_CALL(*alignment, GetLinks(1)).WillRepeatedly(Return(links));
+
+ vector<int> gap_order = {1, 0};
+ EXPECT_CALL(*helper, GetGapOrder(_)).WillRepeatedly(Return(gap_order));
+
+ extractor = make_shared<TargetPhraseExtractor>(
+ data_array, alignment, phrase_builder, helper, vocabulary, 10, true);
+
+ vector<pair<int, int> > target_gaps = {make_pair(3, 4), make_pair(1, 2)};
+ vector<int> target_low = {0, 3, 2, 1, 4};
+ unordered_map<int, int> source_indexes = {{0, 0}, {2, 2}, {4, 4}};
+
+ vector<pair<Phrase, PhraseAlignment> > results = extractor->ExtractPhrases(
+ target_gaps, target_low, 0, 5, source_indexes, 1);
+ EXPECT_EQ(1, results.size());
+ vector<int> expected_symbols = {20, -2, 22, -1, 24};
+ EXPECT_EQ(expected_symbols, results[0].first.Get());
+ vector<string> expected_words = {"a", "c", "e"};
+ EXPECT_EQ(expected_words, results[0].first.GetWords());
+ vector<pair<int, int> > expected_alignment = {
+ make_pair(0, 0), make_pair(2, 2), make_pair(4, 4)
+ };
+ EXPECT_EQ(expected_alignment, results[0].second);
+}
+
+TEST_F(TargetPhraseExtractorTest, TestExtractPhrasesTightPhrasesFalse) {
+ vector<string> target_words = {"a", "b", "c", "d", "e", "f"};
+ vector<int> target_symbols = {20, 21, 22, 23, 24, 25, 26};
+ EXPECT_CALL(*data_array, GetSentenceLength(0)).WillRepeatedly(Return(6));
+ EXPECT_CALL(*data_array, GetSentenceStart(0)).WillRepeatedly(Return(0));
+
+ for (size_t i = 0; i < target_words.size(); ++i) {
+ EXPECT_CALL(*data_array, GetWordAtIndex(i))
+ .WillRepeatedly(Return(target_words[i]));
+ EXPECT_CALL(*vocabulary, GetTerminalIndex(target_words[i]))
+ .WillRepeatedly(Return(target_symbols[i]));
+ EXPECT_CALL(*vocabulary, GetTerminalValue(target_symbols[i]))
+ .WillRepeatedly(Return(target_words[i]));
+ }
+
+ vector<pair<int, int> > links = {make_pair(1, 1)};
+ EXPECT_CALL(*alignment, GetLinks(0)).WillRepeatedly(Return(links));
+
+ vector<int> gap_order = {0};
+ EXPECT_CALL(*helper, GetGapOrder(_)).WillRepeatedly(Return(gap_order));
+
+ extractor = make_shared<TargetPhraseExtractor>(
+ data_array, alignment, phrase_builder, helper, vocabulary, 10, false);
+
+ vector<pair<int, int> > target_gaps = {make_pair(2, 4)};
+ vector<int> target_low = {-1, 1, -1, -1, -1, -1};
+ unordered_map<int, int> source_indexes = {{1, 1}};
+
+ vector<pair<Phrase, PhraseAlignment> > results = extractor->ExtractPhrases(
+ target_gaps, target_low, 1, 5, source_indexes, 0);
+ EXPECT_EQ(10, results.size());
+ // TODO(pauldb): Finish unit test once it's clear how these alignments should
+ // look like.
+}
+
+} // namespace
diff --git a/extractor/time_util.cc b/extractor/time_util.cc
new file mode 100644
index 00000000..88395f77
--- /dev/null
+++ b/extractor/time_util.cc
@@ -0,0 +1,6 @@
+#include "time_util.h"
+
+double GetDuration(const Clock::time_point& start_time,
+ const Clock::time_point& stop_time) {
+ return duration_cast<milliseconds>(stop_time - start_time).count() / 1000.0;
+}
diff --git a/extractor/time_util.h b/extractor/time_util.h
new file mode 100644
index 00000000..6f7eda70
--- /dev/null
+++ b/extractor/time_util.h
@@ -0,0 +1,14 @@
+#ifndef _TIME_UTIL_H_
+#define _TIME_UTIL_H_
+
+#include <chrono>
+
+using namespace std;
+using namespace chrono;
+
+typedef high_resolution_clock Clock;
+
+double GetDuration(const Clock::time_point& start_time,
+ const Clock::time_point& stop_time);
+
+#endif
diff --git a/extractor/translation_table.cc b/extractor/translation_table.cc
new file mode 100644
index 00000000..a48c0657
--- /dev/null
+++ b/extractor/translation_table.cc
@@ -0,0 +1,117 @@
+#include "translation_table.h"
+
+#include <string>
+#include <vector>
+
+#include <boost/functional/hash.hpp>
+
+#include "alignment.h"
+#include "data_array.h"
+
+using namespace std;
+
+TranslationTable::TranslationTable(shared_ptr<DataArray> source_data_array,
+ shared_ptr<DataArray> target_data_array,
+ shared_ptr<Alignment> alignment) :
+ source_data_array(source_data_array), target_data_array(target_data_array) {
+ const vector<int>& source_data = source_data_array->GetData();
+ const vector<int>& target_data = target_data_array->GetData();
+
+ unordered_map<int, int> source_links_count;
+ unordered_map<int, int> target_links_count;
+ unordered_map<pair<int, int>, int, PairHash> links_count;
+
+ for (size_t i = 0; i < source_data_array->GetNumSentences(); ++i) {
+ vector<pair<int, int> > links = alignment->GetLinks(i);
+ int source_start = source_data_array->GetSentenceStart(i);
+ int target_start = target_data_array->GetSentenceStart(i);
+ // Ignore END_OF_LINE markers.
+ int next_source_start = source_data_array->GetSentenceStart(i + 1) - 1;
+ int next_target_start = target_data_array->GetSentenceStart(i + 1) - 1;
+ vector<int> source_sentence(source_data.begin() + source_start,
+ source_data.begin() + next_source_start);
+ vector<int> target_sentence(target_data.begin() + target_start,
+ target_data.begin() + next_target_start);
+ vector<int> source_linked_words(source_sentence.size());
+ vector<int> target_linked_words(target_sentence.size());
+
+ for (pair<int, int> link: links) {
+ source_linked_words[link.first] = 1;
+ target_linked_words[link.second] = 1;
+ IncreaseLinksCount(source_links_count, target_links_count, links_count,
+ source_sentence[link.first], target_sentence[link.second]);
+ }
+
+ for (size_t i = 0; i < source_sentence.size(); ++i) {
+ if (!source_linked_words[i]) {
+ IncreaseLinksCount(source_links_count, target_links_count, links_count,
+ source_sentence[i], DataArray::NULL_WORD);
+ }
+ }
+
+ for (size_t i = 0; i < target_sentence.size(); ++i) {
+ if (!target_linked_words[i]) {
+ IncreaseLinksCount(source_links_count, target_links_count, links_count,
+ DataArray::NULL_WORD, target_sentence[i]);
+ }
+ }
+ }
+
+ for (pair<pair<int, int>, int> link_count: links_count) {
+ int source_word = link_count.first.first;
+ int target_word = link_count.first.second;
+ double score1 = 1.0 * link_count.second / source_links_count[source_word];
+ double score2 = 1.0 * link_count.second / target_links_count[target_word];
+ translation_probabilities[link_count.first] = make_pair(score1, score2);
+ }
+}
+
+TranslationTable::TranslationTable() {}
+
+TranslationTable::~TranslationTable() {}
+
+void TranslationTable::IncreaseLinksCount(
+ unordered_map<int, int>& source_links_count,
+ unordered_map<int, int>& target_links_count,
+ unordered_map<pair<int, int>, int, PairHash>& links_count,
+ int source_word_id,
+ int target_word_id) const {
+ ++source_links_count[source_word_id];
+ ++target_links_count[target_word_id];
+ ++links_count[make_pair(source_word_id, target_word_id)];
+}
+
+double TranslationTable::GetTargetGivenSourceScore(
+ const string& source_word, const string& target_word) {
+ if (!source_data_array->HasWord(source_word) ||
+ !target_data_array->HasWord(target_word)) {
+ return -1;
+ }
+
+ int source_id = source_data_array->GetWordId(source_word);
+ int target_id = target_data_array->GetWordId(target_word);
+ return translation_probabilities[make_pair(source_id, target_id)].first;
+}
+
+double TranslationTable::GetSourceGivenTargetScore(
+ const string& source_word, const string& target_word) {
+ if (!source_data_array->HasWord(source_word) ||
+ !target_data_array->HasWord(target_word)) {
+ return -1;
+ }
+
+ int source_id = source_data_array->GetWordId(source_word);
+ int target_id = target_data_array->GetWordId(target_word);
+ return translation_probabilities[make_pair(source_id, target_id)].second;
+}
+
+void TranslationTable::WriteBinary(const fs::path& filepath) const {
+ FILE* file = fopen(filepath.string().c_str(), "w");
+
+ int size = translation_probabilities.size();
+ fwrite(&size, sizeof(int), 1, file);
+ for (auto entry: translation_probabilities) {
+ fwrite(&entry.first, sizeof(entry.first), 1, file);
+ fwrite(&entry.second, sizeof(entry.second), 1, file);
+ }
+}
diff --git a/extractor/translation_table.h b/extractor/translation_table.h
new file mode 100644
index 00000000..157ad3af
--- /dev/null
+++ b/extractor/translation_table.h
@@ -0,0 +1,53 @@
+#ifndef _TRANSLATION_TABLE_
+#define _TRANSLATION_TABLE_
+
+#include <memory>
+#include <string>
+#include <unordered_map>
+
+#include <boost/filesystem.hpp>
+#include <boost/functional/hash.hpp>
+
+using namespace std;
+namespace fs = boost::filesystem;
+
+class Alignment;
+class DataArray;
+
+typedef boost::hash<pair<int, int> > PairHash;
+
+class TranslationTable {
+ public:
+ TranslationTable(
+ shared_ptr<DataArray> source_data_array,
+ shared_ptr<DataArray> target_data_array,
+ shared_ptr<Alignment> alignment);
+
+ virtual ~TranslationTable();
+
+ virtual double GetTargetGivenSourceScore(const string& source_word,
+ const string& target_word);
+
+ virtual double GetSourceGivenTargetScore(const string& source_word,
+ const string& target_word);
+
+ void WriteBinary(const fs::path& filepath) const;
+
+ protected:
+ TranslationTable();
+
+ private:
+ void IncreaseLinksCount(
+ unordered_map<int, int>& source_links_count,
+ unordered_map<int, int>& target_links_count,
+ unordered_map<pair<int, int>, int, PairHash>& links_count,
+ int source_word_id,
+ int target_word_id) const;
+
+ shared_ptr<DataArray> source_data_array;
+ shared_ptr<DataArray> target_data_array;
+ unordered_map<pair<int, int>, pair<double, double>, PairHash>
+ translation_probabilities;
+};
+
+#endif
diff --git a/extractor/translation_table_test.cc b/extractor/translation_table_test.cc
new file mode 100644
index 00000000..c99f3f93
--- /dev/null
+++ b/extractor/translation_table_test.cc
@@ -0,0 +1,82 @@
+#include <gtest/gtest.h>
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "mocks/mock_alignment.h"
+#include "mocks/mock_data_array.h"
+#include "translation_table.h"
+
+using namespace std;
+using namespace ::testing;
+
+namespace {
+
+TEST(TranslationTableTest, TestScores) {
+ vector<string> words = {"a", "b", "c"};
+
+ vector<int> source_data = {2, 3, 2, 3, 4, 0, 2, 3, 6, 0, 2, 3, 6, 0};
+ vector<int> source_sentence_start = {0, 6, 10, 14};
+ shared_ptr<MockDataArray> source_data_array = make_shared<MockDataArray>();
+ EXPECT_CALL(*source_data_array, GetData())
+ .WillRepeatedly(ReturnRef(source_data));
+ EXPECT_CALL(*source_data_array, GetNumSentences())
+ .WillRepeatedly(Return(3));
+ for (size_t i = 0; i < source_sentence_start.size(); ++i) {
+ EXPECT_CALL(*source_data_array, GetSentenceStart(i))
+ .WillRepeatedly(Return(source_sentence_start[i]));
+ }
+ for (size_t i = 0; i < words.size(); ++i) {
+ EXPECT_CALL(*source_data_array, HasWord(words[i]))
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(*source_data_array, GetWordId(words[i]))
+ .WillRepeatedly(Return(i + 2));
+ }
+ EXPECT_CALL(*source_data_array, HasWord("d"))
+ .WillRepeatedly(Return(false));
+
+ vector<int> target_data = {2, 3, 2, 3, 4, 5, 0, 3, 6, 0, 2, 7, 0};
+ vector<int> target_sentence_start = {0, 7, 10, 13};
+ shared_ptr<MockDataArray> target_data_array = make_shared<MockDataArray>();
+ EXPECT_CALL(*target_data_array, GetData())
+ .WillRepeatedly(ReturnRef(target_data));
+ for (size_t i = 0; i < target_sentence_start.size(); ++i) {
+ EXPECT_CALL(*target_data_array, GetSentenceStart(i))
+ .WillRepeatedly(Return(target_sentence_start[i]));
+ }
+ for (size_t i = 0; i < words.size(); ++i) {
+ EXPECT_CALL(*target_data_array, HasWord(words[i]))
+ .WillRepeatedly(Return(true));
+ EXPECT_CALL(*target_data_array, GetWordId(words[i]))
+ .WillRepeatedly(Return(i + 2));
+ }
+ EXPECT_CALL(*target_data_array, HasWord("d"))
+ .WillRepeatedly(Return(false));
+
+ vector<pair<int, int> > links1 = {
+ make_pair(0, 0), make_pair(1, 1), make_pair(2, 2), make_pair(3, 3),
+ make_pair(4, 4), make_pair(4, 5)
+ };
+ vector<pair<int, int> > links2 = {make_pair(1, 0), make_pair(2, 1)};
+ vector<pair<int, int> > links3 = {make_pair(0, 0), make_pair(2, 1)};
+ shared_ptr<MockAlignment> alignment = make_shared<MockAlignment>();
+ EXPECT_CALL(*alignment, GetLinks(0)).WillRepeatedly(Return(links1));
+ EXPECT_CALL(*alignment, GetLinks(1)).WillRepeatedly(Return(links2));
+ EXPECT_CALL(*alignment, GetLinks(2)).WillRepeatedly(Return(links3));
+
+ shared_ptr<TranslationTable> table = make_shared<TranslationTable>(
+ source_data_array, target_data_array, alignment);
+
+ EXPECT_EQ(0.75, table->GetTargetGivenSourceScore("a", "a"));
+ EXPECT_EQ(0, table->GetTargetGivenSourceScore("a", "b"));
+ EXPECT_EQ(0.5, table->GetTargetGivenSourceScore("c", "c"));
+ EXPECT_EQ(-1, table->GetTargetGivenSourceScore("c", "d"));
+
+ EXPECT_EQ(1, table->GetSourceGivenTargetScore("a", "a"));
+ EXPECT_EQ(0, table->GetSourceGivenTargetScore("a", "b"));
+ EXPECT_EQ(1, table->GetSourceGivenTargetScore("c", "c"));
+ EXPECT_EQ(-1, table->GetSourceGivenTargetScore("c", "d"));
+}
+
+} // namespace
diff --git a/extractor/veb.cc b/extractor/veb.cc
new file mode 100644
index 00000000..f38f672e
--- /dev/null
+++ b/extractor/veb.cc
@@ -0,0 +1,25 @@
+#include "veb.h"
+
+#include "veb_bitset.h"
+#include "veb_tree.h"
+
+int VEB::MIN_BOTTOM_BITS = 5;
+int VEB::MIN_BOTTOM_SIZE = 1 << VEB::MIN_BOTTOM_BITS;
+
+shared_ptr<VEB> VEB::Create(int size) {
+ if (size > MIN_BOTTOM_SIZE) {
+ return shared_ptr<VEB>(new VEBTree(size));
+ } else {
+ return shared_ptr<VEB>(new VEBBitset(size));
+ }
+}
+
+int VEB::GetMinimum() {
+ return min;
+}
+
+int VEB::GetMaximum() {
+ return max;
+}
+
+VEB::VEB(int min, int max) : min(min), max(max) {}
diff --git a/extractor/veb.h b/extractor/veb.h
new file mode 100644
index 00000000..c8209cf7
--- /dev/null
+++ b/extractor/veb.h
@@ -0,0 +1,29 @@
+#ifndef _VEB_H_
+#define _VEB_H_
+
+#include <memory>
+
+using namespace std;
+
+class VEB {
+ public:
+ static shared_ptr<VEB> Create(int size);
+
+ virtual void Insert(int value) = 0;
+
+ virtual int GetSuccessor(int value) = 0;
+
+ int GetMinimum();
+
+ int GetMaximum();
+
+ static int MIN_BOTTOM_BITS;
+ static int MIN_BOTTOM_SIZE;
+
+ protected:
+ VEB(int min = -1, int max = -1);
+
+ int min, max;
+};
+
+#endif
diff --git a/extractor/veb_bitset.cc b/extractor/veb_bitset.cc
new file mode 100644
index 00000000..4e364cc5
--- /dev/null
+++ b/extractor/veb_bitset.cc
@@ -0,0 +1,25 @@
+#include "veb_bitset.h"
+
+using namespace std;
+
+VEBBitset::VEBBitset(int size) : bitset(size) {
+ min = max = -1;
+}
+
+void VEBBitset::Insert(int value) {
+ bitset[value] = 1;
+ if (min == -1 || value < min) {
+ min = value;
+ }
+ if (max == - 1 || value > max) {
+ max = value;
+ }
+}
+
+int VEBBitset::GetSuccessor(int value) {
+ int next_value = bitset.find_next(value);
+ if (next_value == bitset.npos) {
+ return -1;
+ }
+ return next_value;
+}
diff --git a/extractor/veb_bitset.h b/extractor/veb_bitset.h
new file mode 100644
index 00000000..f8a91234
--- /dev/null
+++ b/extractor/veb_bitset.h
@@ -0,0 +1,22 @@
+#ifndef _VEB_BITSET_H_
+#define _VEB_BITSET_H_
+
+#include <boost/dynamic_bitset.hpp>
+
+#include "veb.h"
+
+class VEBBitset: public VEB {
+ public:
+ VEBBitset(int size);
+
+ void Insert(int value);
+
+ int GetMinimum();
+
+ int GetSuccessor(int value);
+
+ private:
+ boost::dynamic_bitset<> bitset;
+};
+
+#endif
diff --git a/extractor/veb_test.cc b/extractor/veb_test.cc
new file mode 100644
index 00000000..c40c9f28
--- /dev/null
+++ b/extractor/veb_test.cc
@@ -0,0 +1,56 @@
+#include <gtest/gtest.h>
+
+#include <algorithm>
+#include <vector>
+
+#include "veb.h"
+
+using namespace std;
+
+namespace {
+
+class VEBTest : public ::testing::Test {
+ protected:
+ void VEBSortTester(vector<int> values, int max_value) {
+ shared_ptr<VEB> veb = VEB::Create(max_value);
+ for (int value: values) {
+ veb->Insert(value);
+ }
+
+ sort(values.begin(), values.end());
+ EXPECT_EQ(values.front(), veb->GetMinimum());
+ EXPECT_EQ(values.back(), veb->GetMaximum());
+ for (size_t i = 0; i + 1 < values.size(); ++i) {
+ EXPECT_EQ(values[i + 1], veb->GetSuccessor(values[i]));
+ }
+ EXPECT_EQ(-1, veb->GetSuccessor(values.back()));
+ }
+};
+
+TEST_F(VEBTest, SmallRange) {
+ vector<int> values{8, 13, 5, 1, 4, 15, 2, 10, 6, 7};
+ VEBSortTester(values, 16);
+}
+
+TEST_F(VEBTest, MediumRange) {
+ vector<int> values{167, 243, 88, 12, 137, 199, 212, 45, 150, 189};
+ VEBSortTester(values, 255);
+}
+
+TEST_F(VEBTest, LargeRangeSparse) {
+ vector<int> values;
+ for (size_t i = 0; i < 100; ++i) {
+ values.push_back(i * 1000000);
+ }
+ VEBSortTester(values, 100000000);
+}
+
+TEST_F(VEBTest, LargeRangeDense) {
+ vector<int> values;
+ for (size_t i = 0; i < 1000000; ++i) {
+ values.push_back(i);
+ }
+ VEBSortTester(values, 1000000);
+}
+
+} // namespace
diff --git a/extractor/veb_tree.cc b/extractor/veb_tree.cc
new file mode 100644
index 00000000..f8945445
--- /dev/null
+++ b/extractor/veb_tree.cc
@@ -0,0 +1,71 @@
+#include <cmath>
+
+#include "veb_tree.h"
+
+VEBTree::VEBTree(int size) {
+ int num_bits = ceil(log2(size));
+
+ lower_bits = num_bits >> 1;
+ upper_size = (size >> lower_bits) + 1;
+
+ clusters.reserve(upper_size);
+ clusters.resize(upper_size);
+}
+
+int VEBTree::GetNextValue(int value) {
+ return value & ((1 << lower_bits) - 1);
+}
+
+int VEBTree::GetCluster(int value) {
+ return value >> lower_bits;
+}
+
+int VEBTree::Compose(int cluster, int value) {
+ return (cluster << lower_bits) + value;
+}
+
+void VEBTree::Insert(int value) {
+ if (min == -1 && max == -1) {
+ min = max = value;
+ return;
+ }
+
+ if (value < min) {
+ swap(min, value);
+ }
+
+ int cluster = GetCluster(value), next_value = GetNextValue(value);
+ if (clusters[cluster] == NULL) {
+ clusters[cluster] = VEB::Create(1 << lower_bits);
+ if (summary == NULL) {
+ summary = VEB::Create(upper_size);
+ }
+ summary->Insert(cluster);
+ }
+ clusters[cluster]->Insert(next_value);
+
+ if (value > max) {
+ max = value;
+ }
+}
+
+int VEBTree::GetSuccessor(int value) {
+ if (value >= max) {
+ return -1;
+ }
+ if (value < min) {
+ return min;
+ }
+
+ int cluster = GetCluster(value), next_value = GetNextValue(value);
+ if (clusters[cluster] != NULL &&
+ next_value < clusters[cluster]->GetMaximum()) {
+ return Compose(cluster, clusters[cluster]->GetSuccessor(next_value));
+ } else {
+ int next_cluster = summary->GetSuccessor(cluster);
+ if (next_cluster == -1) {
+ return -1;
+ }
+ return Compose(next_cluster, clusters[next_cluster]->GetMinimum());
+ }
+}
diff --git a/extractor/veb_tree.h b/extractor/veb_tree.h
new file mode 100644
index 00000000..578d3e6a
--- /dev/null
+++ b/extractor/veb_tree.h
@@ -0,0 +1,29 @@
+#ifndef _VEB_TREE_H_
+#define _VEB_TREE_H_
+
+#include <memory>
+#include <vector>
+
+using namespace std;
+
+#include "veb.h"
+
+class VEBTree: public VEB {
+ public:
+ VEBTree(int size);
+
+ void Insert(int value);
+
+ int GetSuccessor(int value);
+
+ private:
+ int GetNextValue(int value);
+ int GetCluster(int value);
+ int Compose(int cluster, int value);
+
+ int lower_bits, upper_size;
+ shared_ptr<VEB> summary;
+ vector<shared_ptr<VEB> > clusters;
+};
+
+#endif
diff --git a/extractor/vocabulary.cc b/extractor/vocabulary.cc
new file mode 100644
index 00000000..5c379a29
--- /dev/null
+++ b/extractor/vocabulary.cc
@@ -0,0 +1,26 @@
+#include "vocabulary.h"
+
+Vocabulary::~Vocabulary() {}
+
+int Vocabulary::GetTerminalIndex(const string& word) {
+ if (!dictionary.count(word)) {
+ int word_id = words.size();
+ dictionary[word] = word_id;
+ words.push_back(word);
+ return word_id;
+ }
+
+ return dictionary[word];
+}
+
+int Vocabulary::GetNonterminalIndex(int position) {
+ return -position;
+}
+
+bool Vocabulary::IsTerminal(int symbol) {
+ return symbol >= 0;
+}
+
+string Vocabulary::GetTerminalValue(int symbol) {
+ return words[symbol];
+}
diff --git a/extractor/vocabulary.h b/extractor/vocabulary.h
new file mode 100644
index 00000000..c6a8b3e8
--- /dev/null
+++ b/extractor/vocabulary.h
@@ -0,0 +1,27 @@
+#ifndef _VOCABULARY_H_
+#define _VOCABULARY_H_
+
+#include <string>
+#include <unordered_map>
+#include <vector>
+
+using namespace std;
+
+class Vocabulary {
+ public:
+ virtual ~Vocabulary();
+
+ virtual int GetTerminalIndex(const string& word);
+
+ int GetNonterminalIndex(int position);
+
+ bool IsTerminal(int symbol);
+
+ virtual string GetTerminalValue(int symbol);
+
+ private:
+ unordered_map<string, int> dictionary;
+ vector<string> words;
+};
+
+#endif
diff --git a/m4/misc.m4 b/m4/misc.m4
new file mode 100644
index 00000000..d4aab47b
--- /dev/null
+++ b/m4/misc.m4
@@ -0,0 +1,110 @@
+dnl @synopsis AX_CXX_CHECK_LIB(libname, functioname, action-if, action-if-not)
+dnl
+dnl The standard AC_CHECK_LIB can not test functions in namespaces.
+dnl Therefore AC_CHECK_LIB(cgicc, cgicc::Cgicc::getVersion) will always
+dnl fail. We need to decompose the functionname into a series of namespaces
+dnl where it gets declared so that it can be used for a link test.
+dnl
+dnl In the first version I did allow namespace::functionname to be a
+dnl reference to a void-argument global functionname (just wrapped in a
+dnl namespace) like its C counterparts would be - but in reality such
+dnl thing does not exist. The only global / static functions are always
+dnl made const-functions which is an attribute mangled along into the
+dnl library function export name.
+dnl
+dnl The normal usage will ask for a test of a class-member function which
+dnl should be presented with a full function spec with arguments given in
+dnl parentheses following the function name - if the function to test for
+dnl does expect arguments then you should add default initial values in the
+dnl prototype (even if they do not exist originally, these are used only
+dnl locally to build a correct function call in the configure test script).
+dnl
+dnl In the current version if you do omit the parenthesis from the macro
+dnl argument then the macro will assume that you want to check for the
+dnl class name - which is really to check for default constructor being
+dnl exported from the given library name.
+dnl
+dnl EXAMPLE:
+dnl AX_CXX_CHECK_LIB(cgicc, [cgicc::HTTPCookie])
+dnl AX_CXX_CHECK_LIB(cgicc, [cgicc::Cgicc::getVersion () const],
+dnl AX_CXX_CHECK_LIB(boost_regex, [boost::RegEx::Position (int i = 0) const])
+dnl
+dnl Result:
+dnl Just as the usual AX_CXX_CHECK_LIB - defines HAVE_LIBCGICC
+dnl and adds the libraries to the default library path (and
+dnl uses internally the normal ac_check_lib cache symbol
+dnl like ac_cv_lib_cgicc_cgicc__Cgicc)
+dnl
+dnl Footnote: The C++ language is not good at creating stable library
+dnl interfaces at the binary level - a lot of functionality is usually being
+dnl given as inline functions plus there is hardly a chance to create opaque
+dnl types. Therefore most C++ library tests will only do compile tests using
+dnl the header files. Doing a check_lib is however good to check the link
+dnl dependency before hitting it as an error in the build later.
+dnl
+dnl @category C++
+dnl @author Guido U. Draheim
+dnl @vesion 2006-12-18
+
+AC_DEFUN([AX_CXX_CHECK_LIB],
+[m4_ifval([$3], , [AH_CHECK_LIB([$1])])dnl
+AS_LITERAL_IF([$1],
+ [AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$2])],
+ [AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1''_$2])])dnl
+AC_CACHE_CHECK([for $2 in -l$1], ac_Lib,
+[ac_check_lib_save_LIBS=$LIBS
+LIBS="-l$1 $5 $LIBS"
+case "$2"
+in *::*::*\(*)
+AC_LINK_IFELSE([AC_LANG_PROGRAM([
+ namespace `echo "$2" | sed -e "s/::.*//"`
+ { class `echo "$2" | sed -e "s/.*::\\(.*\\)::.*/\\1/" -e "s/(.*//"`
+ { public: int `echo "$2" | sed -e "s/.*:://" -e "/(/!s/..*/&()/"`;
+ };
+ }
+],[`echo "$2" | sed -e "s/(.*//" -e "s/\\(.*\\)::\\(.*\\)/((\\1*)(0))->\\2/g"`()])],
+ [AS_VAR_SET(ac_Lib, yes)],
+ [AS_VAR_SET(ac_Lib, no)])
+;; *::*::*)
+AC_LINK_IFELSE([AC_LANG_PROGRAM([
+ namespace `echo "$2" | sed -e "s/::.*//"`
+ { namespace `echo "$2" | sed -e "s/.*::\\(.*\\)::.*/\\1/"`
+ { class `echo "$2" | sed -e "s/.*:://"`
+ { public: `echo "$2" | sed -e "s/.*:://"` ();
+ };
+ }
+ }
+],[new $2()])],
+ [AS_VAR_SET(ac_Lib, yes)],
+ [AS_VAR_SET(ac_Lib, no)])
+;; *::*\(*)
+AC_LINK_IFELSE([AC_LANG_PROGRAM([
+ class `echo "$2" | sed -e "s/\\(.*\\)::.*/\\1/" -e "s/(.*//"`
+ { public: int `echo "$2" | sed -e "s/.*:://" -e "/(/!s/..*/&()/"`;
+ };
+],[`echo "$2" | sed -e "s/(.*//" -e "s/\\(.*\\)::\\(.*\\)/((\\1*)(0))->\\2/g"`()])],
+ [AS_VAR_SET(ac_Lib, yes)],
+ [AS_VAR_SET(ac_Lib, no)])
+;; *::*)
+AC_LINK_IFELSE([AC_LANG_PROGRAM([
+ namespace `echo "$2" | sed -e "s/::.*//"`
+ { class `echo "$2" | sed -e "s/.*:://"`
+ { public: `echo "$2" | sed -e "s/.*:://"` ();
+ };
+ }
+],[new $2()])],
+ [AS_VAR_SET(ac_Lib, yes)],
+ [AS_VAR_SET(ac_Lib, no)])
+;; *)
+AC_LINK_IFELSE([AC_LANG_CALL([], [$2])],
+ [AS_VAR_SET(ac_Lib, yes)],
+ [AS_VAR_SET(ac_Lib, no)])
+;; esac
+LIBS=$ac_check_lib_save_LIBS])
+AS_IF([test AS_VAR_GET(ac_Lib) = yes],
+ [m4_default([$3], [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_LIB$1))
+ LIBS="-l$1 $LIBS"
+])],
+ [$4])dnl
+AS_VAR_POPDEF([ac_Lib])dnl
+])# AC_CHECK_LIB
diff --git a/python/pkg/cdec/sa/compile.py b/python/pkg/cdec/sa/compile.py
index ce249c0f..d4cd8387 100644
--- a/python/pkg/cdec/sa/compile.py
+++ b/python/pkg/cdec/sa/compile.py
@@ -4,6 +4,7 @@ import os
import logging
import cdec.configobj
import cdec.sa
+from cdec.sa._sa import monitor_cpu
import sys
MAX_PHRASE_LENGTH = 4
@@ -21,6 +22,7 @@ def precompute(f_sa, max_len, max_nt, max_size, min_gap, rank1, rank2, tight_phr
return precomp
def main():
+ preprocess_start_time = monitor_cpu()
sys.setrecursionlimit(sys.getrecursionlimit() * 100)
logging.basicConfig(level=logging.INFO)
@@ -73,31 +75,46 @@ def main():
a_bin = os.path.join(args.output, 'a.bin')
lex_bin = os.path.join(args.output, 'lex.bin')
+ start_time = monitor_cpu()
logger.info('Compiling source suffix array')
if args.bitext:
f_sa = cdec.sa.SuffixArray(from_text=args.bitext, side='source')
else:
f_sa = cdec.sa.SuffixArray(from_text=args.source)
f_sa.write_binary(f_sa_bin)
+ stop_time = monitor_cpu()
+ logger.info('Compiling source suffix array took %f seconds', stop_time - start_time)
+ start_time = monitor_cpu()
logger.info('Compiling target data array')
if args.bitext:
e = cdec.sa.DataArray(from_text=args.bitext, side='target')
else:
e = cdec.sa.DataArray(from_text=args.target)
e.write_binary(e_bin)
+ stop_time = monitor_cpu()
+ logger.info('Compiling target data array took %f seconds', stop_time - start_time)
+ start_time = monitor_cpu()
logger.info('Precomputing frequent phrases')
precompute(f_sa, *params).write_binary(precomp_bin)
+ stop_time = monitor_cpu()
+ logger.info('Compiling precomputations took %f seconds', stop_time - start_time)
+ start_time = monitor_cpu()
logger.info('Compiling alignment')
a = cdec.sa.Alignment(from_text=args.alignment)
a.write_binary(a_bin)
+ stop_time = monitor_cpu()
+ logger.info('Compiling alignment took %f seonds', stop_time - start_time)
+ start_time = monitor_cpu()
logger.info('Compiling bilexical dictionary')
lex = cdec.sa.BiLex(from_data=True, alignment=a, earray=e, fsarray=f_sa)
lex.write_binary(lex_bin)
-
+ stop_time = monitor_cpu()
+ logger.info('Compiling bilexical dictionary took %f seconds', stop_time - start_time)
+
# Write configuration
config = cdec.configobj.ConfigObj(args.config, unrepr=True)
config['f_sa_file'] = os.path.abspath(f_sa_bin)
@@ -108,6 +125,8 @@ def main():
for name, value in zip(param_names, params):
config[name] = value
config.write()
+ preprocess_stop_time = monitor_cpu()
+ logger.info('Overall preprocessing step took %f seconds', preprocess_stop_time - preprocess_start_time)
if __name__ == '__main__':
main()
diff --git a/python/pkg/cdec/sa/extract.py b/python/pkg/cdec/sa/extract.py
index 2e596bd3..dc72c18c 100644
--- a/python/pkg/cdec/sa/extract.py
+++ b/python/pkg/cdec/sa/extract.py
@@ -7,6 +7,7 @@ import re
import multiprocessing as mp
import signal
import cdec.sa
+from cdec.sa._sa import monitor_cpu
extractor, prefix = None, None
online = False
@@ -81,9 +82,10 @@ def main():
sys.stderr.write('Error: feature definition file <{0}>'
' should be a python module\n'.format(featdef))
sys.exit(1)
-
+
online = args.online
-
+
+ start_time = monitor_cpu()
if args.jobs > 1:
logging.info('Starting %d workers; chunk size: %d', args.jobs, args.chunksize)
pool = mp.Pool(args.jobs, make_extractor, (args.config, args.grammars, args.features))
@@ -97,5 +99,8 @@ def main():
for output in map(extract, enumerate(sys.stdin)):
print(output)
+ stop_time = monitor_cpu()
+ logging.info("Overall extraction step took %f seconds", stop_time - start_time)
+
if __name__ == '__main__':
main()
diff --git a/python/src/_cdec.cpp b/python/src/_cdec.cpp
index 00cb0641..38cf04a9 100644
--- a/python/src/_cdec.cpp
+++ b/python/src/_cdec.cpp
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.17.1 on Sun Nov 18 15:08:18 2012 */
+/* Generated by Cython 0.17.1 on Tue Feb 19 16:54:40 2013 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
@@ -448,7 +448,7 @@ struct __pyx_opt_args_5_cdec_as_str {
char *error_msg;
};
-/* "/home/vchahune/tools/cdec/python/src/cdec.sa._sa.pxd":25
+/* "/home/pauldb/workspace/cdec/python/src/cdec.sa._sa.pxd":25
* cdef void read_handle(self, FILE* f)
*
* cdef class FeatureVector: # <<<<<<<<<<<<<<
@@ -475,7 +475,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_24___init__ {
};
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":21
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":21
* return '[%s]' % self.cat
*
* cdef class NTRef: # <<<<<<<<<<<<<<
@@ -488,7 +488,7 @@ struct __pyx_obj_5_cdec_NTRef {
};
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":121
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":121
* return CandidateSet(self)
*
* cdef class Scorer: # <<<<<<<<<<<<<<
@@ -502,7 +502,7 @@ struct __pyx_obj_5_cdec_Scorer {
};
-/* "/home/vchahune/tools/cdec/python/src/cdec.sa._sa.pxd":12
+/* "/home/pauldb/workspace/cdec/python/src/cdec.sa._sa.pxd":12
* cdef void read_handle(self, FILE* f)
*
* cdef class IntList: # <<<<<<<<<<<<<<
@@ -519,7 +519,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_IntList {
};
-/* "/home/vchahune/tools/cdec/python/src/cdec.sa._sa.pxd":29
+/* "/home/pauldb/workspace/cdec/python/src/cdec.sa._sa.pxd":29
* cdef FloatList values
*
* cdef class Phrase: # <<<<<<<<<<<<<<
@@ -536,7 +536,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_Phrase {
};
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":90
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":90
* return candidate
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -552,7 +552,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_22___iter__ {
};
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":193
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":193
* super(MRule, self).__init__(lhs, rhs, e, scores, None)
*
* cdef class Grammar: # <<<<<<<<<<<<<<
@@ -565,7 +565,7 @@ struct __pyx_obj_5_cdec_Grammar {
};
-/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":63
+/* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":63
* def todot(self):
* """lattice.todot() -> Representation of the lattice in GraphViz dot format."""
* def lines(): # <<<<<<<<<<<<<<
@@ -588,7 +588,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_20_lines {
};
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":108
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":108
* del hypos
*
* def sample_trees(self, unsigned n): # <<<<<<<<<<<<<<
@@ -606,7 +606,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_12_sample_trees {
};
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":161
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":161
*
* property edges:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -622,7 +622,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_13___get__ {
};
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":5
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":5
* import cdec.sa._sa as _sa
*
* def _phrase(phrase): # <<<<<<<<<<<<<<
@@ -635,7 +635,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_2__phrase {
};
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":65
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":65
* return result
*
* cdef class CandidateSet: # <<<<<<<<<<<<<<
@@ -650,7 +650,7 @@ struct __pyx_obj_5_cdec_CandidateSet {
};
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":167
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":167
*
* property nodes:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -666,7 +666,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_14___get__ {
};
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":49
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":49
* return TRule(lhs, f, e, scores, a)
*
* cdef class TRule: # <<<<<<<<<<<<<<
@@ -679,7 +679,7 @@ struct __pyx_obj_5_cdec_TRule {
};
-/* "/home/vchahune/tools/cdec/python/src/cdec.sa._sa.pxd":35
+/* "/home/pauldb/workspace/cdec/python/src/cdec.sa._sa.pxd":35
* cdef public int chunklen(self, int k)
*
* cdef class Rule: # <<<<<<<<<<<<<<
@@ -697,7 +697,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_Rule {
};
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":177
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":177
* _phrase(self.f), _phrase(self.e), scores)
*
* cdef class MRule(TRule): # <<<<<<<<<<<<<<
@@ -709,7 +709,7 @@ struct __pyx_obj_5_cdec_MRule {
};
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":100
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":100
* self.cs.AddKBestCandidates(hypergraph.hg[0], k, self.scorer.get())
*
* cdef class SegmentEvaluator: # <<<<<<<<<<<<<<
@@ -740,7 +740,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_25_genexpr {
};
-/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":61
+/* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":61
* yield self[i]
*
* def todot(self): # <<<<<<<<<<<<<<
@@ -753,7 +753,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_19_todot {
};
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":12
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":12
* return stats
*
* cdef class Candidate: # <<<<<<<<<<<<<<
@@ -767,7 +767,7 @@ struct __pyx_obj_5_cdec_Candidate {
};
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":173
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":173
*
* def __str__(self):
* scores = ' '.join('%s=%s' % feat for feat in self.scores) # <<<<<<<<<<<<<<
@@ -784,7 +784,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_6_genexpr {
};
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":8
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":8
* return ' '.join(w.encode('utf8') if isinstance(w, unicode) else str(w) for w in phrase)
*
* cdef class NT: # <<<<<<<<<<<<<<
@@ -798,7 +798,7 @@ struct __pyx_obj_5_cdec_NT {
};
-/* "/home/vchahune/tools/cdec/python/src/cdec.sa._sa.pxd":3
+/* "/home/pauldb/workspace/cdec/python/src/cdec.sa._sa.pxd":3
* from libc.stdio cimport FILE
*
* cdef class FloatList: # <<<<<<<<<<<<<<
@@ -815,7 +815,7 @@ struct __pyx_obj_4cdec_2sa_3_sa_FloatList {
};
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":196
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":196
* return vector
*
* cdef class HypergraphEdge: # <<<<<<<<<<<<<<
@@ -831,7 +831,7 @@ struct __pyx_obj_5_cdec_HypergraphEdge {
};
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":72
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":72
* self.vector.set_value(fid, value)
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -848,7 +848,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_1___iter__ {
};
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":256
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":256
*
* property in_edges:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -864,7 +864,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_16___get__ {
};
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":131
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":131
*
* property a:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -881,7 +881,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_4___get__ {
};
-/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":56
+/* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":56
* return unicode(str(self), 'utf8')
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -911,7 +911,7 @@ struct __pyx_obj_5_cdec_Decoder {
};
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":246
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":246
* raise NotImplemented('comparison not implemented for HypergraphEdge')
*
* cdef class HypergraphNode: # <<<<<<<<<<<<<<
@@ -926,7 +926,7 @@ struct __pyx_obj_5_cdec_HypergraphNode {
};
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":48
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":48
* return sparse
*
* cdef class SparseVector: # <<<<<<<<<<<<<<
@@ -939,7 +939,7 @@ struct __pyx_obj_5_cdec_SparseVector {
};
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":262
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":262
*
* property out_edges:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -955,7 +955,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_17___get__ {
};
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":32
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":32
* self.vector[0][fid] = value
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -971,7 +971,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct____iter__ {
};
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":44
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":44
* return self.stats.size()
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -988,7 +988,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_21___iter__ {
};
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":3
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":3
* from cython.operator cimport preincrement as pinc
*
* cdef class DenseVector: # <<<<<<<<<<<<<<
@@ -1002,7 +1002,7 @@ struct __pyx_obj_5_cdec_DenseVector {
};
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":199
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":199
* del self.grammar
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -1021,7 +1021,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_7___iter__ {
};
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":176
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":176
* out.fields[i] = ss[i]
*
* cdef class Metric: # <<<<<<<<<<<<<<
@@ -1034,7 +1034,7 @@ struct __pyx_obj_5_cdec_Metric {
};
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":26
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":26
* return fmap
*
* cdef class SufficientStats: # <<<<<<<<<<<<<<
@@ -1048,7 +1048,7 @@ struct __pyx_obj_5_cdec_SufficientStats {
};
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":49
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":49
* return unicode(hypergraph.JoshuaVisualizationString(self.hg[0]).c_str(), 'utf8')
*
* def kbest(self, size): # <<<<<<<<<<<<<<
@@ -1067,7 +1067,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_8_kbest {
};
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":81
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":81
* del e_derivations
*
* def kbest_features(self, size): # <<<<<<<<<<<<<<
@@ -1087,7 +1087,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_10_kbest_features {
};
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":216
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":216
*
* property tail_nodes:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -1103,7 +1103,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_15___get__ {
};
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":172
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":172
* self.rule.get().lhs_ = -TDConvert((<NT> lhs).cat)
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -1116,7 +1116,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_5___str__ {
};
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":6
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":6
*
* def _phrase(phrase):
* return ' '.join(w.encode('utf8') if isinstance(w, unicode) else str(w) for w in phrase) # <<<<<<<<<<<<<<
@@ -1133,7 +1133,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_3_genexpr {
};
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":62
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":62
* del derivations
*
* def kbest_trees(self, size): # <<<<<<<<<<<<<<
@@ -1156,7 +1156,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_9_kbest_trees {
};
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":4
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":4
* cimport kbest
*
* cdef class Hypergraph: # <<<<<<<<<<<<<<
@@ -1171,7 +1171,7 @@ struct __pyx_obj_5_cdec_Hypergraph {
};
-/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":3
+/* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":3
* cimport lattice
*
* cdef class Lattice: # <<<<<<<<<<<<<<
@@ -1184,7 +1184,7 @@ struct __pyx_obj_5_cdec_Lattice {
};
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":97
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":97
* del derivations
*
* def sample(self, unsigned n): # <<<<<<<<<<<<<<
@@ -1225,7 +1225,7 @@ struct __pyx_obj_5_cdec___pyx_scope_struct_23__make_config {
};
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":217
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":217
* self.grammar.get().SetGrammarName(name)
*
* cdef class TextGrammar(Grammar): # <<<<<<<<<<<<<<
@@ -1238,7 +1238,7 @@ struct __pyx_obj_5_cdec_TextGrammar {
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":4
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":4
* cimport kbest
*
* cdef class Hypergraph: # <<<<<<<<<<<<<<
@@ -1252,7 +1252,7 @@ struct __pyx_vtabstruct_5_cdec_Hypergraph {
static struct __pyx_vtabstruct_5_cdec_Hypergraph *__pyx_vtabptr_5_cdec_Hypergraph;
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":196
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":196
* return vector
*
* cdef class HypergraphEdge: # <<<<<<<<<<<<<<
@@ -1266,7 +1266,7 @@ struct __pyx_vtabstruct_5_cdec_HypergraphEdge {
static struct __pyx_vtabstruct_5_cdec_HypergraphEdge *__pyx_vtabptr_5_cdec_HypergraphEdge;
-/* "/home/vchahune/tools/cdec/python/src/cdec.sa._sa.pxd":12
+/* "/home/pauldb/workspace/cdec/python/src/cdec.sa._sa.pxd":12
* cdef void read_handle(self, FILE* f)
*
* cdef class IntList: # <<<<<<<<<<<<<<
@@ -1286,7 +1286,7 @@ struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList {
static struct __pyx_vtabstruct_4cdec_2sa_3_sa_IntList *__pyx_vtabptr_4cdec_2sa_3_sa_IntList;
-/* "/home/vchahune/tools/cdec/python/src/cdec.sa._sa.pxd":3
+/* "/home/pauldb/workspace/cdec/python/src/cdec.sa._sa.pxd":3
* from libc.stdio cimport FILE
*
* cdef class FloatList: # <<<<<<<<<<<<<<
@@ -1302,7 +1302,7 @@ struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList {
static struct __pyx_vtabstruct_4cdec_2sa_3_sa_FloatList *__pyx_vtabptr_4cdec_2sa_3_sa_FloatList;
-/* "/home/vchahune/tools/cdec/python/src/cdec.sa._sa.pxd":29
+/* "/home/pauldb/workspace/cdec/python/src/cdec.sa._sa.pxd":29
* cdef FloatList values
*
* cdef class Phrase: # <<<<<<<<<<<<<<
@@ -1317,7 +1317,7 @@ struct __pyx_vtabstruct_4cdec_2sa_3_sa_Phrase {
static struct __pyx_vtabstruct_4cdec_2sa_3_sa_Phrase *__pyx_vtabptr_4cdec_2sa_3_sa_Phrase;
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":246
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":246
* raise NotImplemented('comparison not implemented for HypergraphEdge')
*
* cdef class HypergraphNode: # <<<<<<<<<<<<<<
@@ -2026,7 +2026,7 @@ static char __pyx_k_26[] = "digraph lattice {";
static char __pyx_k_31[] = "\\\"";
static char __pyx_k_33[] = "%d [shape=doublecircle]";
static char __pyx_k_34[] = "}";
-static char __pyx_k_37[] = "/home/vchahune/tools/cdec/python/src/lattice.pxi";
+static char __pyx_k_37[] = "/home/pauldb/workspace/cdec/python/src/lattice.pxi";
static char __pyx_k_38[] = "\n";
static char __pyx_k_40[] = "sufficient stats vector index out of range";
static char __pyx_k_42[] = "candidate set index out of range";
@@ -2038,8 +2038,8 @@ static char __pyx_k_49[] = "#";
static char __pyx_k_52[] = "Cannot translate input type %s";
static char __pyx_k_53[] = "cdec.sa._sa";
static char __pyx_k_54[] = "*";
-static char __pyx_k_57[] = "/home/vchahune/tools/cdec/python/src/grammar.pxi";
-static char __pyx_k_63[] = "/home/vchahune/tools/cdec/python/src/_cdec.pyx";
+static char __pyx_k_57[] = "/home/pauldb/workspace/cdec/python/src/grammar.pxi";
+static char __pyx_k_63[] = "/home/pauldb/workspace/cdec/python/src/_cdec.pyx";
static char __pyx_k__a[] = "a";
static char __pyx_k__e[] = "e";
static char __pyx_k__f[] = "f";
@@ -2452,7 +2452,7 @@ static int __pyx_pw_5_cdec_11DenseVector_1__init__(PyObject *__pyx_v_self, PyObj
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":7
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":7
* cdef bint owned # if True, do not manage memory
*
* def __init__(self): # <<<<<<<<<<<<<<
@@ -2469,7 +2469,7 @@ static int __pyx_pf_5_cdec_11DenseVector___init__(struct __pyx_obj_5_cdec_DenseV
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":9
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":9
* def __init__(self):
* """DenseVector() -> Dense weight/feature vector."""
* self.vector = new vector[weight_t]() # <<<<<<<<<<<<<<
@@ -2479,7 +2479,7 @@ static int __pyx_pf_5_cdec_11DenseVector___init__(struct __pyx_obj_5_cdec_DenseV
try {__pyx_t_1 = new std::vector<weight_t>();} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
__pyx_v_self->vector = __pyx_t_1;
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":10
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":10
* """DenseVector() -> Dense weight/feature vector."""
* self.vector = new vector[weight_t]()
* self.owned = False # <<<<<<<<<<<<<<
@@ -2507,7 +2507,7 @@ static void __pyx_pw_5_cdec_11DenseVector_3__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyFinishContext();
}
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":12
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":12
* self.owned = False
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -2520,7 +2520,7 @@ static void __pyx_pf_5_cdec_11DenseVector_2__dealloc__(struct __pyx_obj_5_cdec_D
int __pyx_t_1;
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":13
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":13
*
* def __dealloc__(self):
* if not self.owned: # <<<<<<<<<<<<<<
@@ -2530,7 +2530,7 @@ static void __pyx_pf_5_cdec_11DenseVector_2__dealloc__(struct __pyx_obj_5_cdec_D
__pyx_t_1 = (!__pyx_v_self->owned);
if (__pyx_t_1) {
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":14
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":14
* def __dealloc__(self):
* if not self.owned:
* del self.vector # <<<<<<<<<<<<<<
@@ -2556,7 +2556,7 @@ static Py_ssize_t __pyx_pw_5_cdec_11DenseVector_5__len__(PyObject *__pyx_v_self)
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":16
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":16
* del self.vector
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -2569,7 +2569,7 @@ static Py_ssize_t __pyx_pf_5_cdec_11DenseVector_4__len__(struct __pyx_obj_5_cdec
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__", 0);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":17
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":17
*
* def __len__(self):
* return self.vector.size() # <<<<<<<<<<<<<<
@@ -2606,7 +2606,7 @@ static PyObject *__pyx_pw_5_cdec_11DenseVector_7__getitem__(PyObject *__pyx_v_se
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":19
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":19
* return self.vector.size()
*
* def __getitem__(self, char* fname): # <<<<<<<<<<<<<<
@@ -2626,7 +2626,7 @@ static PyObject *__pyx_pf_5_cdec_11DenseVector_6__getitem__(struct __pyx_obj_5_c
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getitem__", 0);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":20
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":20
*
* def __getitem__(self, char* fname):
* cdef int fid = FDConvert(fname) # <<<<<<<<<<<<<<
@@ -2635,7 +2635,7 @@ static PyObject *__pyx_pf_5_cdec_11DenseVector_6__getitem__(struct __pyx_obj_5_c
*/
__pyx_v_fid = FD::Convert(__pyx_v_fname);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":21
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":21
* def __getitem__(self, char* fname):
* cdef int fid = FDConvert(fname)
* if 0 <= fid < self.vector.size(): # <<<<<<<<<<<<<<
@@ -2648,7 +2648,7 @@ static PyObject *__pyx_pf_5_cdec_11DenseVector_6__getitem__(struct __pyx_obj_5_c
}
if (__pyx_t_1) {
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":22
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":22
* cdef int fid = FDConvert(fname)
* if 0 <= fid < self.vector.size():
* return self.vector[0][fid] # <<<<<<<<<<<<<<
@@ -2665,7 +2665,7 @@ static PyObject *__pyx_pf_5_cdec_11DenseVector_6__getitem__(struct __pyx_obj_5_c
}
__pyx_L3:;
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":23
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":23
* if 0 <= fid < self.vector.size():
* return self.vector[0][fid]
* raise KeyError(fname) # <<<<<<<<<<<<<<
@@ -2724,7 +2724,7 @@ static int __pyx_pw_5_cdec_11DenseVector_9__setitem__(PyObject *__pyx_v_self, Py
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":25
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":25
* raise KeyError(fname)
*
* def __setitem__(self, char* fname, float value): # <<<<<<<<<<<<<<
@@ -2744,7 +2744,7 @@ static int __pyx_pf_5_cdec_11DenseVector_8__setitem__(struct __pyx_obj_5_cdec_De
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__setitem__", 0);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":26
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":26
*
* def __setitem__(self, char* fname, float value):
* cdef int fid = FDConvert(fname) # <<<<<<<<<<<<<<
@@ -2753,7 +2753,7 @@ static int __pyx_pf_5_cdec_11DenseVector_8__setitem__(struct __pyx_obj_5_cdec_De
*/
__pyx_v_fid = FD::Convert(__pyx_v_fname);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":27
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":27
* def __setitem__(self, char* fname, float value):
* cdef int fid = FDConvert(fname)
* if fid < 0: raise KeyError(fname) # <<<<<<<<<<<<<<
@@ -2779,7 +2779,7 @@ static int __pyx_pf_5_cdec_11DenseVector_8__setitem__(struct __pyx_obj_5_cdec_De
}
__pyx_L3:;
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":28
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":28
* cdef int fid = FDConvert(fname)
* if fid < 0: raise KeyError(fname)
* if self.vector.size() <= fid: # <<<<<<<<<<<<<<
@@ -2789,7 +2789,7 @@ static int __pyx_pf_5_cdec_11DenseVector_8__setitem__(struct __pyx_obj_5_cdec_De
__pyx_t_1 = (__pyx_v_self->vector->size() <= __pyx_v_fid);
if (__pyx_t_1) {
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":29
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":29
* if fid < 0: raise KeyError(fname)
* if self.vector.size() <= fid:
* self.vector.resize(fid + 1) # <<<<<<<<<<<<<<
@@ -2801,7 +2801,7 @@ static int __pyx_pf_5_cdec_11DenseVector_8__setitem__(struct __pyx_obj_5_cdec_De
}
__pyx_L4:;
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":30
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":30
* if self.vector.size() <= fid:
* self.vector.resize(fid + 1)
* self.vector[0][fid] = value # <<<<<<<<<<<<<<
@@ -2834,7 +2834,7 @@ static PyObject *__pyx_pw_5_cdec_11DenseVector_11__iter__(PyObject *__pyx_v_self
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":32
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":32
* self.vector[0][fid] = value
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -2899,7 +2899,7 @@ static PyObject *__pyx_gb_5_cdec_11DenseVector_12generator(__pyx_GeneratorObject
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":34
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":34
* def __iter__(self):
* cdef unsigned fid
* for fid in range(1, self.vector.size()): # <<<<<<<<<<<<<<
@@ -2910,7 +2910,7 @@ static PyObject *__pyx_gb_5_cdec_11DenseVector_12generator(__pyx_GeneratorObject
for (__pyx_t_2 = 1; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_cur_scope->__pyx_v_fid = __pyx_t_2;
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":35
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":35
* cdef unsigned fid
* for fid in range(1, self.vector.size()):
* yield str(FDConvert(fid).c_str()), self.vector[0][fid] # <<<<<<<<<<<<<<
@@ -2983,7 +2983,7 @@ static PyObject *__pyx_pw_5_cdec_11DenseVector_14dot(PyObject *__pyx_v_self, PyO
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":37
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":37
* yield str(FDConvert(fid).c_str()), self.vector[0][fid]
*
* def dot(self, SparseVector other): # <<<<<<<<<<<<<<
@@ -3002,7 +3002,7 @@ static PyObject *__pyx_pf_5_cdec_11DenseVector_13dot(struct __pyx_obj_5_cdec_Den
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("dot", 0);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":39
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":39
* def dot(self, SparseVector other):
* """vector.dot(SparseVector other) -> Dot product of the two vectors."""
* return other.dot(self) # <<<<<<<<<<<<<<
@@ -3051,7 +3051,7 @@ static PyObject *__pyx_pw_5_cdec_11DenseVector_16tosparse(PyObject *__pyx_v_self
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":41
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":41
* return other.dot(self)
*
* def tosparse(self): # <<<<<<<<<<<<<<
@@ -3069,7 +3069,7 @@ static PyObject *__pyx_pf_5_cdec_11DenseVector_15tosparse(struct __pyx_obj_5_cde
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("tosparse", 0);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":43
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":43
* def tosparse(self):
* """vector.tosparse() -> Equivalent SparseVector."""
* cdef SparseVector sparse = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<<
@@ -3082,7 +3082,7 @@ static PyObject *__pyx_pf_5_cdec_11DenseVector_15tosparse(struct __pyx_obj_5_cde
__pyx_v_sparse = ((struct __pyx_obj_5_cdec_SparseVector *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":44
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":44
* """vector.tosparse() -> Equivalent SparseVector."""
* cdef SparseVector sparse = SparseVector.__new__(SparseVector)
* sparse.vector = new FastSparseVector[weight_t]() # <<<<<<<<<<<<<<
@@ -3091,7 +3091,7 @@ static PyObject *__pyx_pf_5_cdec_11DenseVector_15tosparse(struct __pyx_obj_5_cde
*/
__pyx_v_sparse->vector = new FastSparseVector<weight_t>();
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":45
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":45
* cdef SparseVector sparse = SparseVector.__new__(SparseVector)
* sparse.vector = new FastSparseVector[weight_t]()
* InitSparseVector(self.vector[0], sparse.vector) # <<<<<<<<<<<<<<
@@ -3100,7 +3100,7 @@ static PyObject *__pyx_pf_5_cdec_11DenseVector_15tosparse(struct __pyx_obj_5_cde
*/
Weights::InitSparseVector((__pyx_v_self->vector[0]), __pyx_v_sparse->vector);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":46
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":46
* sparse.vector = new FastSparseVector[weight_t]()
* InitSparseVector(self.vector[0], sparse.vector)
* return sparse # <<<<<<<<<<<<<<
@@ -3143,7 +3143,7 @@ static int __pyx_pw_5_cdec_12SparseVector_1__init__(PyObject *__pyx_v_self, PyOb
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":51
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":51
* cdef FastSparseVector[weight_t]* vector
*
* def __init__(self): # <<<<<<<<<<<<<<
@@ -3156,7 +3156,7 @@ static int __pyx_pf_5_cdec_12SparseVector___init__(struct __pyx_obj_5_cdec_Spars
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__", 0);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":53
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":53
* def __init__(self):
* """SparseVector() -> Sparse feature/weight vector."""
* self.vector = new FastSparseVector[weight_t]() # <<<<<<<<<<<<<<
@@ -3179,7 +3179,7 @@ static void __pyx_pw_5_cdec_12SparseVector_3__dealloc__(PyObject *__pyx_v_self)
__Pyx_RefNannyFinishContext();
}
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":55
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":55
* self.vector = new FastSparseVector[weight_t]()
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -3191,7 +3191,7 @@ static void __pyx_pf_5_cdec_12SparseVector_2__dealloc__(CYTHON_UNUSED struct __p
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":56
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":56
*
* def __dealloc__(self):
* del self.vector # <<<<<<<<<<<<<<
@@ -3215,7 +3215,7 @@ static PyObject *__pyx_pw_5_cdec_12SparseVector_5copy(PyObject *__pyx_v_self, CY
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":58
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":58
* del self.vector
*
* def copy(self): # <<<<<<<<<<<<<<
@@ -3232,7 +3232,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_4copy(struct __pyx_obj_5_cdec_Sp
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("copy", 0);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":60
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":60
* def copy(self):
* """vector.copy() -> SparseVector copy."""
* return self * 1 # <<<<<<<<<<<<<<
@@ -3279,7 +3279,7 @@ static PyObject *__pyx_pw_5_cdec_12SparseVector_7__getitem__(PyObject *__pyx_v_s
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":62
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":62
* return self * 1
*
* def __getitem__(self, char* fname): # <<<<<<<<<<<<<<
@@ -3299,7 +3299,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_6__getitem__(struct __pyx_obj_5_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getitem__", 0);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":63
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":63
*
* def __getitem__(self, char* fname):
* cdef int fid = FDConvert(fname) # <<<<<<<<<<<<<<
@@ -3308,7 +3308,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_6__getitem__(struct __pyx_obj_5_
*/
__pyx_v_fid = FD::Convert(__pyx_v_fname);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":64
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":64
* def __getitem__(self, char* fname):
* cdef int fid = FDConvert(fname)
* if fid < 0: raise KeyError(fname) # <<<<<<<<<<<<<<
@@ -3334,7 +3334,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_6__getitem__(struct __pyx_obj_5_
}
__pyx_L3:;
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":65
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":65
* cdef int fid = FDConvert(fname)
* if fid < 0: raise KeyError(fname)
* return self.vector.value(fid) # <<<<<<<<<<<<<<
@@ -3386,7 +3386,7 @@ static int __pyx_pw_5_cdec_12SparseVector_9__setitem__(PyObject *__pyx_v_self, P
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":67
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":67
* return self.vector.value(fid)
*
* def __setitem__(self, char* fname, float value): # <<<<<<<<<<<<<<
@@ -3406,7 +3406,7 @@ static int __pyx_pf_5_cdec_12SparseVector_8__setitem__(struct __pyx_obj_5_cdec_S
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__setitem__", 0);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":68
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":68
*
* def __setitem__(self, char* fname, float value):
* cdef int fid = FDConvert(fname) # <<<<<<<<<<<<<<
@@ -3415,7 +3415,7 @@ static int __pyx_pf_5_cdec_12SparseVector_8__setitem__(struct __pyx_obj_5_cdec_S
*/
__pyx_v_fid = FD::Convert(__pyx_v_fname);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":69
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":69
* def __setitem__(self, char* fname, float value):
* cdef int fid = FDConvert(fname)
* if fid < 0: raise KeyError(fname) # <<<<<<<<<<<<<<
@@ -3441,7 +3441,7 @@ static int __pyx_pf_5_cdec_12SparseVector_8__setitem__(struct __pyx_obj_5_cdec_S
}
__pyx_L3:;
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":70
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":70
* cdef int fid = FDConvert(fname)
* if fid < 0: raise KeyError(fname)
* self.vector.set_value(fid, value) # <<<<<<<<<<<<<<
@@ -3474,7 +3474,7 @@ static PyObject *__pyx_pw_5_cdec_12SparseVector_11__iter__(PyObject *__pyx_v_sel
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":72
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":72
* self.vector.set_value(fid, value)
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -3539,7 +3539,7 @@ static PyObject *__pyx_gb_5_cdec_12SparseVector_12generator1(__pyx_GeneratorObje
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":73
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":73
*
* def __iter__(self):
* cdef FastSparseVector[weight_t].const_iterator* it = new FastSparseVector[weight_t].const_iterator(self.vector[0], False) # <<<<<<<<<<<<<<
@@ -3548,7 +3548,7 @@ static PyObject *__pyx_gb_5_cdec_12SparseVector_12generator1(__pyx_GeneratorObje
*/
__pyx_cur_scope->__pyx_v_it = new FastSparseVector<weight_t>::const_iterator((__pyx_cur_scope->__pyx_v_self->vector[0]), 0);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":75
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":75
* cdef FastSparseVector[weight_t].const_iterator* it = new FastSparseVector[weight_t].const_iterator(self.vector[0], False)
* cdef unsigned i
* try: # <<<<<<<<<<<<<<
@@ -3557,7 +3557,7 @@ static PyObject *__pyx_gb_5_cdec_12SparseVector_12generator1(__pyx_GeneratorObje
*/
/*try:*/ {
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":76
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":76
* cdef unsigned i
* try:
* for i in range(self.vector.size()): # <<<<<<<<<<<<<<
@@ -3568,7 +3568,7 @@ static PyObject *__pyx_gb_5_cdec_12SparseVector_12generator1(__pyx_GeneratorObje
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_2;
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":77
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":77
* try:
* for i in range(self.vector.size()):
* yield (str(FDConvert(it[0].ptr().first).c_str()), it[0].ptr().second) # <<<<<<<<<<<<<<
@@ -3609,7 +3609,7 @@ static PyObject *__pyx_gb_5_cdec_12SparseVector_12generator1(__pyx_GeneratorObje
__pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L5;}
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":78
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":78
* for i in range(self.vector.size()):
* yield (str(FDConvert(it[0].ptr().first).c_str()), it[0].ptr().second)
* pinc(it[0]) # ++it # <<<<<<<<<<<<<<
@@ -3620,7 +3620,7 @@ static PyObject *__pyx_gb_5_cdec_12SparseVector_12generator1(__pyx_GeneratorObje
}
}
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":80
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":80
* pinc(it[0]) # ++it
* finally:
* del it # <<<<<<<<<<<<<<
@@ -3682,7 +3682,7 @@ static PyObject *__pyx_pw_5_cdec_12SparseVector_14dot(PyObject *__pyx_v_self, Py
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":82
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":82
* del it
*
* def dot(self, other): # <<<<<<<<<<<<<<
@@ -3701,7 +3701,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_13dot(struct __pyx_obj_5_cdec_Sp
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("dot", 0);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":84
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":84
* def dot(self, other):
* """vector.dot(SparseVector/DenseVector other) -> Dot product of the two vectors."""
* if isinstance(other, DenseVector): # <<<<<<<<<<<<<<
@@ -3714,7 +3714,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_13dot(struct __pyx_obj_5_cdec_Sp
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":85
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":85
* """vector.dot(SparseVector/DenseVector other) -> Dot product of the two vectors."""
* if isinstance(other, DenseVector):
* return self.vector.dot((<DenseVector> other).vector[0]) # <<<<<<<<<<<<<<
@@ -3730,7 +3730,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_13dot(struct __pyx_obj_5_cdec_Sp
goto __pyx_L3;
}
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":86
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":86
* if isinstance(other, DenseVector):
* return self.vector.dot((<DenseVector> other).vector[0])
* elif isinstance(other, SparseVector): # <<<<<<<<<<<<<<
@@ -3743,7 +3743,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_13dot(struct __pyx_obj_5_cdec_Sp
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":87
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":87
* return self.vector.dot((<DenseVector> other).vector[0])
* elif isinstance(other, SparseVector):
* return self.vector.dot((<SparseVector> other).vector[0]) # <<<<<<<<<<<<<<
@@ -3760,7 +3760,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_13dot(struct __pyx_obj_5_cdec_Sp
}
__pyx_L3:;
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":88
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":88
* elif isinstance(other, SparseVector):
* return self.vector.dot((<SparseVector> other).vector[0])
* raise TypeError('cannot take the dot product of %s and SparseVector' % type(other)) # <<<<<<<<<<<<<<
@@ -3811,7 +3811,7 @@ static PyObject *__pyx_pw_5_cdec_12SparseVector_16__richcmp__(PyObject *__pyx_v_
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":90
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":90
* raise TypeError('cannot take the dot product of %s and SparseVector' % type(other))
*
* def __richcmp__(SparseVector x, SparseVector y, int op): # <<<<<<<<<<<<<<
@@ -3829,7 +3829,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_15__richcmp__(struct __pyx_obj_5
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__richcmp__", 0);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":93
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":93
* if op == 2: # ==
* return x.vector[0] == y.vector[0]
* elif op == 3: # != # <<<<<<<<<<<<<<
@@ -3838,7 +3838,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_15__richcmp__(struct __pyx_obj_5
*/
switch (__pyx_v_op) {
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":91
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":91
*
* def __richcmp__(SparseVector x, SparseVector y, int op):
* if op == 2: # == # <<<<<<<<<<<<<<
@@ -3847,7 +3847,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_15__richcmp__(struct __pyx_obj_5
*/
case 2:
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":92
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":92
* def __richcmp__(SparseVector x, SparseVector y, int op):
* if op == 2: # ==
* return x.vector[0] == y.vector[0] # <<<<<<<<<<<<<<
@@ -3862,7 +3862,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_15__richcmp__(struct __pyx_obj_5
goto __pyx_L0;
break;
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":93
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":93
* if op == 2: # ==
* return x.vector[0] == y.vector[0]
* elif op == 3: # != # <<<<<<<<<<<<<<
@@ -3871,7 +3871,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_15__richcmp__(struct __pyx_obj_5
*/
case 3:
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":94
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":94
* return x.vector[0] == y.vector[0]
* elif op == 3: # !=
* return not (x == y) # <<<<<<<<<<<<<<
@@ -3890,7 +3890,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_15__richcmp__(struct __pyx_obj_5
break;
}
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":95
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":95
* elif op == 3: # !=
* return not (x == y)
* raise NotImplemented('comparison not implemented for SparseVector') # <<<<<<<<<<<<<<
@@ -3926,7 +3926,7 @@ static Py_ssize_t __pyx_pw_5_cdec_12SparseVector_18__len__(PyObject *__pyx_v_sel
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":97
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":97
* raise NotImplemented('comparison not implemented for SparseVector')
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -3939,7 +3939,7 @@ static Py_ssize_t __pyx_pf_5_cdec_12SparseVector_17__len__(struct __pyx_obj_5_cd
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__", 0);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":98
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":98
*
* def __len__(self):
* return self.vector.size() # <<<<<<<<<<<<<<
@@ -3976,7 +3976,7 @@ static int __pyx_pw_5_cdec_12SparseVector_20__contains__(PyObject *__pyx_v_self,
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":100
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":100
* return self.vector.size()
*
* def __contains__(self, char* fname): # <<<<<<<<<<<<<<
@@ -3989,7 +3989,7 @@ static int __pyx_pf_5_cdec_12SparseVector_19__contains__(struct __pyx_obj_5_cdec
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__contains__", 0);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":101
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":101
*
* def __contains__(self, char* fname):
* return self.vector.nonzero(FDConvert(fname)) # <<<<<<<<<<<<<<
@@ -4016,7 +4016,7 @@ static PyObject *__pyx_pw_5_cdec_12SparseVector_22__neg__(PyObject *__pyx_v_self
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":103
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":103
* return self.vector.nonzero(FDConvert(fname))
*
* def __neg__(self): # <<<<<<<<<<<<<<
@@ -4034,7 +4034,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_21__neg__(struct __pyx_obj_5_cde
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__neg__", 0);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":104
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":104
*
* def __neg__(self):
* cdef SparseVector result = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<<
@@ -4047,7 +4047,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_21__neg__(struct __pyx_obj_5_cde
__pyx_v_result = ((struct __pyx_obj_5_cdec_SparseVector *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":105
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":105
* def __neg__(self):
* cdef SparseVector result = SparseVector.__new__(SparseVector)
* result.vector = new FastSparseVector[weight_t](self.vector[0]) # <<<<<<<<<<<<<<
@@ -4056,7 +4056,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_21__neg__(struct __pyx_obj_5_cde
*/
__pyx_v_result->vector = new FastSparseVector<weight_t>((__pyx_v_self->vector[0]));
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":106
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":106
* cdef SparseVector result = SparseVector.__new__(SparseVector)
* result.vector = new FastSparseVector[weight_t](self.vector[0])
* result.vector[0] *= -1.0 # <<<<<<<<<<<<<<
@@ -4065,7 +4065,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_21__neg__(struct __pyx_obj_5_cde
*/
(__pyx_v_result->vector[0]) *= -1.0;
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":107
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":107
* result.vector = new FastSparseVector[weight_t](self.vector[0])
* result.vector[0] *= -1.0
* return result # <<<<<<<<<<<<<<
@@ -4106,7 +4106,7 @@ static PyObject *__pyx_pw_5_cdec_12SparseVector_24__iadd__(PyObject *__pyx_v_sel
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":109
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":109
* return result
*
* def __iadd__(SparseVector self, SparseVector other): # <<<<<<<<<<<<<<
@@ -4119,7 +4119,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_23__iadd__(struct __pyx_obj_5_cd
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iadd__", 0);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":110
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":110
*
* def __iadd__(SparseVector self, SparseVector other):
* self.vector[0] += other.vector[0] # <<<<<<<<<<<<<<
@@ -4128,7 +4128,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_23__iadd__(struct __pyx_obj_5_cd
*/
(__pyx_v_self->vector[0]) += (__pyx_v_other->vector[0]);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":111
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":111
* def __iadd__(SparseVector self, SparseVector other):
* self.vector[0] += other.vector[0]
* return self # <<<<<<<<<<<<<<
@@ -4163,7 +4163,7 @@ static PyObject *__pyx_pw_5_cdec_12SparseVector_26__isub__(PyObject *__pyx_v_sel
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":113
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":113
* return self
*
* def __isub__(SparseVector self, SparseVector other): # <<<<<<<<<<<<<<
@@ -4176,7 +4176,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_25__isub__(struct __pyx_obj_5_cd
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__isub__", 0);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":114
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":114
*
* def __isub__(SparseVector self, SparseVector other):
* self.vector[0] -= other.vector[0] # <<<<<<<<<<<<<<
@@ -4185,7 +4185,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_25__isub__(struct __pyx_obj_5_cd
*/
(__pyx_v_self->vector[0]) -= (__pyx_v_other->vector[0]);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":115
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":115
* def __isub__(SparseVector self, SparseVector other):
* self.vector[0] -= other.vector[0]
* return self # <<<<<<<<<<<<<<
@@ -4225,7 +4225,7 @@ static PyObject *__pyx_pw_5_cdec_12SparseVector_28__imul__(PyObject *__pyx_v_sel
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":117
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":117
* return self
*
* def __imul__(SparseVector self, float scalar): # <<<<<<<<<<<<<<
@@ -4238,7 +4238,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_27__imul__(struct __pyx_obj_5_cd
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__imul__", 0);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":118
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":118
*
* def __imul__(SparseVector self, float scalar):
* self.vector[0] *= scalar # <<<<<<<<<<<<<<
@@ -4247,7 +4247,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_27__imul__(struct __pyx_obj_5_cd
*/
(__pyx_v_self->vector[0]) *= __pyx_v_scalar;
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":119
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":119
* def __imul__(SparseVector self, float scalar):
* self.vector[0] *= scalar
* return self # <<<<<<<<<<<<<<
@@ -4289,7 +4289,7 @@ static PyObject *__pyx_pw_5_cdec_12SparseVector_30__idiv__(PyObject *__pyx_v_sel
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":121
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":121
* return self
*
* def __idiv__(SparseVector self, float scalar): # <<<<<<<<<<<<<<
@@ -4303,7 +4303,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_29__idiv__(struct __pyx_obj_5_cd
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__idiv__", 0);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":122
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":122
*
* def __idiv__(SparseVector self, float scalar):
* self.vector[0] /= scalar # <<<<<<<<<<<<<<
@@ -4312,7 +4312,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_29__idiv__(struct __pyx_obj_5_cd
*/
(__pyx_v_self->vector[0]) /= __pyx_v_scalar;
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":123
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":123
* def __idiv__(SparseVector self, float scalar):
* self.vector[0] /= scalar
* return self # <<<<<<<<<<<<<<
@@ -4349,7 +4349,7 @@ static PyObject *__pyx_pw_5_cdec_12SparseVector_32__add__(PyObject *__pyx_v_x, P
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":125
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":125
* return self
*
* def __add__(SparseVector x, SparseVector y): # <<<<<<<<<<<<<<
@@ -4367,7 +4367,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_31__add__(struct __pyx_obj_5_cde
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__add__", 0);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":126
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":126
*
* def __add__(SparseVector x, SparseVector y):
* cdef SparseVector result = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<<
@@ -4380,7 +4380,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_31__add__(struct __pyx_obj_5_cde
__pyx_v_result = ((struct __pyx_obj_5_cdec_SparseVector *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":127
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":127
* def __add__(SparseVector x, SparseVector y):
* cdef SparseVector result = SparseVector.__new__(SparseVector)
* result.vector = new FastSparseVector[weight_t](x.vector[0] + y.vector[0]) # <<<<<<<<<<<<<<
@@ -4389,7 +4389,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_31__add__(struct __pyx_obj_5_cde
*/
__pyx_v_result->vector = new FastSparseVector<weight_t>(((__pyx_v_x->vector[0]) + (__pyx_v_y->vector[0])));
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":128
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":128
* cdef SparseVector result = SparseVector.__new__(SparseVector)
* result.vector = new FastSparseVector[weight_t](x.vector[0] + y.vector[0])
* return result # <<<<<<<<<<<<<<
@@ -4431,7 +4431,7 @@ static PyObject *__pyx_pw_5_cdec_12SparseVector_34__sub__(PyObject *__pyx_v_x, P
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":130
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":130
* return result
*
* def __sub__(SparseVector x, SparseVector y): # <<<<<<<<<<<<<<
@@ -4449,7 +4449,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_33__sub__(struct __pyx_obj_5_cde
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__sub__", 0);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":131
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":131
*
* def __sub__(SparseVector x, SparseVector y):
* cdef SparseVector result = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<<
@@ -4462,7 +4462,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_33__sub__(struct __pyx_obj_5_cde
__pyx_v_result = ((struct __pyx_obj_5_cdec_SparseVector *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":132
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":132
* def __sub__(SparseVector x, SparseVector y):
* cdef SparseVector result = SparseVector.__new__(SparseVector)
* result.vector = new FastSparseVector[weight_t](x.vector[0] - y.vector[0]) # <<<<<<<<<<<<<<
@@ -4471,7 +4471,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_33__sub__(struct __pyx_obj_5_cde
*/
__pyx_v_result->vector = new FastSparseVector<weight_t>(((__pyx_v_x->vector[0]) - (__pyx_v_y->vector[0])));
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":133
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":133
* cdef SparseVector result = SparseVector.__new__(SparseVector)
* result.vector = new FastSparseVector[weight_t](x.vector[0] - y.vector[0])
* return result # <<<<<<<<<<<<<<
@@ -4507,7 +4507,7 @@ static PyObject *__pyx_pw_5_cdec_12SparseVector_36__mul__(PyObject *__pyx_v_x, P
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":135
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":135
* return result
*
* def __mul__(x, y): # <<<<<<<<<<<<<<
@@ -4529,7 +4529,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_35__mul__(PyObject *__pyx_v_x, P
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__mul__", 0);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":138
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":138
* cdef SparseVector vector
* cdef float scalar
* if isinstance(x, SparseVector): vector, scalar = x, y # <<<<<<<<<<<<<<
@@ -4552,7 +4552,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_35__mul__(PyObject *__pyx_v_x, P
}
/*else*/ {
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":139
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":139
* cdef float scalar
* if isinstance(x, SparseVector): vector, scalar = x, y
* else: vector, scalar = y, x # <<<<<<<<<<<<<<
@@ -4569,7 +4569,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_35__mul__(PyObject *__pyx_v_x, P
}
__pyx_L3:;
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":140
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":140
* if isinstance(x, SparseVector): vector, scalar = x, y
* else: vector, scalar = y, x
* cdef SparseVector result = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<<
@@ -4582,7 +4582,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_35__mul__(PyObject *__pyx_v_x, P
__pyx_v_result = ((struct __pyx_obj_5_cdec_SparseVector *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":141
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":141
* else: vector, scalar = y, x
* cdef SparseVector result = SparseVector.__new__(SparseVector)
* result.vector = new FastSparseVector[weight_t](vector.vector[0] * scalar) # <<<<<<<<<<<<<<
@@ -4591,7 +4591,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_35__mul__(PyObject *__pyx_v_x, P
*/
__pyx_v_result->vector = new FastSparseVector<weight_t>(((__pyx_v_vector->vector[0]) * __pyx_v_scalar));
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":142
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":142
* cdef SparseVector result = SparseVector.__new__(SparseVector)
* result.vector = new FastSparseVector[weight_t](vector.vector[0] * scalar)
* return result # <<<<<<<<<<<<<<
@@ -4630,7 +4630,7 @@ static PyObject *__pyx_pw_5_cdec_12SparseVector_38__div__(PyObject *__pyx_v_x, P
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/
-/* "/home/vchahune/tools/cdec/python/src/vectors.pxi":144
+/* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":144
* return result
*
* def __div__(x, y): # <<<<<<<<<<<<<<
@@ -4653,7 +4653,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_37__div__(PyObject *__pyx_v_x, P
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__div__", 0);
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":147
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":147
* cdef SparseVector vector
* cdef float scalar
* if isinstance(x, SparseVector): vector, scalar = x, y # <<<<<<<<<<<<<<
@@ -4676,7 +4676,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_37__div__(PyObject *__pyx_v_x, P
}
/*else*/ {
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":148
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":148
* cdef float scalar
* if isinstance(x, SparseVector): vector, scalar = x, y
* else: vector, scalar = y, x # <<<<<<<<<<<<<<
@@ -4693,7 +4693,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_37__div__(PyObject *__pyx_v_x, P
}
__pyx_L3:;
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":149
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":149
* if isinstance(x, SparseVector): vector, scalar = x, y
* else: vector, scalar = y, x
* cdef SparseVector result = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<<
@@ -4706,7 +4706,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_37__div__(PyObject *__pyx_v_x, P
__pyx_v_result = ((struct __pyx_obj_5_cdec_SparseVector *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":150
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":150
* else: vector, scalar = y, x
* cdef SparseVector result = SparseVector.__new__(SparseVector)
* result.vector = new FastSparseVector[weight_t](vector.vector[0] / scalar) # <<<<<<<<<<<<<<
@@ -4714,7 +4714,7 @@ static PyObject *__pyx_pf_5_cdec_12SparseVector_37__div__(PyObject *__pyx_v_x, P
*/
__pyx_v_result->vector = new FastSparseVector<weight_t>(((__pyx_v_vector->vector[0]) / __pyx_v_scalar));
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":151
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":151
* cdef SparseVector result = SparseVector.__new__(SparseVector)
* result.vector = new FastSparseVector[weight_t](vector.vector[0] / scalar)
* return result # <<<<<<<<<<<<<<
@@ -4752,7 +4752,7 @@ static PyObject *__pyx_pw_5_cdec_1_phrase(PyObject *__pyx_self, PyObject *__pyx_
}
static PyObject *__pyx_gb_5_cdec_7_phrase_2generator18(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":6
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":6
*
* def _phrase(phrase):
* return ' '.join(w.encode('utf8') if isinstance(w, unicode) else str(w) for w in phrase) # <<<<<<<<<<<<<<
@@ -4918,7 +4918,7 @@ static PyObject *__pyx_gb_5_cdec_7_phrase_2generator18(__pyx_GeneratorObject *__
return NULL;
}
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":5
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":5
* import cdec.sa._sa as _sa
*
* def _phrase(phrase): # <<<<<<<<<<<<<<
@@ -4947,7 +4947,7 @@ static PyObject *__pyx_pf_5_cdec__phrase(CYTHON_UNUSED PyObject *__pyx_self, PyO
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_phrase);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_phrase);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":6
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":6
*
* def _phrase(phrase):
* return ' '.join(w.encode('utf8') if isinstance(w, unicode) else str(w) for w in phrase) # <<<<<<<<<<<<<<
@@ -5058,7 +5058,7 @@ static int __pyx_pw_5_cdec_2NT_1__init__(PyObject *__pyx_v_self, PyObject *__pyx
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":11
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":11
* cdef public bytes cat
* cdef public unsigned ref
* def __init__(self, bytes cat, unsigned ref=0): # <<<<<<<<<<<<<<
@@ -5071,7 +5071,7 @@ static int __pyx_pf_5_cdec_2NT___init__(struct __pyx_obj_5_cdec_NT *__pyx_v_self
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__", 0);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":13
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":13
* def __init__(self, bytes cat, unsigned ref=0):
* """NT(bytes cat, int ref=0) -> Non-terminal from category `cat`."""
* self.cat = cat # <<<<<<<<<<<<<<
@@ -5084,7 +5084,7 @@ static int __pyx_pf_5_cdec_2NT___init__(struct __pyx_obj_5_cdec_NT *__pyx_v_self
__Pyx_DECREF(((PyObject *)__pyx_v_self->cat));
__pyx_v_self->cat = __pyx_v_cat;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":14
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":14
* """NT(bytes cat, int ref=0) -> Non-terminal from category `cat`."""
* self.cat = cat
* self.ref = ref # <<<<<<<<<<<<<<
@@ -5109,7 +5109,7 @@ static PyObject *__pyx_pw_5_cdec_2NT_3__str__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":16
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":16
* self.ref = ref
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -5128,7 +5128,7 @@ static PyObject *__pyx_pf_5_cdec_2NT_2__str__(struct __pyx_obj_5_cdec_NT *__pyx_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__str__", 0);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":17
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":17
*
* def __str__(self):
* if self.ref > 0: # <<<<<<<<<<<<<<
@@ -5138,7 +5138,7 @@ static PyObject *__pyx_pf_5_cdec_2NT_2__str__(struct __pyx_obj_5_cdec_NT *__pyx_
__pyx_t_1 = (__pyx_v_self->ref > 0);
if (__pyx_t_1) {
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":18
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":18
* def __str__(self):
* if self.ref > 0:
* return '[%s,%d]' % (self.cat, self.ref) # <<<<<<<<<<<<<<
@@ -5166,7 +5166,7 @@ static PyObject *__pyx_pf_5_cdec_2NT_2__str__(struct __pyx_obj_5_cdec_NT *__pyx_
}
__pyx_L3:;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":19
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":19
* if self.ref > 0:
* return '[%s,%d]' % (self.cat, self.ref)
* return '[%s]' % self.cat # <<<<<<<<<<<<<<
@@ -5204,7 +5204,7 @@ static PyObject *__pyx_pw_5_cdec_2NT_3cat_1__get__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":9
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":9
*
* cdef class NT:
* cdef public bytes cat # <<<<<<<<<<<<<<
@@ -5300,7 +5300,7 @@ static PyObject *__pyx_pw_5_cdec_2NT_3ref_1__get__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":10
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":10
* cdef class NT:
* cdef public bytes cat
* cdef public unsigned ref # <<<<<<<<<<<<<<
@@ -5418,7 +5418,7 @@ static int __pyx_pw_5_cdec_5NTRef_1__init__(PyObject *__pyx_v_self, PyObject *__
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":23
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":23
* cdef class NTRef:
* cdef public unsigned ref
* def __init__(self, unsigned ref): # <<<<<<<<<<<<<<
@@ -5431,7 +5431,7 @@ static int __pyx_pf_5_cdec_5NTRef___init__(struct __pyx_obj_5_cdec_NTRef *__pyx_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__", 0);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":25
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":25
* def __init__(self, unsigned ref):
* """NTRef(int ref) -> Non-terminal reference."""
* self.ref = ref # <<<<<<<<<<<<<<
@@ -5456,7 +5456,7 @@ static PyObject *__pyx_pw_5_cdec_5NTRef_3__str__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":27
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":27
* self.ref = ref
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -5474,7 +5474,7 @@ static PyObject *__pyx_pf_5_cdec_5NTRef_2__str__(struct __pyx_obj_5_cdec_NTRef *
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__str__", 0);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":28
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":28
*
* def __str__(self):
* return '[%d]' % self.ref # <<<<<<<<<<<<<<
@@ -5515,7 +5515,7 @@ static PyObject *__pyx_pw_5_cdec_5NTRef_3ref_1__get__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":22
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":22
*
* cdef class NTRef:
* cdef public unsigned ref # <<<<<<<<<<<<<<
@@ -5582,7 +5582,7 @@ static int __pyx_pf_5_cdec_5NTRef_3ref_2__set__(struct __pyx_obj_5_cdec_NTRef *_
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":30
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":30
* return '[%d]' % self.ref
*
* cdef TRule convert_rule(_sa.Rule rule): # <<<<<<<<<<<<<<
@@ -5612,7 +5612,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("convert_rule", 0);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":31
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":31
*
* cdef TRule convert_rule(_sa.Rule rule):
* lhs = _sa.sym_tocat(rule.lhs) # <<<<<<<<<<<<<<
@@ -5621,7 +5621,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o
*/
__pyx_v_lhs = __pyx_f_4cdec_2sa_3_sa_sym_tocat(__pyx_v_rule->lhs);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":32
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":32
* cdef TRule convert_rule(_sa.Rule rule):
* lhs = _sa.sym_tocat(rule.lhs)
* scores = dict(rule.scores) # <<<<<<<<<<<<<<
@@ -5639,7 +5639,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o
__pyx_v_scores = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":33
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":33
* lhs = _sa.sym_tocat(rule.lhs)
* scores = dict(rule.scores)
* f, e = [], [] # <<<<<<<<<<<<<<
@@ -5655,7 +5655,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o
__pyx_v_e = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":34
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":34
* scores = dict(rule.scores)
* f, e = [], []
* cdef int* fsyms = rule.f.syms # <<<<<<<<<<<<<<
@@ -5664,7 +5664,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o
*/
__pyx_v_fsyms = __pyx_v_rule->f->syms;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":35
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":35
* f, e = [], []
* cdef int* fsyms = rule.f.syms
* for i in range(rule.f.n): # <<<<<<<<<<<<<<
@@ -5675,7 +5675,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_i = __pyx_t_4;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":36
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":36
* cdef int* fsyms = rule.f.syms
* for i in range(rule.f.n):
* if _sa.sym_isvar(fsyms[i]): # <<<<<<<<<<<<<<
@@ -5685,7 +5685,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o
__pyx_t_5 = __pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_fsyms[__pyx_v_i]));
if (__pyx_t_5) {
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":37
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":37
* for i in range(rule.f.n):
* if _sa.sym_isvar(fsyms[i]):
* f.append(NT(_sa.sym_tocat(fsyms[i]))) # <<<<<<<<<<<<<<
@@ -5708,7 +5708,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o
}
/*else*/ {
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":39
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":39
* f.append(NT(_sa.sym_tocat(fsyms[i])))
* else:
* f.append(_sa.sym_tostring(fsyms[i])) # <<<<<<<<<<<<<<
@@ -5723,7 +5723,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o
__pyx_L5:;
}
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":40
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":40
* else:
* f.append(_sa.sym_tostring(fsyms[i]))
* cdef int* esyms = rule.e.syms # <<<<<<<<<<<<<<
@@ -5732,7 +5732,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o
*/
__pyx_v_esyms = __pyx_v_rule->e->syms;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":41
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":41
* f.append(_sa.sym_tostring(fsyms[i]))
* cdef int* esyms = rule.e.syms
* for i in range(rule.e.n): # <<<<<<<<<<<<<<
@@ -5743,7 +5743,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_i = __pyx_t_4;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":42
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":42
* cdef int* esyms = rule.e.syms
* for i in range(rule.e.n):
* if _sa.sym_isvar(esyms[i]): # <<<<<<<<<<<<<<
@@ -5753,7 +5753,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o
__pyx_t_5 = __pyx_f_4cdec_2sa_3_sa_sym_isvar((__pyx_v_esyms[__pyx_v_i]));
if (__pyx_t_5) {
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":43
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":43
* for i in range(rule.e.n):
* if _sa.sym_isvar(esyms[i]):
* e.append(NTRef(_sa.sym_getindex(esyms[i]))) # <<<<<<<<<<<<<<
@@ -5776,7 +5776,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o
}
/*else*/ {
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":45
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":45
* e.append(NTRef(_sa.sym_getindex(esyms[i])))
* else:
* e.append(_sa.sym_tostring(esyms[i])) # <<<<<<<<<<<<<<
@@ -5791,7 +5791,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o
__pyx_L8:;
}
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":46
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":46
* else:
* e.append(_sa.sym_tostring(esyms[i]))
* a = list(rule.alignments()) # <<<<<<<<<<<<<<
@@ -5814,7 +5814,7 @@ static struct __pyx_obj_5_cdec_TRule *__pyx_f_5_cdec_convert_rule(struct __pyx_o
__pyx_v_a = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":47
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":47
* e.append(_sa.sym_tostring(esyms[i]))
* a = list(rule.alignments())
* return TRule(lhs, f, e, scores, a) # <<<<<<<<<<<<<<
@@ -5884,7 +5884,7 @@ static int __pyx_pw_5_cdec_5TRule_1__init__(PyObject *__pyx_v_self, PyObject *__
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__lhs,&__pyx_n_s__f,&__pyx_n_s__e,&__pyx_n_s__scores,&__pyx_n_s__a,0};
PyObject* values[5] = {0,0,0,0,0};
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":52
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":52
* cdef shared_ptr[grammar.TRule]* rule
*
* def __init__(self, lhs, f, e, scores, a=None): # <<<<<<<<<<<<<<
@@ -5973,7 +5973,7 @@ static int __pyx_pf_5_cdec_5TRule___init__(struct __pyx_obj_5_cdec_TRule *__pyx_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":59
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":59
* scores: dictionary of feature scores
* a: optional list of alignment points"""
* self.rule = new shared_ptr[grammar.TRule](new grammar.TRule()) # <<<<<<<<<<<<<<
@@ -5983,7 +5983,7 @@ static int __pyx_pf_5_cdec_5TRule___init__(struct __pyx_obj_5_cdec_TRule *__pyx_
try {__pyx_t_1 = new TRule();} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
__pyx_v_self->rule = new boost::shared_ptr<TRule>(__pyx_t_1);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":60
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":60
* a: optional list of alignment points"""
* self.rule = new shared_ptr[grammar.TRule](new grammar.TRule())
* self.lhs = lhs # <<<<<<<<<<<<<<
@@ -5992,7 +5992,7 @@ static int __pyx_pf_5_cdec_5TRule___init__(struct __pyx_obj_5_cdec_TRule *__pyx_
*/
if (PyObject_SetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__lhs, __pyx_v_lhs) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":61
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":61
* self.rule = new shared_ptr[grammar.TRule](new grammar.TRule())
* self.lhs = lhs
* self.e = e # <<<<<<<<<<<<<<
@@ -6001,7 +6001,7 @@ static int __pyx_pf_5_cdec_5TRule___init__(struct __pyx_obj_5_cdec_TRule *__pyx_
*/
if (PyObject_SetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__e, __pyx_v_e) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":62
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":62
* self.lhs = lhs
* self.e = e
* self.f = f # <<<<<<<<<<<<<<
@@ -6010,7 +6010,7 @@ static int __pyx_pf_5_cdec_5TRule___init__(struct __pyx_obj_5_cdec_TRule *__pyx_
*/
if (PyObject_SetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__f, __pyx_v_f) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":63
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":63
* self.e = e
* self.f = f
* self.scores = scores # <<<<<<<<<<<<<<
@@ -6019,7 +6019,7 @@ static int __pyx_pf_5_cdec_5TRule___init__(struct __pyx_obj_5_cdec_TRule *__pyx_
*/
if (PyObject_SetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__scores, __pyx_v_scores) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":64
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":64
* self.f = f
* self.scores = scores
* if a: # <<<<<<<<<<<<<<
@@ -6029,7 +6029,7 @@ static int __pyx_pf_5_cdec_5TRule___init__(struct __pyx_obj_5_cdec_TRule *__pyx_
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_a); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":65
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":65
* self.scores = scores
* if a:
* self.a = a # <<<<<<<<<<<<<<
@@ -6041,7 +6041,7 @@ static int __pyx_pf_5_cdec_5TRule___init__(struct __pyx_obj_5_cdec_TRule *__pyx_
}
__pyx_L3:;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":66
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":66
* if a:
* self.a = a
* self.rule.get().ComputeArity() # <<<<<<<<<<<<<<
@@ -6069,7 +6069,7 @@ static void __pyx_pw_5_cdec_5TRule_3__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyFinishContext();
}
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":68
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":68
* self.rule.get().ComputeArity()
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -6081,7 +6081,7 @@ static void __pyx_pf_5_cdec_5TRule_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_5
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":69
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":69
*
* def __dealloc__(self):
* del self.rule # <<<<<<<<<<<<<<
@@ -6104,7 +6104,7 @@ static PyObject *__pyx_pw_5_cdec_5TRule_5arity_1__get__(PyObject *__pyx_v_self)
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":72
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":72
*
* property arity:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -6121,7 +6121,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_5arity___get__(struct __pyx_obj_5_cdec_T
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":73
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":73
* property arity:
* def __get__(self):
* return self.rule.get().arity_ # <<<<<<<<<<<<<<
@@ -6158,7 +6158,7 @@ static PyObject *__pyx_pw_5_cdec_5TRule_1f_1__get__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":76
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":76
*
* property f:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -6185,7 +6185,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1f___get__(struct __pyx_obj_5_cdec_TRule
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":77
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":77
* property f:
* def __get__(self):
* cdef vector[WordID]* f_ = &self.rule.get().f_ # <<<<<<<<<<<<<<
@@ -6194,7 +6194,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1f___get__(struct __pyx_obj_5_cdec_TRule
*/
__pyx_v_f_ = (&__pyx_v_self->rule->get()->f_);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":79
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":79
* cdef vector[WordID]* f_ = &self.rule.get().f_
* cdef WordID w
* cdef f = [] # <<<<<<<<<<<<<<
@@ -6206,7 +6206,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1f___get__(struct __pyx_obj_5_cdec_TRule
__pyx_v_f = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":81
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":81
* cdef f = []
* cdef unsigned i
* cdef int idx = 0 # <<<<<<<<<<<<<<
@@ -6215,7 +6215,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1f___get__(struct __pyx_obj_5_cdec_TRule
*/
__pyx_v_idx = 0;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":82
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":82
* cdef unsigned i
* cdef int idx = 0
* for i in range(f_.size()): # <<<<<<<<<<<<<<
@@ -6226,7 +6226,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1f___get__(struct __pyx_obj_5_cdec_TRule
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":83
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":83
* cdef int idx = 0
* for i in range(f_.size()):
* w = f_[0][i] # <<<<<<<<<<<<<<
@@ -6235,7 +6235,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1f___get__(struct __pyx_obj_5_cdec_TRule
*/
__pyx_v_w = ((__pyx_v_f_[0])[__pyx_v_i]);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":84
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":84
* for i in range(f_.size()):
* w = f_[0][i]
* if w < 0: # <<<<<<<<<<<<<<
@@ -6245,7 +6245,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1f___get__(struct __pyx_obj_5_cdec_TRule
__pyx_t_4 = (__pyx_v_w < 0);
if (__pyx_t_4) {
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":85
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":85
* w = f_[0][i]
* if w < 0:
* idx += 1 # <<<<<<<<<<<<<<
@@ -6254,7 +6254,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1f___get__(struct __pyx_obj_5_cdec_TRule
*/
__pyx_v_idx = (__pyx_v_idx + 1);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":86
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":86
* if w < 0:
* idx += 1
* f.append(NT(TDConvert(-w).c_str(), idx)) # <<<<<<<<<<<<<<
@@ -6284,7 +6284,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1f___get__(struct __pyx_obj_5_cdec_TRule
}
/*else*/ {
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":88
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":88
* f.append(NT(TDConvert(-w).c_str(), idx))
* else:
* f.append(unicode(TDConvert(w).c_str(), encoding='utf8')) # <<<<<<<<<<<<<<
@@ -6313,7 +6313,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1f___get__(struct __pyx_obj_5_cdec_TRule
__pyx_L5:;
}
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":89
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":89
* else:
* f.append(unicode(TDConvert(w).c_str(), encoding='utf8'))
* return f # <<<<<<<<<<<<<<
@@ -6351,7 +6351,7 @@ static int __pyx_pw_5_cdec_5TRule_1f_3__set__(PyObject *__pyx_v_self, PyObject *
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":91
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":91
* return f
*
* def __set__(self, f): # <<<<<<<<<<<<<<
@@ -6377,7 +6377,7 @@ static int __pyx_pf_5_cdec_5TRule_1f_2__set__(struct __pyx_obj_5_cdec_TRule *__p
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":92
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":92
*
* def __set__(self, f):
* cdef vector[WordID]* f_ = &self.rule.get().f_ # <<<<<<<<<<<<<<
@@ -6386,7 +6386,7 @@ static int __pyx_pf_5_cdec_5TRule_1f_2__set__(struct __pyx_obj_5_cdec_TRule *__p
*/
__pyx_v_f_ = (&__pyx_v_self->rule->get()->f_);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":93
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":93
* def __set__(self, f):
* cdef vector[WordID]* f_ = &self.rule.get().f_
* f_.resize(len(f)) # <<<<<<<<<<<<<<
@@ -6396,7 +6396,7 @@ static int __pyx_pf_5_cdec_5TRule_1f_2__set__(struct __pyx_obj_5_cdec_TRule *__p
__pyx_t_1 = PyObject_Length(__pyx_v_f); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_f_->resize(__pyx_t_1);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":95
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":95
* f_.resize(len(f))
* cdef unsigned i
* cdef int idx = 0 # <<<<<<<<<<<<<<
@@ -6405,7 +6405,7 @@ static int __pyx_pf_5_cdec_5TRule_1f_2__set__(struct __pyx_obj_5_cdec_TRule *__p
*/
__pyx_v_idx = 0;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":96
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":96
* cdef unsigned i
* cdef int idx = 0
* for i in range(len(f)): # <<<<<<<<<<<<<<
@@ -6416,7 +6416,7 @@ static int __pyx_pf_5_cdec_5TRule_1f_2__set__(struct __pyx_obj_5_cdec_TRule *__p
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":97
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":97
* cdef int idx = 0
* for i in range(len(f)):
* if isinstance(f[i], NT): # <<<<<<<<<<<<<<
@@ -6432,7 +6432,7 @@ static int __pyx_pf_5_cdec_5TRule_1f_2__set__(struct __pyx_obj_5_cdec_TRule *__p
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_5) {
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":98
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":98
* for i in range(len(f)):
* if isinstance(f[i], NT):
* f_[0][i] = -TDConvert((<NT> f[i]).cat) # <<<<<<<<<<<<<<
@@ -6448,7 +6448,7 @@ static int __pyx_pf_5_cdec_5TRule_1f_2__set__(struct __pyx_obj_5_cdec_TRule *__p
}
/*else*/ {
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":100
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":100
* f_[0][i] = -TDConvert((<NT> f[i]).cat)
* else:
* fi = as_str(f[i]) # <<<<<<<<<<<<<<
@@ -6464,7 +6464,7 @@ static int __pyx_pf_5_cdec_5TRule_1f_2__set__(struct __pyx_obj_5_cdec_TRule *__p
__pyx_v_fi = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":101
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":101
* else:
* fi = as_str(f[i])
* f_[0][i] = TDConvert(fi) # <<<<<<<<<<<<<<
@@ -6501,7 +6501,7 @@ static PyObject *__pyx_pw_5_cdec_5TRule_1e_1__get__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":104
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":104
*
* property e:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -6528,7 +6528,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1e___get__(struct __pyx_obj_5_cdec_TRule
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":105
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":105
* property e:
* def __get__(self):
* cdef vector[WordID]* e_ = &self.rule.get().e_ # <<<<<<<<<<<<<<
@@ -6537,7 +6537,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1e___get__(struct __pyx_obj_5_cdec_TRule
*/
__pyx_v_e_ = (&__pyx_v_self->rule->get()->e_);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":107
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":107
* cdef vector[WordID]* e_ = &self.rule.get().e_
* cdef WordID w
* cdef e = [] # <<<<<<<<<<<<<<
@@ -6549,7 +6549,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1e___get__(struct __pyx_obj_5_cdec_TRule
__pyx_v_e = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":109
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":109
* cdef e = []
* cdef unsigned i
* cdef int idx = 0 # <<<<<<<<<<<<<<
@@ -6558,7 +6558,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1e___get__(struct __pyx_obj_5_cdec_TRule
*/
__pyx_v_idx = 0;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":110
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":110
* cdef unsigned i
* cdef int idx = 0
* for i in range(e_.size()): # <<<<<<<<<<<<<<
@@ -6569,7 +6569,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1e___get__(struct __pyx_obj_5_cdec_TRule
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":111
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":111
* cdef int idx = 0
* for i in range(e_.size()):
* w = e_[0][i] # <<<<<<<<<<<<<<
@@ -6578,7 +6578,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1e___get__(struct __pyx_obj_5_cdec_TRule
*/
__pyx_v_w = ((__pyx_v_e_[0])[__pyx_v_i]);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":112
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":112
* for i in range(e_.size()):
* w = e_[0][i]
* if w < 1: # <<<<<<<<<<<<<<
@@ -6588,7 +6588,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1e___get__(struct __pyx_obj_5_cdec_TRule
__pyx_t_4 = (__pyx_v_w < 1);
if (__pyx_t_4) {
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":113
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":113
* w = e_[0][i]
* if w < 1:
* idx += 1 # <<<<<<<<<<<<<<
@@ -6597,7 +6597,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1e___get__(struct __pyx_obj_5_cdec_TRule
*/
__pyx_v_idx = (__pyx_v_idx + 1);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":114
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":114
* if w < 1:
* idx += 1
* e.append(NTRef(1-w)) # <<<<<<<<<<<<<<
@@ -6622,7 +6622,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1e___get__(struct __pyx_obj_5_cdec_TRule
}
/*else*/ {
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":116
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":116
* e.append(NTRef(1-w))
* else:
* e.append(unicode(TDConvert(w).c_str(), encoding='utf8')) # <<<<<<<<<<<<<<
@@ -6651,7 +6651,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_1e___get__(struct __pyx_obj_5_cdec_TRule
__pyx_L5:;
}
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":117
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":117
* else:
* e.append(unicode(TDConvert(w).c_str(), encoding='utf8'))
* return e # <<<<<<<<<<<<<<
@@ -6689,7 +6689,7 @@ static int __pyx_pw_5_cdec_5TRule_1e_3__set__(PyObject *__pyx_v_self, PyObject *
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":119
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":119
* return e
*
* def __set__(self, e): # <<<<<<<<<<<<<<
@@ -6715,7 +6715,7 @@ static int __pyx_pf_5_cdec_5TRule_1e_2__set__(struct __pyx_obj_5_cdec_TRule *__p
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":120
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":120
*
* def __set__(self, e):
* cdef vector[WordID]* e_ = &self.rule.get().e_ # <<<<<<<<<<<<<<
@@ -6724,7 +6724,7 @@ static int __pyx_pf_5_cdec_5TRule_1e_2__set__(struct __pyx_obj_5_cdec_TRule *__p
*/
__pyx_v_e_ = (&__pyx_v_self->rule->get()->e_);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":121
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":121
* def __set__(self, e):
* cdef vector[WordID]* e_ = &self.rule.get().e_
* e_.resize(len(e)) # <<<<<<<<<<<<<<
@@ -6734,7 +6734,7 @@ static int __pyx_pf_5_cdec_5TRule_1e_2__set__(struct __pyx_obj_5_cdec_TRule *__p
__pyx_t_1 = PyObject_Length(__pyx_v_e); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_e_->resize(__pyx_t_1);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":123
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":123
* e_.resize(len(e))
* cdef unsigned i
* for i in range(len(e)): # <<<<<<<<<<<<<<
@@ -6745,7 +6745,7 @@ static int __pyx_pf_5_cdec_5TRule_1e_2__set__(struct __pyx_obj_5_cdec_TRule *__p
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":124
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":124
* cdef unsigned i
* for i in range(len(e)):
* if isinstance(e[i], NTRef): # <<<<<<<<<<<<<<
@@ -6761,7 +6761,7 @@ static int __pyx_pf_5_cdec_5TRule_1e_2__set__(struct __pyx_obj_5_cdec_TRule *__p
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_5) {
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":125
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":125
* for i in range(len(e)):
* if isinstance(e[i], NTRef):
* e_[0][i] = 1-e[i].ref # <<<<<<<<<<<<<<
@@ -6783,7 +6783,7 @@ static int __pyx_pf_5_cdec_5TRule_1e_2__set__(struct __pyx_obj_5_cdec_TRule *__p
}
/*else*/ {
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":127
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":127
* e_[0][i] = 1-e[i].ref
* else:
* ei = as_str(e[i]) # <<<<<<<<<<<<<<
@@ -6799,7 +6799,7 @@ static int __pyx_pf_5_cdec_5TRule_1e_2__set__(struct __pyx_obj_5_cdec_TRule *__p
__pyx_v_ei = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":128
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":128
* else:
* ei = as_str(e[i])
* e_[0][i] = TDConvert(ei) # <<<<<<<<<<<<<<
@@ -6837,7 +6837,7 @@ static PyObject *__pyx_pw_5_cdec_5TRule_1a_1__get__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":131
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":131
*
* property a:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -6902,7 +6902,7 @@ static PyObject *__pyx_gb_5_cdec_5TRule_1a_2generator2(__pyx_GeneratorObject *__
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":133
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":133
* def __get__(self):
* cdef unsigned i
* cdef vector[grammar.AlignmentPoint]* a = &self.rule.get().a_ # <<<<<<<<<<<<<<
@@ -6911,7 +6911,7 @@ static PyObject *__pyx_gb_5_cdec_5TRule_1a_2generator2(__pyx_GeneratorObject *__
*/
__pyx_cur_scope->__pyx_v_a = (&__pyx_cur_scope->__pyx_v_self->rule->get()->a_);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":134
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":134
* cdef unsigned i
* cdef vector[grammar.AlignmentPoint]* a = &self.rule.get().a_
* for i in range(a.size()): # <<<<<<<<<<<<<<
@@ -6922,7 +6922,7 @@ static PyObject *__pyx_gb_5_cdec_5TRule_1a_2generator2(__pyx_GeneratorObject *__
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_2;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":135
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":135
* cdef vector[grammar.AlignmentPoint]* a = &self.rule.get().a_
* for i in range(a.size()):
* yield (a[0][i].s_, a[0][i].t_) # <<<<<<<<<<<<<<
@@ -6981,7 +6981,7 @@ static int __pyx_pw_5_cdec_5TRule_1a_4__set__(PyObject *__pyx_v_self, PyObject *
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":137
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":137
* yield (a[0][i].s_, a[0][i].t_)
*
* def __set__(self, a): # <<<<<<<<<<<<<<
@@ -7010,7 +7010,7 @@ static int __pyx_pf_5_cdec_5TRule_1a_3__set__(struct __pyx_obj_5_cdec_TRule *__p
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":138
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":138
*
* def __set__(self, a):
* cdef vector[grammar.AlignmentPoint]* a_ = &self.rule.get().a_ # <<<<<<<<<<<<<<
@@ -7019,7 +7019,7 @@ static int __pyx_pf_5_cdec_5TRule_1a_3__set__(struct __pyx_obj_5_cdec_TRule *__p
*/
__pyx_v_a_ = (&__pyx_v_self->rule->get()->a_);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":139
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":139
* def __set__(self, a):
* cdef vector[grammar.AlignmentPoint]* a_ = &self.rule.get().a_
* a_.resize(len(a)) # <<<<<<<<<<<<<<
@@ -7029,7 +7029,7 @@ static int __pyx_pf_5_cdec_5TRule_1a_3__set__(struct __pyx_obj_5_cdec_TRule *__p
__pyx_t_1 = PyObject_Length(__pyx_v_a); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_a_->resize(__pyx_t_1);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":142
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":142
* cdef unsigned i
* cdef int s, t
* for i in range(len(a)): # <<<<<<<<<<<<<<
@@ -7040,7 +7040,7 @@ static int __pyx_pf_5_cdec_5TRule_1a_3__set__(struct __pyx_obj_5_cdec_TRule *__p
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":143
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":143
* cdef int s, t
* for i in range(len(a)):
* s, t = a[i] # <<<<<<<<<<<<<<
@@ -7105,7 +7105,7 @@ static int __pyx_pf_5_cdec_5TRule_1a_3__set__(struct __pyx_obj_5_cdec_TRule *__p
__pyx_v_s = __pyx_t_8;
__pyx_v_t = __pyx_t_9;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":144
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":144
* for i in range(len(a)):
* s, t = a[i]
* a_[0][i] = grammar.AlignmentPoint(s, t) # <<<<<<<<<<<<<<
@@ -7140,7 +7140,7 @@ static PyObject *__pyx_pw_5_cdec_5TRule_6scores_1__get__(PyObject *__pyx_v_self)
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":147
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":147
*
* property scores:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -7158,7 +7158,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_6scores___get__(struct __pyx_obj_5_cdec_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":148
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":148
* property scores:
* def __get__(self):
* cdef SparseVector scores = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<<
@@ -7171,7 +7171,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_6scores___get__(struct __pyx_obj_5_cdec_
__pyx_v_scores = ((struct __pyx_obj_5_cdec_SparseVector *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":149
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":149
* def __get__(self):
* cdef SparseVector scores = SparseVector.__new__(SparseVector)
* scores.vector = new FastSparseVector[double](self.rule.get().scores_) # <<<<<<<<<<<<<<
@@ -7180,7 +7180,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_6scores___get__(struct __pyx_obj_5_cdec_
*/
__pyx_v_scores->vector = new FastSparseVector<double>(__pyx_v_self->rule->get()->scores_);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":150
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":150
* cdef SparseVector scores = SparseVector.__new__(SparseVector)
* scores.vector = new FastSparseVector[double](self.rule.get().scores_)
* return scores # <<<<<<<<<<<<<<
@@ -7216,7 +7216,7 @@ static int __pyx_pw_5_cdec_5TRule_6scores_3__set__(PyObject *__pyx_v_self, PyObj
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":152
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":152
* return scores
*
* def __set__(self, scores): # <<<<<<<<<<<<<<
@@ -7248,7 +7248,7 @@ static int __pyx_pf_5_cdec_5TRule_6scores_2__set__(struct __pyx_obj_5_cdec_TRule
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":153
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":153
*
* def __set__(self, scores):
* cdef FastSparseVector[double]* scores_ = &self.rule.get().scores_ # <<<<<<<<<<<<<<
@@ -7257,7 +7257,7 @@ static int __pyx_pf_5_cdec_5TRule_6scores_2__set__(struct __pyx_obj_5_cdec_TRule
*/
__pyx_v_scores_ = (&__pyx_v_self->rule->get()->scores_);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":154
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":154
* def __set__(self, scores):
* cdef FastSparseVector[double]* scores_ = &self.rule.get().scores_
* scores_.clear() # <<<<<<<<<<<<<<
@@ -7266,7 +7266,7 @@ static int __pyx_pf_5_cdec_5TRule_6scores_2__set__(struct __pyx_obj_5_cdec_TRule
*/
__pyx_v_scores_->clear();
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":157
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":157
* cdef int fid
* cdef float fval
* for fname, fval in scores.items(): # <<<<<<<<<<<<<<
@@ -7369,7 +7369,7 @@ static int __pyx_pf_5_cdec_5TRule_6scores_2__set__(struct __pyx_obj_5_cdec_TRule
__pyx_t_5 = 0;
__pyx_v_fval = __pyx_t_9;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":158
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":158
* cdef float fval
* for fname, fval in scores.items():
* fn = as_str(fname) # <<<<<<<<<<<<<<
@@ -7382,7 +7382,7 @@ static int __pyx_pf_5_cdec_5TRule_6scores_2__set__(struct __pyx_obj_5_cdec_TRule
__pyx_v_fn = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":159
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":159
* for fname, fval in scores.items():
* fn = as_str(fname)
* fid = FDConvert(fn) # <<<<<<<<<<<<<<
@@ -7392,7 +7392,7 @@ static int __pyx_pf_5_cdec_5TRule_6scores_2__set__(struct __pyx_obj_5_cdec_TRule
__pyx_t_10 = PyBytes_AsString(((PyObject *)__pyx_v_fn)); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_fid = FD::Convert(__pyx_t_10);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":160
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":160
* fn = as_str(fname)
* fid = FDConvert(fn)
* if fid < 0: raise KeyError(fname) # <<<<<<<<<<<<<<
@@ -7416,7 +7416,7 @@ static int __pyx_pf_5_cdec_5TRule_6scores_2__set__(struct __pyx_obj_5_cdec_TRule
}
__pyx_L7:;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":161
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":161
* fid = FDConvert(fn)
* if fid < 0: raise KeyError(fname)
* scores_.set_value(fid, fval) # <<<<<<<<<<<<<<
@@ -7455,7 +7455,7 @@ static PyObject *__pyx_pw_5_cdec_5TRule_3lhs_1__get__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":164
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":164
*
* property lhs:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -7473,7 +7473,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_3lhs___get__(struct __pyx_obj_5_cdec_TRu
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":165
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":165
* property lhs:
* def __get__(self):
* return NT(TDConvert(-self.rule.get().lhs_).c_str()) # <<<<<<<<<<<<<<
@@ -7519,7 +7519,7 @@ static int __pyx_pw_5_cdec_5TRule_3lhs_3__set__(PyObject *__pyx_v_self, PyObject
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":167
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":167
* return NT(TDConvert(-self.rule.get().lhs_).c_str())
*
* def __set__(self, lhs): # <<<<<<<<<<<<<<
@@ -7541,7 +7541,7 @@ static int __pyx_pf_5_cdec_5TRule_3lhs_2__set__(struct __pyx_obj_5_cdec_TRule *_
__Pyx_RefNannySetupContext("__set__", 0);
__Pyx_INCREF(__pyx_v_lhs);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":168
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":168
*
* def __set__(self, lhs):
* if not isinstance(lhs, NT): # <<<<<<<<<<<<<<
@@ -7555,7 +7555,7 @@ static int __pyx_pf_5_cdec_5TRule_3lhs_2__set__(struct __pyx_obj_5_cdec_TRule *_
__pyx_t_3 = (!__pyx_t_2);
if (__pyx_t_3) {
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":169
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":169
* def __set__(self, lhs):
* if not isinstance(lhs, NT):
* lhs = NT(lhs) # <<<<<<<<<<<<<<
@@ -7577,7 +7577,7 @@ static int __pyx_pf_5_cdec_5TRule_3lhs_2__set__(struct __pyx_obj_5_cdec_TRule *_
}
__pyx_L3:;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":170
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":170
* if not isinstance(lhs, NT):
* lhs = NT(lhs)
* self.rule.get().lhs_ = -TDConvert((<NT> lhs).cat) # <<<<<<<<<<<<<<
@@ -7612,7 +7612,7 @@ static PyObject *__pyx_pw_5_cdec_5TRule_5__str__(PyObject *__pyx_v_self) {
}
static PyObject *__pyx_gb_5_cdec_5TRule_7__str___2generator19(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":173
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":173
*
* def __str__(self):
* scores = ' '.join('%s=%s' % feat for feat in self.scores) # <<<<<<<<<<<<<<
@@ -7754,7 +7754,7 @@ static PyObject *__pyx_gb_5_cdec_5TRule_7__str___2generator19(__pyx_GeneratorObj
return NULL;
}
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":172
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":172
* self.rule.get().lhs_ = -TDConvert((<NT> lhs).cat)
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -7786,7 +7786,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_4__str__(struct __pyx_obj_5_cdec_TRule *
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":173
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":173
*
* def __str__(self):
* scores = ' '.join('%s=%s' % feat for feat in self.scores) # <<<<<<<<<<<<<<
@@ -7809,7 +7809,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_4__str__(struct __pyx_obj_5_cdec_TRule *
__pyx_v_scores = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":174
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":174
* def __str__(self):
* scores = ' '.join('%s=%s' % feat for feat in self.scores)
* return '%s ||| %s ||| %s ||| %s' % (self.lhs, # <<<<<<<<<<<<<<
@@ -7820,7 +7820,7 @@ static PyObject *__pyx_pf_5_cdec_5TRule_4__str__(struct __pyx_obj_5_cdec_TRule *
__pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__lhs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":175
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":175
* scores = ' '.join('%s=%s' % feat for feat in self.scores)
* return '%s ||| %s ||| %s ||| %s' % (self.lhs,
* _phrase(self.f), _phrase(self.e), scores) # <<<<<<<<<<<<<<
@@ -7961,7 +7961,7 @@ static int __pyx_pw_5_cdec_5MRule_1__init__(PyObject *__pyx_v_self, PyObject *__
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":178
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":178
*
* cdef class MRule(TRule):
* def __init__(self, lhs, rhs, scores): # <<<<<<<<<<<<<<
@@ -7987,7 +7987,7 @@ static int __pyx_pf_5_cdec_5MRule___init__(struct __pyx_obj_5_cdec_MRule *__pyx_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":183
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":183
* rhs: right hand side phrase (list of words/NT)
* scores: dictionary of feature scores"""
* cdef unsigned i = 1 # <<<<<<<<<<<<<<
@@ -7996,7 +7996,7 @@ static int __pyx_pf_5_cdec_5MRule___init__(struct __pyx_obj_5_cdec_MRule *__pyx_
*/
__pyx_v_i = 1;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":184
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":184
* scores: dictionary of feature scores"""
* cdef unsigned i = 1
* e = [] # <<<<<<<<<<<<<<
@@ -8008,7 +8008,7 @@ static int __pyx_pf_5_cdec_5MRule___init__(struct __pyx_obj_5_cdec_MRule *__pyx_
__pyx_v_e = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":185
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":185
* cdef unsigned i = 1
* e = []
* for s in rhs: # <<<<<<<<<<<<<<
@@ -8053,7 +8053,7 @@ static int __pyx_pf_5_cdec_5MRule___init__(struct __pyx_obj_5_cdec_MRule *__pyx_
__pyx_v_s = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":186
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":186
* e = []
* for s in rhs:
* if isinstance(s, NT): # <<<<<<<<<<<<<<
@@ -8066,7 +8066,7 @@ static int __pyx_pf_5_cdec_5MRule___init__(struct __pyx_obj_5_cdec_MRule *__pyx_
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_5) {
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":187
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":187
* for s in rhs:
* if isinstance(s, NT):
* e.append(NTRef(i)) # <<<<<<<<<<<<<<
@@ -8086,7 +8086,7 @@ static int __pyx_pf_5_cdec_5MRule___init__(struct __pyx_obj_5_cdec_MRule *__pyx_
__pyx_t_7 = PyList_Append(__pyx_v_e, __pyx_t_4); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":188
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":188
* if isinstance(s, NT):
* e.append(NTRef(i))
* i += 1 # <<<<<<<<<<<<<<
@@ -8098,7 +8098,7 @@ static int __pyx_pf_5_cdec_5MRule___init__(struct __pyx_obj_5_cdec_MRule *__pyx_
}
/*else*/ {
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":190
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":190
* i += 1
* else:
* e.append(s) # <<<<<<<<<<<<<<
@@ -8111,7 +8111,7 @@ static int __pyx_pf_5_cdec_5MRule___init__(struct __pyx_obj_5_cdec_MRule *__pyx_
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":191
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":191
* else:
* e.append(s)
* super(MRule, self).__init__(lhs, rhs, e, scores, None) # <<<<<<<<<<<<<<
@@ -8179,7 +8179,7 @@ static void __pyx_pw_5_cdec_7Grammar_1__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyFinishContext();
}
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":196
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":196
* cdef shared_ptr[grammar.Grammar]* grammar
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -8191,7 +8191,7 @@ static void __pyx_pf_5_cdec_7Grammar___dealloc__(CYTHON_UNUSED struct __pyx_obj_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":197
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":197
*
* def __dealloc__(self):
* del self.grammar # <<<<<<<<<<<<<<
@@ -8215,7 +8215,7 @@ static PyObject *__pyx_pw_5_cdec_7Grammar_3__iter__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":199
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":199
* del self.grammar
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -8278,7 +8278,7 @@ static PyObject *__pyx_gb_5_cdec_7Grammar_4generator3(__pyx_GeneratorObject *__p
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":200
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":200
*
* def __iter__(self):
* cdef grammar.const_GrammarIter* root = self.grammar.get().GetRoot() # <<<<<<<<<<<<<<
@@ -8287,7 +8287,7 @@ static PyObject *__pyx_gb_5_cdec_7Grammar_4generator3(__pyx_GeneratorObject *__p
*/
__pyx_cur_scope->__pyx_v_root = __pyx_cur_scope->__pyx_v_self->grammar->get()->GetRoot();
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":201
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":201
* def __iter__(self):
* cdef grammar.const_GrammarIter* root = self.grammar.get().GetRoot()
* cdef grammar.const_RuleBin* rbin = root.GetRules() # <<<<<<<<<<<<<<
@@ -8296,7 +8296,7 @@ static PyObject *__pyx_gb_5_cdec_7Grammar_4generator3(__pyx_GeneratorObject *__p
*/
__pyx_cur_scope->__pyx_v_rbin = __pyx_cur_scope->__pyx_v_root->GetRules();
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":204
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":204
* cdef TRule trule
* cdef unsigned i
* for i in range(rbin.GetNumRules()): # <<<<<<<<<<<<<<
@@ -8307,7 +8307,7 @@ static PyObject *__pyx_gb_5_cdec_7Grammar_4generator3(__pyx_GeneratorObject *__p
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_2;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":205
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":205
* cdef unsigned i
* for i in range(rbin.GetNumRules()):
* trule = TRule.__new__(TRule) # <<<<<<<<<<<<<<
@@ -8323,7 +8323,7 @@ static PyObject *__pyx_gb_5_cdec_7Grammar_4generator3(__pyx_GeneratorObject *__p
__pyx_cur_scope->__pyx_v_trule = ((struct __pyx_obj_5_cdec_TRule *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":206
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":206
* for i in range(rbin.GetNumRules()):
* trule = TRule.__new__(TRule)
* trule.rule = new shared_ptr[grammar.TRule](rbin.GetIthRule(i)) # <<<<<<<<<<<<<<
@@ -8332,7 +8332,7 @@ static PyObject *__pyx_gb_5_cdec_7Grammar_4generator3(__pyx_GeneratorObject *__p
*/
__pyx_cur_scope->__pyx_v_trule->rule = new boost::shared_ptr<TRule>(__pyx_cur_scope->__pyx_v_rbin->GetIthRule(__pyx_cur_scope->__pyx_v_i));
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":207
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":207
* trule = TRule.__new__(TRule)
* trule.rule = new shared_ptr[grammar.TRule](rbin.GetIthRule(i))
* yield trule # <<<<<<<<<<<<<<
@@ -8377,7 +8377,7 @@ static PyObject *__pyx_pw_5_cdec_7Grammar_4name_1__get__(PyObject *__pyx_v_self)
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":210
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":210
*
* property name:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -8395,7 +8395,7 @@ static PyObject *__pyx_pf_5_cdec_7Grammar_4name___get__(struct __pyx_obj_5_cdec_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":211
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":211
* property name:
* def __get__(self):
* str(self.grammar.get().GetGrammarName().c_str()) # <<<<<<<<<<<<<<
@@ -8438,7 +8438,7 @@ static int __pyx_pw_5_cdec_7Grammar_4name_3__set__(PyObject *__pyx_v_self, PyObj
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":213
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":213
* str(self.grammar.get().GetGrammarName().c_str())
*
* def __set__(self, name): # <<<<<<<<<<<<<<
@@ -8457,7 +8457,7 @@ static int __pyx_pf_5_cdec_7Grammar_4name_2__set__(struct __pyx_obj_5_cdec_Gramm
__Pyx_RefNannySetupContext("__set__", 0);
__Pyx_INCREF(__pyx_v_name);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":214
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":214
*
* def __set__(self, name):
* name = as_str(name) # <<<<<<<<<<<<<<
@@ -8470,7 +8470,7 @@ static int __pyx_pf_5_cdec_7Grammar_4name_2__set__(struct __pyx_obj_5_cdec_Gramm
__pyx_v_name = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":215
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":215
* def __set__(self, name):
* name = as_str(name)
* self.grammar.get().SetGrammarName(name) # <<<<<<<<<<<<<<
@@ -8543,7 +8543,7 @@ static int __pyx_pw_5_cdec_11TextGrammar_1__init__(PyObject *__pyx_v_self, PyObj
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/grammar.pxi":218
+/* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":218
*
* cdef class TextGrammar(Grammar):
* def __init__(self, rules): # <<<<<<<<<<<<<<
@@ -8568,7 +8568,7 @@ static int __pyx_pf_5_cdec_11TextGrammar___init__(struct __pyx_obj_5_cdec_TextGr
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":220
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":220
* def __init__(self, rules):
* """TextGrammar(rules) -> SCFG Grammar containing the rules."""
* self.grammar = new shared_ptr[grammar.Grammar](new grammar.TextGrammar()) # <<<<<<<<<<<<<<
@@ -8577,7 +8577,7 @@ static int __pyx_pf_5_cdec_11TextGrammar___init__(struct __pyx_obj_5_cdec_TextGr
*/
__pyx_v_self->__pyx_base.grammar = new boost::shared_ptr<Grammar>(new TextGrammar());
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":221
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":221
* """TextGrammar(rules) -> SCFG Grammar containing the rules."""
* self.grammar = new shared_ptr[grammar.Grammar](new grammar.TextGrammar())
* cdef grammar.TextGrammar* _g = <grammar.TextGrammar*> self.grammar.get() # <<<<<<<<<<<<<<
@@ -8586,7 +8586,7 @@ static int __pyx_pf_5_cdec_11TextGrammar___init__(struct __pyx_obj_5_cdec_TextGr
*/
__pyx_v__g = ((TextGrammar *)__pyx_v_self->__pyx_base.grammar->get());
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":222
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":222
* self.grammar = new shared_ptr[grammar.Grammar](new grammar.TextGrammar())
* cdef grammar.TextGrammar* _g = <grammar.TextGrammar*> self.grammar.get()
* for trule in rules: # <<<<<<<<<<<<<<
@@ -8631,7 +8631,7 @@ static int __pyx_pf_5_cdec_11TextGrammar___init__(struct __pyx_obj_5_cdec_TextGr
__pyx_v_trule = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":223
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":223
* cdef grammar.TextGrammar* _g = <grammar.TextGrammar*> self.grammar.get()
* for trule in rules:
* if isinstance(trule, _sa.Rule): # <<<<<<<<<<<<<<
@@ -8644,7 +8644,7 @@ static int __pyx_pf_5_cdec_11TextGrammar___init__(struct __pyx_obj_5_cdec_TextGr
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_5) {
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":224
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":224
* for trule in rules:
* if isinstance(trule, _sa.Rule):
* trule = convert_rule(trule) # <<<<<<<<<<<<<<
@@ -8663,7 +8663,7 @@ static int __pyx_pf_5_cdec_11TextGrammar___init__(struct __pyx_obj_5_cdec_TextGr
goto __pyx_L5;
}
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":225
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":225
* if isinstance(trule, _sa.Rule):
* trule = convert_rule(trule)
* elif not isinstance(trule, TRule): # <<<<<<<<<<<<<<
@@ -8677,7 +8677,7 @@ static int __pyx_pf_5_cdec_11TextGrammar___init__(struct __pyx_obj_5_cdec_TextGr
__pyx_t_7 = (!__pyx_t_5);
if (__pyx_t_7) {
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":226
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":226
* trule = convert_rule(trule)
* elif not isinstance(trule, TRule):
* raise ValueError('the grammar should contain TRule objects') # <<<<<<<<<<<<<<
@@ -8692,7 +8692,7 @@ static int __pyx_pf_5_cdec_11TextGrammar___init__(struct __pyx_obj_5_cdec_TextGr
}
__pyx_L5:;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":227
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":227
* elif not isinstance(trule, TRule):
* raise ValueError('the grammar should contain TRule objects')
* _g.AddRule((<TRule> trule).rule[0]) # <<<<<<<<<<<<<<
@@ -8724,7 +8724,7 @@ static void __pyx_pw_5_cdec_10Hypergraph_1__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyFinishContext();
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":8
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":8
* cdef MT19937* rng
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -8737,7 +8737,7 @@ static void __pyx_pf_5_cdec_10Hypergraph___dealloc__(struct __pyx_obj_5_cdec_Hyp
int __pyx_t_1;
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":9
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":9
*
* def __dealloc__(self):
* del self.hg # <<<<<<<<<<<<<<
@@ -8746,7 +8746,7 @@ static void __pyx_pf_5_cdec_10Hypergraph___dealloc__(struct __pyx_obj_5_cdec_Hyp
*/
delete __pyx_v_self->hg;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":10
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":10
* def __dealloc__(self):
* del self.hg
* if self.rng != NULL: # <<<<<<<<<<<<<<
@@ -8756,7 +8756,7 @@ static void __pyx_pf_5_cdec_10Hypergraph___dealloc__(struct __pyx_obj_5_cdec_Hyp
__pyx_t_1 = (__pyx_v_self->rng != NULL);
if (__pyx_t_1) {
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":11
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":11
* del self.hg
* if self.rng != NULL:
* del self.rng # <<<<<<<<<<<<<<
@@ -8771,7 +8771,7 @@ static void __pyx_pf_5_cdec_10Hypergraph___dealloc__(struct __pyx_obj_5_cdec_Hyp
__Pyx_RefNannyFinishContext();
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":13
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":13
* del self.rng
*
* cdef MT19937* _rng(self): # <<<<<<<<<<<<<<
@@ -8789,7 +8789,7 @@ static MT19937 *__pyx_f_5_cdec_10Hypergraph__rng(struct __pyx_obj_5_cdec_Hypergr
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_rng", 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":14
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":14
*
* cdef MT19937* _rng(self):
* if self.rng == NULL: # <<<<<<<<<<<<<<
@@ -8799,7 +8799,7 @@ static MT19937 *__pyx_f_5_cdec_10Hypergraph__rng(struct __pyx_obj_5_cdec_Hypergr
__pyx_t_1 = (__pyx_v_self->rng == NULL);
if (__pyx_t_1) {
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":15
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":15
* cdef MT19937* _rng(self):
* if self.rng == NULL:
* self.rng = new MT19937() # <<<<<<<<<<<<<<
@@ -8812,7 +8812,7 @@ static MT19937 *__pyx_f_5_cdec_10Hypergraph__rng(struct __pyx_obj_5_cdec_Hypergr
}
__pyx_L3:;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":16
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":16
* if self.rng == NULL:
* self.rng = new MT19937()
* return self.rng # <<<<<<<<<<<<<<
@@ -8844,7 +8844,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_3viterbi(PyObject *__pyx_v_self, C
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":18
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":18
* return self.rng
*
* def viterbi(self): # <<<<<<<<<<<<<<
@@ -8863,7 +8863,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_2viterbi(struct __pyx_obj_5_cdec_H
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("viterbi", 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":21
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":21
* """hg.viterbi() -> String for the best hypothesis in the hypergraph."""
* cdef vector[WordID] trans
* hypergraph.ViterbiESentence(self.hg[0], &trans) # <<<<<<<<<<<<<<
@@ -8872,7 +8872,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_2viterbi(struct __pyx_obj_5_cdec_H
*/
ViterbiESentence((__pyx_v_self->hg[0]), (&__pyx_v_trans));
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":22
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":22
* cdef vector[WordID] trans
* hypergraph.ViterbiESentence(self.hg[0], &trans)
* return unicode(GetString(trans).c_str(), 'utf8') # <<<<<<<<<<<<<<
@@ -8922,7 +8922,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_5viterbi_trees(PyObject *__pyx_v_s
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":24
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":24
* return unicode(GetString(trans).c_str(), 'utf8')
*
* def viterbi_trees(self): # <<<<<<<<<<<<<<
@@ -8942,7 +8942,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_4viterbi_trees(struct __pyx_obj_5_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("viterbi_trees", 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":29
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":29
* e_tree: Target tree for the best hypothesis in the hypergraph.
* """
* f_tree = unicode(hypergraph.ViterbiFTree(self.hg[0]).c_str(), 'utf8') # <<<<<<<<<<<<<<
@@ -8965,7 +8965,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_4viterbi_trees(struct __pyx_obj_5_
__pyx_v_f_tree = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":30
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":30
* """
* f_tree = unicode(hypergraph.ViterbiFTree(self.hg[0]).c_str(), 'utf8')
* e_tree = unicode(hypergraph.ViterbiETree(self.hg[0]).c_str(), 'utf8') # <<<<<<<<<<<<<<
@@ -8988,7 +8988,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_4viterbi_trees(struct __pyx_obj_5_
__pyx_v_e_tree = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":31
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":31
* f_tree = unicode(hypergraph.ViterbiFTree(self.hg[0]).c_str(), 'utf8')
* e_tree = unicode(hypergraph.ViterbiETree(self.hg[0]).c_str(), 'utf8')
* return (f_tree, e_tree) # <<<<<<<<<<<<<<
@@ -9035,7 +9035,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_7viterbi_features(PyObject *__pyx_
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":33
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":33
* return (f_tree, e_tree)
*
* def viterbi_features(self): # <<<<<<<<<<<<<<
@@ -9053,7 +9053,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_6viterbi_features(struct __pyx_obj
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("viterbi_features", 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":36
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":36
* """hg.viterbi_features() -> SparseVector with the features corresponding
* to the best derivation in the hypergraph."""
* cdef SparseVector fmap = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<<
@@ -9066,7 +9066,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_6viterbi_features(struct __pyx_obj
__pyx_v_fmap = ((struct __pyx_obj_5_cdec_SparseVector *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":37
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":37
* to the best derivation in the hypergraph."""
* cdef SparseVector fmap = SparseVector.__new__(SparseVector)
* fmap.vector = new FastSparseVector[weight_t](hypergraph.ViterbiFeatures(self.hg[0])) # <<<<<<<<<<<<<<
@@ -9075,7 +9075,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_6viterbi_features(struct __pyx_obj
*/
__pyx_v_fmap->vector = new FastSparseVector<weight_t>(ViterbiFeatures((__pyx_v_self->hg[0])));
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":38
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":38
* cdef SparseVector fmap = SparseVector.__new__(SparseVector)
* fmap.vector = new FastSparseVector[weight_t](hypergraph.ViterbiFeatures(self.hg[0]))
* return fmap # <<<<<<<<<<<<<<
@@ -9111,7 +9111,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_9viterbi_forest(PyObject *__pyx_v_
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":40
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":40
* return fmap
*
* def viterbi_forest(self): # <<<<<<<<<<<<<<
@@ -9129,7 +9129,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_8viterbi_forest(struct __pyx_obj_5
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("viterbi_forest", 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":41
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":41
*
* def viterbi_forest(self):
* cdef Hypergraph hg = Hypergraph() # <<<<<<<<<<<<<<
@@ -9141,7 +9141,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_8viterbi_forest(struct __pyx_obj_5
__pyx_v_hg = ((struct __pyx_obj_5_cdec_Hypergraph *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":42
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":42
* def viterbi_forest(self):
* cdef Hypergraph hg = Hypergraph()
* hg.hg = new hypergraph.Hypergraph(self.hg[0].CreateViterbiHypergraph(NULL).get()[0]) # <<<<<<<<<<<<<<
@@ -9150,7 +9150,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_8viterbi_forest(struct __pyx_obj_5
*/
__pyx_v_hg->hg = new Hypergraph(((__pyx_v_self->hg[0]).CreateViterbiHypergraph(NULL).get()[0]));
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":43
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":43
* cdef Hypergraph hg = Hypergraph()
* hg.hg = new hypergraph.Hypergraph(self.hg[0].CreateViterbiHypergraph(NULL).get()[0])
* return hg # <<<<<<<<<<<<<<
@@ -9187,7 +9187,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_11viterbi_joshua(PyObject *__pyx_v
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":45
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":45
* return hg
*
* def viterbi_joshua(self): # <<<<<<<<<<<<<<
@@ -9205,7 +9205,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_10viterbi_joshua(struct __pyx_obj_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("viterbi_joshua", 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":47
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":47
* def viterbi_joshua(self):
* """hg.viterbi_joshua() -> Joshua representation of the best derivation."""
* return unicode(hypergraph.JoshuaVisualizationString(self.hg[0]).c_str(), 'utf8') # <<<<<<<<<<<<<<
@@ -9256,7 +9256,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_13kbest(PyObject *__pyx_v_self, Py
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":49
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":49
* return unicode(hypergraph.JoshuaVisualizationString(self.hg[0]).c_str(), 'utf8')
*
* def kbest(self, size): # <<<<<<<<<<<<<<
@@ -9324,7 +9324,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_14generator4(__pyx_GeneratorObject
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":51
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":51
* def kbest(self, size):
* """hg.kbest(size) -> List of k-best hypotheses in the hypergraph."""
* cdef kbest.KBestDerivations[vector[WordID], kbest.ESentenceTraversal]* derivations = new kbest.KBestDerivations[vector[WordID], kbest.ESentenceTraversal](self.hg[0], size) # <<<<<<<<<<<<<<
@@ -9334,7 +9334,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_14generator4(__pyx_GeneratorObject
__pyx_t_1 = __Pyx_PyInt_AsUnsignedInt(__pyx_cur_scope->__pyx_v_size); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_cur_scope->__pyx_v_derivations = new KBest::KBestDerivations<std::vector<WordID>,ESentenceTraversal>((__pyx_cur_scope->__pyx_v_self->hg[0]), __pyx_t_1);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":54
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":54
* cdef kbest.KBestDerivations[vector[WordID], kbest.ESentenceTraversal].Derivation* derivation
* cdef unsigned k
* try: # <<<<<<<<<<<<<<
@@ -9343,7 +9343,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_14generator4(__pyx_GeneratorObject
*/
/*try:*/ {
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":55
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":55
* cdef unsigned k
* try:
* for k in range(size): # <<<<<<<<<<<<<<
@@ -9354,7 +9354,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_14generator4(__pyx_GeneratorObject
for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_2; __pyx_t_1+=1) {
__pyx_cur_scope->__pyx_v_k = __pyx_t_1;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":56
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":56
* try:
* for k in range(size):
* derivation = derivations.LazyKthBest(self.hg.nodes_.size() - 1, k) # <<<<<<<<<<<<<<
@@ -9363,7 +9363,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_14generator4(__pyx_GeneratorObject
*/
__pyx_cur_scope->__pyx_v_derivation = __pyx_cur_scope->__pyx_v_derivations->LazyKthBest((__pyx_cur_scope->__pyx_v_self->hg->nodes_.size() - 1), __pyx_cur_scope->__pyx_v_k);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":57
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":57
* for k in range(size):
* derivation = derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
* if not derivation: break # <<<<<<<<<<<<<<
@@ -9377,7 +9377,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_14generator4(__pyx_GeneratorObject
}
__pyx_L9:;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":58
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":58
* derivation = derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
* if not derivation: break
* yield unicode(GetString(derivation._yield).c_str(), 'utf8') # <<<<<<<<<<<<<<
@@ -9414,7 +9414,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_14generator4(__pyx_GeneratorObject
__pyx_L8_break:;
}
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":60
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":60
* yield unicode(GetString(derivation._yield).c_str(), 'utf8')
* finally:
* del derivations # <<<<<<<<<<<<<<
@@ -9475,7 +9475,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_16kbest_trees(PyObject *__pyx_v_se
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":62
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":62
* del derivations
*
* def kbest_trees(self, size): # <<<<<<<<<<<<<<
@@ -9545,7 +9545,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_17generator5(__pyx_GeneratorObject
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":64
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":64
* def kbest_trees(self, size):
* """hg.kbest_trees(size) -> List of k-best trees in the hypergraph."""
* cdef kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal]* f_derivations = new kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal](self.hg[0], size) # <<<<<<<<<<<<<<
@@ -9555,7 +9555,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_17generator5(__pyx_GeneratorObject
__pyx_t_1 = __Pyx_PyInt_AsUnsignedInt(__pyx_cur_scope->__pyx_v_size); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_cur_scope->__pyx_v_f_derivations = new KBest::KBestDerivations<std::vector<WordID>,FTreeTraversal>((__pyx_cur_scope->__pyx_v_self->hg[0]), __pyx_t_1);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":66
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":66
* cdef kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal]* f_derivations = new kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal](self.hg[0], size)
* cdef kbest.KBestDerivations[vector[WordID], kbest.FTreeTraversal].Derivation* f_derivation
* cdef kbest.KBestDerivations[vector[WordID], kbest.ETreeTraversal]* e_derivations = new kbest.KBestDerivations[vector[WordID], kbest.ETreeTraversal](self.hg[0], size) # <<<<<<<<<<<<<<
@@ -9565,7 +9565,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_17generator5(__pyx_GeneratorObject
__pyx_t_1 = __Pyx_PyInt_AsUnsignedInt(__pyx_cur_scope->__pyx_v_size); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_cur_scope->__pyx_v_e_derivations = new KBest::KBestDerivations<std::vector<WordID>,ETreeTraversal>((__pyx_cur_scope->__pyx_v_self->hg[0]), __pyx_t_1);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":69
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":69
* cdef kbest.KBestDerivations[vector[WordID], kbest.ETreeTraversal].Derivation* e_derivation
* cdef unsigned k
* try: # <<<<<<<<<<<<<<
@@ -9574,7 +9574,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_17generator5(__pyx_GeneratorObject
*/
/*try:*/ {
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":70
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":70
* cdef unsigned k
* try:
* for k in range(size): # <<<<<<<<<<<<<<
@@ -9585,7 +9585,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_17generator5(__pyx_GeneratorObject
for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_2; __pyx_t_1+=1) {
__pyx_cur_scope->__pyx_v_k = __pyx_t_1;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":71
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":71
* try:
* for k in range(size):
* f_derivation = f_derivations.LazyKthBest(self.hg.nodes_.size() - 1, k) # <<<<<<<<<<<<<<
@@ -9594,7 +9594,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_17generator5(__pyx_GeneratorObject
*/
__pyx_cur_scope->__pyx_v_f_derivation = __pyx_cur_scope->__pyx_v_f_derivations->LazyKthBest((__pyx_cur_scope->__pyx_v_self->hg->nodes_.size() - 1), __pyx_cur_scope->__pyx_v_k);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":72
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":72
* for k in range(size):
* f_derivation = f_derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
* e_derivation = e_derivations.LazyKthBest(self.hg.nodes_.size() - 1, k) # <<<<<<<<<<<<<<
@@ -9603,7 +9603,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_17generator5(__pyx_GeneratorObject
*/
__pyx_cur_scope->__pyx_v_e_derivation = __pyx_cur_scope->__pyx_v_e_derivations->LazyKthBest((__pyx_cur_scope->__pyx_v_self->hg->nodes_.size() - 1), __pyx_cur_scope->__pyx_v_k);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":73
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":73
* f_derivation = f_derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
* e_derivation = e_derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
* if not f_derivation or not e_derivation: break # <<<<<<<<<<<<<<
@@ -9623,7 +9623,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_17generator5(__pyx_GeneratorObject
}
__pyx_L9:;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":74
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":74
* e_derivation = e_derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
* if not f_derivation or not e_derivation: break
* f_tree = unicode(GetString(f_derivation._yield).c_str(), 'utf8') # <<<<<<<<<<<<<<
@@ -9649,7 +9649,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_17generator5(__pyx_GeneratorObject
__pyx_cur_scope->__pyx_v_f_tree = ((PyObject*)__pyx_t_6);
__pyx_t_6 = 0;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":75
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":75
* if not f_derivation or not e_derivation: break
* f_tree = unicode(GetString(f_derivation._yield).c_str(), 'utf8')
* e_tree = unicode(GetString(e_derivation._yield).c_str(), 'utf8') # <<<<<<<<<<<<<<
@@ -9675,7 +9675,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_17generator5(__pyx_GeneratorObject
__pyx_cur_scope->__pyx_v_e_tree = ((PyObject*)__pyx_t_6);
__pyx_t_6 = 0;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":76
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":76
* f_tree = unicode(GetString(f_derivation._yield).c_str(), 'utf8')
* e_tree = unicode(GetString(e_derivation._yield).c_str(), 'utf8')
* yield (f_tree, e_tree) # <<<<<<<<<<<<<<
@@ -9707,7 +9707,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_17generator5(__pyx_GeneratorObject
__pyx_L8_break:;
}
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":78
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":78
* yield (f_tree, e_tree)
* finally:
* del f_derivations # <<<<<<<<<<<<<<
@@ -9731,7 +9731,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_17generator5(__pyx_GeneratorObject
__pyx_L6:;
delete __pyx_cur_scope->__pyx_v_f_derivations;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":79
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":79
* finally:
* del f_derivations
* del e_derivations # <<<<<<<<<<<<<<
@@ -9777,7 +9777,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_19kbest_features(PyObject *__pyx_v
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":81
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":81
* del e_derivations
*
* def kbest_features(self, size): # <<<<<<<<<<<<<<
@@ -9844,7 +9844,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_20generator6(__pyx_GeneratorObject
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":83
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":83
* def kbest_features(self, size):
* """hg.kbest_trees(size) -> List of k-best feature vectors in the hypergraph."""
* cdef kbest.KBestDerivations[FastSparseVector[weight_t], kbest.FeatureVectorTraversal]* derivations = new kbest.KBestDerivations[FastSparseVector[weight_t], kbest.FeatureVectorTraversal](self.hg[0], size) # <<<<<<<<<<<<<<
@@ -9854,7 +9854,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_20generator6(__pyx_GeneratorObject
__pyx_t_1 = __Pyx_PyInt_AsUnsignedInt(__pyx_cur_scope->__pyx_v_size); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_cur_scope->__pyx_v_derivations = new KBest::KBestDerivations<FastSparseVector<weight_t>,FeatureVectorTraversal>((__pyx_cur_scope->__pyx_v_self->hg[0]), __pyx_t_1);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":87
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":87
* cdef SparseVector fmap
* cdef unsigned k
* try: # <<<<<<<<<<<<<<
@@ -9863,7 +9863,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_20generator6(__pyx_GeneratorObject
*/
/*try:*/ {
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":88
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":88
* cdef unsigned k
* try:
* for k in range(size): # <<<<<<<<<<<<<<
@@ -9874,7 +9874,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_20generator6(__pyx_GeneratorObject
for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_2; __pyx_t_1+=1) {
__pyx_cur_scope->__pyx_v_k = __pyx_t_1;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":89
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":89
* try:
* for k in range(size):
* derivation = derivations.LazyKthBest(self.hg.nodes_.size() - 1, k) # <<<<<<<<<<<<<<
@@ -9883,7 +9883,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_20generator6(__pyx_GeneratorObject
*/
__pyx_cur_scope->__pyx_v_derivation = __pyx_cur_scope->__pyx_v_derivations->LazyKthBest((__pyx_cur_scope->__pyx_v_self->hg->nodes_.size() - 1), __pyx_cur_scope->__pyx_v_k);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":90
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":90
* for k in range(size):
* derivation = derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
* if not derivation: break # <<<<<<<<<<<<<<
@@ -9897,7 +9897,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_20generator6(__pyx_GeneratorObject
}
__pyx_L9:;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":91
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":91
* derivation = derivations.LazyKthBest(self.hg.nodes_.size() - 1, k)
* if not derivation: break
* fmap = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<<
@@ -9913,7 +9913,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_20generator6(__pyx_GeneratorObject
__pyx_cur_scope->__pyx_v_fmap = ((struct __pyx_obj_5_cdec_SparseVector *)__pyx_t_4);
__pyx_t_4 = 0;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":92
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":92
* if not derivation: break
* fmap = SparseVector.__new__(SparseVector)
* fmap.vector = new FastSparseVector[weight_t](derivation._yield) # <<<<<<<<<<<<<<
@@ -9922,7 +9922,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_20generator6(__pyx_GeneratorObject
*/
__pyx_cur_scope->__pyx_v_fmap->vector = new FastSparseVector<weight_t>(__pyx_cur_scope->__pyx_v_derivation->yield);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":93
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":93
* fmap = SparseVector.__new__(SparseVector)
* fmap.vector = new FastSparseVector[weight_t](derivation._yield)
* yield fmap # <<<<<<<<<<<<<<
@@ -9946,7 +9946,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_20generator6(__pyx_GeneratorObject
__pyx_L8_break:;
}
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":95
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":95
* yield fmap
* finally:
* del derivations # <<<<<<<<<<<<<<
@@ -10015,7 +10015,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_22sample(PyObject *__pyx_v_self, P
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":97
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":97
* del derivations
*
* def sample(self, unsigned n): # <<<<<<<<<<<<<<
@@ -10081,7 +10081,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_23generator7(__pyx_GeneratorObject
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":99
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":99
* def sample(self, unsigned n):
* """hg.sample(n) -> Sample of n hypotheses from the hypergraph."""
* cdef vector[hypergraph.Hypothesis]* hypos = new vector[hypergraph.Hypothesis]() # <<<<<<<<<<<<<<
@@ -10091,7 +10091,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_23generator7(__pyx_GeneratorObject
try {__pyx_t_1 = new std::vector<HypergraphSampler::Hypothesis>();} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
__pyx_cur_scope->__pyx_v_hypos = __pyx_t_1;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":100
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":100
* """hg.sample(n) -> Sample of n hypotheses from the hypergraph."""
* cdef vector[hypergraph.Hypothesis]* hypos = new vector[hypergraph.Hypothesis]()
* hypergraph.sample_hypotheses(self.hg[0], n, self._rng(), hypos) # <<<<<<<<<<<<<<
@@ -10100,7 +10100,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_23generator7(__pyx_GeneratorObject
*/
HypergraphSampler::sample_hypotheses((__pyx_cur_scope->__pyx_v_self->hg[0]), __pyx_cur_scope->__pyx_v_n, ((struct __pyx_vtabstruct_5_cdec_Hypergraph *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->_rng(__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_hypos);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":102
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":102
* hypergraph.sample_hypotheses(self.hg[0], n, self._rng(), hypos)
* cdef unsigned k
* try: # <<<<<<<<<<<<<<
@@ -10109,7 +10109,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_23generator7(__pyx_GeneratorObject
*/
/*try:*/ {
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":103
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":103
* cdef unsigned k
* try:
* for k in range(hypos.size()): # <<<<<<<<<<<<<<
@@ -10120,7 +10120,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_23generator7(__pyx_GeneratorObject
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_cur_scope->__pyx_v_k = __pyx_t_3;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":104
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":104
* try:
* for k in range(hypos.size()):
* yield unicode(GetString(hypos[0][k].words).c_str(), 'utf8') # <<<<<<<<<<<<<<
@@ -10156,7 +10156,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_23generator7(__pyx_GeneratorObject
}
}
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":106
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":106
* yield unicode(GetString(hypos[0][k].words).c_str(), 'utf8')
* finally:
* del hypos # <<<<<<<<<<<<<<
@@ -10227,7 +10227,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_25sample_trees(PyObject *__pyx_v_s
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":108
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":108
* del hypos
*
* def sample_trees(self, unsigned n): # <<<<<<<<<<<<<<
@@ -10293,7 +10293,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_26generator8(__pyx_GeneratorObject
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":110
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":110
* def sample_trees(self, unsigned n):
* """hg.sample_trees(n) -> Sample of n trees from the hypergraph."""
* cdef vector[string]* trees = new vector[string]() # <<<<<<<<<<<<<<
@@ -10303,7 +10303,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_26generator8(__pyx_GeneratorObject
try {__pyx_t_1 = new std::vector<std::string>();} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
__pyx_cur_scope->__pyx_v_trees = __pyx_t_1;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":111
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":111
* """hg.sample_trees(n) -> Sample of n trees from the hypergraph."""
* cdef vector[string]* trees = new vector[string]()
* hypergraph.sample_trees(self.hg[0], n, self._rng(), trees) # <<<<<<<<<<<<<<
@@ -10312,7 +10312,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_26generator8(__pyx_GeneratorObject
*/
HypergraphSampler::sample_trees((__pyx_cur_scope->__pyx_v_self->hg[0]), __pyx_cur_scope->__pyx_v_n, ((struct __pyx_vtabstruct_5_cdec_Hypergraph *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->_rng(__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_trees);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":113
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":113
* hypergraph.sample_trees(self.hg[0], n, self._rng(), trees)
* cdef unsigned k
* try: # <<<<<<<<<<<<<<
@@ -10321,7 +10321,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_26generator8(__pyx_GeneratorObject
*/
/*try:*/ {
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":114
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":114
* cdef unsigned k
* try:
* for k in range(trees.size()): # <<<<<<<<<<<<<<
@@ -10332,7 +10332,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_26generator8(__pyx_GeneratorObject
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_cur_scope->__pyx_v_k = __pyx_t_3;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":115
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":115
* try:
* for k in range(trees.size()):
* yield unicode(trees[0][k].c_str(), 'utf8') # <<<<<<<<<<<<<<
@@ -10368,7 +10368,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_26generator8(__pyx_GeneratorObject
}
}
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":117
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":117
* yield unicode(trees[0][k].c_str(), 'utf8')
* finally:
* del trees # <<<<<<<<<<<<<<
@@ -10428,7 +10428,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_28intersect(PyObject *__pyx_v_self
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":119
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":119
* del trees
*
* def intersect(self, inp): # <<<<<<<<<<<<<<
@@ -10448,7 +10448,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_27intersect(struct __pyx_obj_5_cde
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("intersect", 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":122
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":122
* """hg.intersect(Lattice/string): Intersect the hypergraph with the provided reference."""
* cdef Lattice lat
* if isinstance(inp, Lattice): # <<<<<<<<<<<<<<
@@ -10461,7 +10461,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_27intersect(struct __pyx_obj_5_cde
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":123
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":123
* cdef Lattice lat
* if isinstance(inp, Lattice):
* lat = <Lattice> inp # <<<<<<<<<<<<<<
@@ -10473,7 +10473,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_27intersect(struct __pyx_obj_5_cde
goto __pyx_L3;
}
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":124
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":124
* if isinstance(inp, Lattice):
* lat = <Lattice> inp
* elif isinstance(inp, basestring): # <<<<<<<<<<<<<<
@@ -10486,7 +10486,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_27intersect(struct __pyx_obj_5_cde
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":125
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":125
* lat = <Lattice> inp
* elif isinstance(inp, basestring):
* lat = Lattice(inp) # <<<<<<<<<<<<<<
@@ -10507,7 +10507,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_27intersect(struct __pyx_obj_5_cde
}
/*else*/ {
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":127
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":127
* lat = Lattice(inp)
* else:
* raise TypeError('cannot intersect hypergraph with %s' % type(inp)) # <<<<<<<<<<<<<<
@@ -10530,7 +10530,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_27intersect(struct __pyx_obj_5_cde
}
__pyx_L3:;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":128
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":128
* else:
* raise TypeError('cannot intersect hypergraph with %s' % type(inp))
* return hypergraph.Intersect(lat.lattice[0], self.hg) # <<<<<<<<<<<<<<
@@ -10626,7 +10626,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_30prune(PyObject *__pyx_v_self, Py
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":130
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":130
* return hypergraph.Intersect(lat.lattice[0], self.hg)
*
* def prune(self, beam_alpha=0, density=0, **kwargs): # <<<<<<<<<<<<<<
@@ -10646,7 +10646,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_29prune(struct __pyx_obj_5_cdec_Hy
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("prune", 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":134
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":134
* beam_alpha: use beam pruning
* density: use density pruning"""
* cdef hypergraph.EdgeMask* preserve_mask = NULL # <<<<<<<<<<<<<<
@@ -10655,7 +10655,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_29prune(struct __pyx_obj_5_cdec_Hy
*/
__pyx_v_preserve_mask = NULL;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":135
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":135
* density: use density pruning"""
* cdef hypergraph.EdgeMask* preserve_mask = NULL
* if 'csplit_preserve_full_word' in kwargs: # <<<<<<<<<<<<<<
@@ -10665,7 +10665,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_29prune(struct __pyx_obj_5_cdec_Hy
__pyx_t_1 = (__Pyx_PyDict_Contains(((PyObject *)__pyx_n_s_16), ((PyObject *)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_1) {
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":136
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":136
* cdef hypergraph.EdgeMask* preserve_mask = NULL
* if 'csplit_preserve_full_word' in kwargs:
* preserve_mask = new hypergraph.EdgeMask(self.hg.edges_.size()) # <<<<<<<<<<<<<<
@@ -10674,7 +10674,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_29prune(struct __pyx_obj_5_cdec_Hy
*/
__pyx_v_preserve_mask = new std::vector<bool>(__pyx_v_self->hg->edges_.size());
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":137
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":137
* if 'csplit_preserve_full_word' in kwargs:
* preserve_mask = new hypergraph.EdgeMask(self.hg.edges_.size())
* preserve_mask[0][hypergraph.GetFullWordEdgeIndex(self.hg[0])] = True # <<<<<<<<<<<<<<
@@ -10686,7 +10686,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_29prune(struct __pyx_obj_5_cdec_Hy
}
__pyx_L3:;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":138
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":138
* preserve_mask = new hypergraph.EdgeMask(self.hg.edges_.size())
* preserve_mask[0][hypergraph.GetFullWordEdgeIndex(self.hg[0])] = True
* self.hg.PruneInsideOutside(beam_alpha, density, preserve_mask, False, 1, False) # <<<<<<<<<<<<<<
@@ -10697,7 +10697,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_29prune(struct __pyx_obj_5_cdec_Hy
__pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_density); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->hg->PruneInsideOutside(__pyx_t_2, __pyx_t_3, __pyx_v_preserve_mask, 0, 1.0, 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":139
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":139
* preserve_mask[0][hypergraph.GetFullWordEdgeIndex(self.hg[0])] = True
* self.hg.PruneInsideOutside(beam_alpha, density, preserve_mask, False, 1, False)
* if preserve_mask: # <<<<<<<<<<<<<<
@@ -10707,7 +10707,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_29prune(struct __pyx_obj_5_cdec_Hy
__pyx_t_1 = (__pyx_v_preserve_mask != 0);
if (__pyx_t_1) {
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":140
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":140
* self.hg.PruneInsideOutside(beam_alpha, density, preserve_mask, False, 1, False)
* if preserve_mask:
* del preserve_mask # <<<<<<<<<<<<<<
@@ -10742,7 +10742,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_32lattice(PyObject *__pyx_v_self,
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":142
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":142
* del preserve_mask
*
* def lattice(self): # TODO direct hg -> lattice conversion in cdec # <<<<<<<<<<<<<<
@@ -10762,7 +10762,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_31lattice(struct __pyx_obj_5_cdec_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("lattice", 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":144
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":144
* def lattice(self): # TODO direct hg -> lattice conversion in cdec
* """hg.lattice() -> Lattice corresponding to the hypergraph."""
* cdef bytes plf = hypergraph.AsPLF(self.hg[0], True).c_str() # <<<<<<<<<<<<<<
@@ -10774,7 +10774,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_31lattice(struct __pyx_obj_5_cdec_
__pyx_v_plf = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":145
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":145
* """hg.lattice() -> Lattice corresponding to the hypergraph."""
* cdef bytes plf = hypergraph.AsPLF(self.hg[0], True).c_str()
* return Lattice(eval(plf)) # <<<<<<<<<<<<<<
@@ -10845,7 +10845,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_34plf(PyObject *__pyx_v_self, CYTH
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":147
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":147
* return Lattice(eval(plf))
*
* def plf(self): # <<<<<<<<<<<<<<
@@ -10863,7 +10863,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_33plf(struct __pyx_obj_5_cdec_Hype
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("plf", 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":149
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":149
* def plf(self):
* """hg.plf() -> Lattice PLF representation corresponding to the hypergraph."""
* return bytes(hypergraph.AsPLF(self.hg[0], True).c_str()) # <<<<<<<<<<<<<<
@@ -10910,7 +10910,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_36reweight(PyObject *__pyx_v_self,
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":151
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":151
* return bytes(hypergraph.AsPLF(self.hg[0], True).c_str())
*
* def reweight(self, weights): # <<<<<<<<<<<<<<
@@ -10929,7 +10929,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_35reweight(struct __pyx_obj_5_cdec
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("reweight", 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":153
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":153
* def reweight(self, weights):
* """hg.reweight(SparseVector/DenseVector): Reweight the hypergraph with a new vector."""
* if isinstance(weights, SparseVector): # <<<<<<<<<<<<<<
@@ -10942,7 +10942,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_35reweight(struct __pyx_obj_5_cdec
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":154
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":154
* """hg.reweight(SparseVector/DenseVector): Reweight the hypergraph with a new vector."""
* if isinstance(weights, SparseVector):
* self.hg.Reweight((<SparseVector> weights).vector[0]) # <<<<<<<<<<<<<<
@@ -10953,7 +10953,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_35reweight(struct __pyx_obj_5_cdec
goto __pyx_L3;
}
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":155
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":155
* if isinstance(weights, SparseVector):
* self.hg.Reweight((<SparseVector> weights).vector[0])
* elif isinstance(weights, DenseVector): # <<<<<<<<<<<<<<
@@ -10966,7 +10966,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_35reweight(struct __pyx_obj_5_cdec
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":156
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":156
* self.hg.Reweight((<SparseVector> weights).vector[0])
* elif isinstance(weights, DenseVector):
* self.hg.Reweight((<DenseVector> weights).vector[0]) # <<<<<<<<<<<<<<
@@ -10978,7 +10978,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_35reweight(struct __pyx_obj_5_cdec
}
/*else*/ {
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":158
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":158
* self.hg.Reweight((<DenseVector> weights).vector[0])
* else:
* raise TypeError('cannot reweight hypergraph with %s' % type(weights)) # <<<<<<<<<<<<<<
@@ -11026,7 +11026,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_5edges_1__get__(PyObject *__pyx_v_
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":161
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":161
*
* property edges:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -11090,7 +11090,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_5edges_2generator9(__pyx_Generator
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":163
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":163
* def __get__(self):
* cdef unsigned i
* for i in range(self.hg.edges_.size()): # <<<<<<<<<<<<<<
@@ -11101,7 +11101,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_5edges_2generator9(__pyx_Generator
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_2;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":164
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":164
* cdef unsigned i
* for i in range(self.hg.edges_.size()):
* yield HypergraphEdge().init(self.hg, i) # <<<<<<<<<<<<<<
@@ -11153,7 +11153,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_5nodes_1__get__(PyObject *__pyx_v_
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":167
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":167
*
* property nodes:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -11217,7 +11217,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_5nodes_2generator10(__pyx_Generato
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":169
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":169
* def __get__(self):
* cdef unsigned i
* for i in range(self.hg.nodes_.size()): # <<<<<<<<<<<<<<
@@ -11228,7 +11228,7 @@ static PyObject *__pyx_gb_5_cdec_10Hypergraph_5nodes_2generator10(__pyx_Generato
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_2;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":170
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":170
* cdef unsigned i
* for i in range(self.hg.nodes_.size()):
* yield HypergraphNode().init(self.hg, i) # <<<<<<<<<<<<<<
@@ -11279,7 +11279,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_4goal_1__get__(PyObject *__pyx_v_s
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":173
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":173
*
* property goal:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -11297,7 +11297,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_4goal___get__(struct __pyx_obj_5_c
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":174
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":174
* property goal:
* def __get__(self):
* return HypergraphNode().init(self.hg, self.hg.GoalNode()) # <<<<<<<<<<<<<<
@@ -11338,7 +11338,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_6npaths_1__get__(PyObject *__pyx_v
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":177
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":177
*
* property npaths:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -11355,7 +11355,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_6npaths___get__(struct __pyx_obj_5
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":178
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":178
* property npaths:
* def __get__(self):
* return self.hg.NumberOfPaths() # <<<<<<<<<<<<<<
@@ -11393,7 +11393,7 @@ static PyObject *__pyx_pw_5_cdec_10Hypergraph_38inside_outside(PyObject *__pyx_v
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":180
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":180
* return self.hg.NumberOfPaths()
*
* def inside_outside(self): # <<<<<<<<<<<<<<
@@ -11417,7 +11417,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_37inside_outside(struct __pyx_obj_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("inside_outside", 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":182
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":182
* def inside_outside(self):
* """hg.inside_outside() -> SparseVector with inside-outside scores for each feature."""
* cdef FastSparseVector[prob_t]* result = new FastSparseVector[prob_t]() # <<<<<<<<<<<<<<
@@ -11426,7 +11426,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_37inside_outside(struct __pyx_obj_
*/
__pyx_v_result = new FastSparseVector<prob_t>();
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":183
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":183
* """hg.inside_outside() -> SparseVector with inside-outside scores for each feature."""
* cdef FastSparseVector[prob_t]* result = new FastSparseVector[prob_t]()
* cdef prob_t z = hypergraph.InsideOutside(self.hg[0], result) # <<<<<<<<<<<<<<
@@ -11435,7 +11435,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_37inside_outside(struct __pyx_obj_
*/
__pyx_v_z = InsideOutside<prob_t, EdgeProb, SparseVector<prob_t>, EdgeFeaturesAndProbWeightFunction>((__pyx_v_self->hg[0]), __pyx_v_result);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":184
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":184
* cdef FastSparseVector[prob_t]* result = new FastSparseVector[prob_t]()
* cdef prob_t z = hypergraph.InsideOutside(self.hg[0], result)
* result[0] /= z # <<<<<<<<<<<<<<
@@ -11444,7 +11444,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_37inside_outside(struct __pyx_obj_
*/
(__pyx_v_result[0]) /= __pyx_v_z;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":185
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":185
* cdef prob_t z = hypergraph.InsideOutside(self.hg[0], result)
* result[0] /= z
* cdef SparseVector vector = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<<
@@ -11457,7 +11457,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_37inside_outside(struct __pyx_obj_
__pyx_v_vector = ((struct __pyx_obj_5_cdec_SparseVector *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":186
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":186
* result[0] /= z
* cdef SparseVector vector = SparseVector.__new__(SparseVector)
* vector.vector = new FastSparseVector[double]() # <<<<<<<<<<<<<<
@@ -11466,7 +11466,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_37inside_outside(struct __pyx_obj_
*/
__pyx_v_vector->vector = new FastSparseVector<double>();
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":187
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":187
* cdef SparseVector vector = SparseVector.__new__(SparseVector)
* vector.vector = new FastSparseVector[double]()
* cdef FastSparseVector[prob_t].const_iterator* it = new FastSparseVector[prob_t].const_iterator(result[0], False) # <<<<<<<<<<<<<<
@@ -11475,7 +11475,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_37inside_outside(struct __pyx_obj_
*/
__pyx_v_it = new FastSparseVector<prob_t>::const_iterator((__pyx_v_result[0]), 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":189
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":189
* cdef FastSparseVector[prob_t].const_iterator* it = new FastSparseVector[prob_t].const_iterator(result[0], False)
* cdef unsigned i
* for i in range(result.size()): # <<<<<<<<<<<<<<
@@ -11486,7 +11486,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_37inside_outside(struct __pyx_obj_
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":190
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":190
* cdef unsigned i
* for i in range(result.size()):
* vector.vector.set_value(it[0].ptr().first, log(it[0].ptr().second)) # <<<<<<<<<<<<<<
@@ -11495,7 +11495,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_37inside_outside(struct __pyx_obj_
*/
__pyx_v_vector->vector->set_value((__pyx_v_it[0]).operator->()->first, log((__pyx_v_it[0]).operator->()->second));
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":191
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":191
* for i in range(result.size()):
* vector.vector.set_value(it[0].ptr().first, log(it[0].ptr().second))
* pinc(it[0]) # ++it # <<<<<<<<<<<<<<
@@ -11505,7 +11505,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_37inside_outside(struct __pyx_obj_
(++(__pyx_v_it[0]));
}
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":192
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":192
* vector.vector.set_value(it[0].ptr().first, log(it[0].ptr().second))
* pinc(it[0]) # ++it
* del it # <<<<<<<<<<<<<<
@@ -11514,7 +11514,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_37inside_outside(struct __pyx_obj_
*/
delete __pyx_v_it;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":193
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":193
* pinc(it[0]) # ++it
* del it
* del result # <<<<<<<<<<<<<<
@@ -11523,7 +11523,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_37inside_outside(struct __pyx_obj_
*/
delete __pyx_v_result;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":194
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":194
* del it
* del result
* return vector # <<<<<<<<<<<<<<
@@ -11548,7 +11548,7 @@ static PyObject *__pyx_pf_5_cdec_10Hypergraph_37inside_outside(struct __pyx_obj_
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":201
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":201
* cdef public TRule trule
*
* cdef init(self, hypergraph.Hypergraph* hg, unsigned i): # <<<<<<<<<<<<<<
@@ -11565,7 +11565,7 @@ static PyObject *__pyx_f_5_cdec_14HypergraphEdge_init(struct __pyx_obj_5_cdec_Hy
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("init", 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":202
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":202
*
* cdef init(self, hypergraph.Hypergraph* hg, unsigned i):
* self.hg = hg # <<<<<<<<<<<<<<
@@ -11574,7 +11574,7 @@ static PyObject *__pyx_f_5_cdec_14HypergraphEdge_init(struct __pyx_obj_5_cdec_Hy
*/
__pyx_v_self->hg = __pyx_v_hg;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":203
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":203
* cdef init(self, hypergraph.Hypergraph* hg, unsigned i):
* self.hg = hg
* self.edge = &hg.edges_[i] # <<<<<<<<<<<<<<
@@ -11583,7 +11583,7 @@ static PyObject *__pyx_f_5_cdec_14HypergraphEdge_init(struct __pyx_obj_5_cdec_Hy
*/
__pyx_v_self->edge = (&(__pyx_v_hg->edges_[__pyx_v_i]));
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":204
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":204
* self.hg = hg
* self.edge = &hg.edges_[i]
* self.trule = TRule.__new__(TRule) # <<<<<<<<<<<<<<
@@ -11599,7 +11599,7 @@ static PyObject *__pyx_f_5_cdec_14HypergraphEdge_init(struct __pyx_obj_5_cdec_Hy
__pyx_v_self->trule = ((struct __pyx_obj_5_cdec_TRule *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":205
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":205
* self.edge = &hg.edges_[i]
* self.trule = TRule.__new__(TRule)
* self.trule.rule = new shared_ptr[grammar.TRule](self.edge.rule_) # <<<<<<<<<<<<<<
@@ -11608,7 +11608,7 @@ static PyObject *__pyx_f_5_cdec_14HypergraphEdge_init(struct __pyx_obj_5_cdec_Hy
*/
__pyx_v_self->trule->rule = new boost::shared_ptr<TRule>(__pyx_v_self->edge->rule_);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":206
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":206
* self.trule = TRule.__new__(TRule)
* self.trule.rule = new shared_ptr[grammar.TRule](self.edge.rule_)
* return self # <<<<<<<<<<<<<<
@@ -11643,7 +11643,7 @@ static Py_ssize_t __pyx_pw_5_cdec_14HypergraphEdge_1__len__(PyObject *__pyx_v_se
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":208
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":208
* return self
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -11656,7 +11656,7 @@ static Py_ssize_t __pyx_pf_5_cdec_14HypergraphEdge___len__(struct __pyx_obj_5_cd
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__", 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":209
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":209
*
* def __len__(self):
* return self.edge.tail_nodes_.size() # <<<<<<<<<<<<<<
@@ -11683,7 +11683,7 @@ static PyObject *__pyx_pw_5_cdec_14HypergraphEdge_9head_node_1__get__(PyObject *
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":212
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":212
*
* property head_node:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -11701,7 +11701,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphEdge_9head_node___get__(struct __py
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":213
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":213
* property head_node:
* def __get__(self):
* return HypergraphNode().init(self.hg, self.edge.head_node_) # <<<<<<<<<<<<<<
@@ -11743,7 +11743,7 @@ static PyObject *__pyx_pw_5_cdec_14HypergraphEdge_10tail_nodes_1__get__(PyObject
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":216
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":216
*
* property tail_nodes:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -11807,7 +11807,7 @@ static PyObject *__pyx_gb_5_cdec_14HypergraphEdge_10tail_nodes_2generator11(__py
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":218
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":218
* def __get__(self):
* cdef unsigned i
* for i in range(self.edge.tail_nodes_.size()): # <<<<<<<<<<<<<<
@@ -11818,7 +11818,7 @@ static PyObject *__pyx_gb_5_cdec_14HypergraphEdge_10tail_nodes_2generator11(__py
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_2;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":219
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":219
* cdef unsigned i
* for i in range(self.edge.tail_nodes_.size()):
* yield HypergraphNode().init(self.hg, self.edge.tail_nodes_[i]) # <<<<<<<<<<<<<<
@@ -11869,7 +11869,7 @@ static PyObject *__pyx_pw_5_cdec_14HypergraphEdge_4span_1__get__(PyObject *__pyx
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":222
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":222
*
* property span:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -11888,7 +11888,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphEdge_4span___get__(struct __pyx_obj
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":223
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":223
* property span:
* def __get__(self):
* return (self.edge.i_, self.edge.j_) # <<<<<<<<<<<<<<
@@ -11937,7 +11937,7 @@ static PyObject *__pyx_pw_5_cdec_14HypergraphEdge_8src_span_1__get__(PyObject *_
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":226
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":226
*
* property src_span:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -11956,7 +11956,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphEdge_8src_span___get__(struct __pyx
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":227
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":227
* property src_span:
* def __get__(self):
* return (self.edge.prev_i_, self.edge.prev_j_) # <<<<<<<<<<<<<<
@@ -12005,7 +12005,7 @@ static PyObject *__pyx_pw_5_cdec_14HypergraphEdge_14feature_values_1__get__(PyOb
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":230
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":230
*
* property feature_values:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -12023,7 +12023,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphEdge_14feature_values___get__(struc
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":231
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":231
* property feature_values:
* def __get__(self):
* cdef SparseVector vector = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<<
@@ -12036,7 +12036,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphEdge_14feature_values___get__(struc
__pyx_v_vector = ((struct __pyx_obj_5_cdec_SparseVector *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":232
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":232
* def __get__(self):
* cdef SparseVector vector = SparseVector.__new__(SparseVector)
* vector.vector = new FastSparseVector[double](self.edge.feature_values_) # <<<<<<<<<<<<<<
@@ -12045,7 +12045,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphEdge_14feature_values___get__(struc
*/
__pyx_v_vector->vector = new FastSparseVector<double>(__pyx_v_self->edge->feature_values_);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":233
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":233
* cdef SparseVector vector = SparseVector.__new__(SparseVector)
* vector.vector = new FastSparseVector[double](self.edge.feature_values_)
* return vector # <<<<<<<<<<<<<<
@@ -12081,7 +12081,7 @@ static PyObject *__pyx_pw_5_cdec_14HypergraphEdge_4prob_1__get__(PyObject *__pyx
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":236
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":236
*
* property prob:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -12098,7 +12098,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphEdge_4prob___get__(struct __pyx_obj
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":237
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":237
* property prob:
* def __get__(self):
* return self.edge.edge_prob_.as_float() # <<<<<<<<<<<<<<
@@ -12141,7 +12141,7 @@ static PyObject *__pyx_pw_5_cdec_14HypergraphEdge_3__richcmp__(PyObject *__pyx_v
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":239
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":239
* return self.edge.edge_prob_.as_float()
*
* def __richcmp__(HypergraphEdge x, HypergraphEdge y, int op): # <<<<<<<<<<<<<<
@@ -12159,7 +12159,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphEdge_2__richcmp__(struct __pyx_obj_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__richcmp__", 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":242
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":242
* if op == 2: # ==
* return x.edge == y.edge
* elif op == 3: # != # <<<<<<<<<<<<<<
@@ -12168,7 +12168,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphEdge_2__richcmp__(struct __pyx_obj_
*/
switch (__pyx_v_op) {
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":240
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":240
*
* def __richcmp__(HypergraphEdge x, HypergraphEdge y, int op):
* if op == 2: # == # <<<<<<<<<<<<<<
@@ -12177,7 +12177,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphEdge_2__richcmp__(struct __pyx_obj_
*/
case 2:
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":241
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":241
* def __richcmp__(HypergraphEdge x, HypergraphEdge y, int op):
* if op == 2: # ==
* return x.edge == y.edge # <<<<<<<<<<<<<<
@@ -12192,7 +12192,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphEdge_2__richcmp__(struct __pyx_obj_
goto __pyx_L0;
break;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":242
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":242
* if op == 2: # ==
* return x.edge == y.edge
* elif op == 3: # != # <<<<<<<<<<<<<<
@@ -12201,7 +12201,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphEdge_2__richcmp__(struct __pyx_obj_
*/
case 3:
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":243
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":243
* return x.edge == y.edge
* elif op == 3: # !=
* return not (x == y) # <<<<<<<<<<<<<<
@@ -12220,7 +12220,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphEdge_2__richcmp__(struct __pyx_obj_
break;
}
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":244
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":244
* elif op == 3: # !=
* return not (x == y)
* raise NotImplemented('comparison not implemented for HypergraphEdge') # <<<<<<<<<<<<<<
@@ -12256,7 +12256,7 @@ static PyObject *__pyx_pw_5_cdec_14HypergraphEdge_5trule_1__get__(PyObject *__py
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":199
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":199
* cdef hypergraph.Hypergraph* hg
* cdef hypergraph.HypergraphEdge* edge
* cdef public TRule trule # <<<<<<<<<<<<<<
@@ -12341,7 +12341,7 @@ static int __pyx_pf_5_cdec_14HypergraphEdge_5trule_4__del__(struct __pyx_obj_5_c
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":250
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":250
* cdef hypergraph.HypergraphNode* node
*
* cdef init(self, hypergraph.Hypergraph* hg, unsigned i): # <<<<<<<<<<<<<<
@@ -12354,7 +12354,7 @@ static PyObject *__pyx_f_5_cdec_14HypergraphNode_init(struct __pyx_obj_5_cdec_Hy
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("init", 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":251
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":251
*
* cdef init(self, hypergraph.Hypergraph* hg, unsigned i):
* self.hg = hg # <<<<<<<<<<<<<<
@@ -12363,7 +12363,7 @@ static PyObject *__pyx_f_5_cdec_14HypergraphNode_init(struct __pyx_obj_5_cdec_Hy
*/
__pyx_v_self->hg = __pyx_v_hg;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":252
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":252
* cdef init(self, hypergraph.Hypergraph* hg, unsigned i):
* self.hg = hg
* self.node = &hg.nodes_[i] # <<<<<<<<<<<<<<
@@ -12372,7 +12372,7 @@ static PyObject *__pyx_f_5_cdec_14HypergraphNode_init(struct __pyx_obj_5_cdec_Hy
*/
__pyx_v_self->node = (&(__pyx_v_hg->nodes_[__pyx_v_i]));
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":253
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":253
* self.hg = hg
* self.node = &hg.nodes_[i]
* return self # <<<<<<<<<<<<<<
@@ -12403,7 +12403,7 @@ static PyObject *__pyx_pw_5_cdec_14HypergraphNode_8in_edges_1__get__(PyObject *_
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":256
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":256
*
* property in_edges:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -12467,7 +12467,7 @@ static PyObject *__pyx_gb_5_cdec_14HypergraphNode_8in_edges_2generator12(__pyx_G
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":258
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":258
* def __get__(self):
* cdef unsigned i
* for i in range(self.node.in_edges_.size()): # <<<<<<<<<<<<<<
@@ -12478,7 +12478,7 @@ static PyObject *__pyx_gb_5_cdec_14HypergraphNode_8in_edges_2generator12(__pyx_G
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_2;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":259
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":259
* cdef unsigned i
* for i in range(self.node.in_edges_.size()):
* yield HypergraphEdge().init(self.hg, self.node.in_edges_[i]) # <<<<<<<<<<<<<<
@@ -12530,7 +12530,7 @@ static PyObject *__pyx_pw_5_cdec_14HypergraphNode_9out_edges_1__get__(PyObject *
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":262
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":262
*
* property out_edges:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -12594,7 +12594,7 @@ static PyObject *__pyx_gb_5_cdec_14HypergraphNode_9out_edges_2generator13(__pyx_
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":264
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":264
* def __get__(self):
* cdef unsigned i
* for i in range(self.node.out_edges_.size()): # <<<<<<<<<<<<<<
@@ -12605,7 +12605,7 @@ static PyObject *__pyx_gb_5_cdec_14HypergraphNode_9out_edges_2generator13(__pyx_
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_2;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":265
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":265
* cdef unsigned i
* for i in range(self.node.out_edges_.size()):
* yield HypergraphEdge().init(self.hg, self.node.out_edges_[i]) # <<<<<<<<<<<<<<
@@ -12656,7 +12656,7 @@ static PyObject *__pyx_pw_5_cdec_14HypergraphNode_4span_1__get__(PyObject *__pyx
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":268
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":268
*
* property span:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -12674,7 +12674,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphNode_4span___get__(struct __pyx_obj
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":269
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":269
* property span:
* def __get__(self):
* return next(self.in_edges).span # <<<<<<<<<<<<<<
@@ -12718,7 +12718,7 @@ static PyObject *__pyx_pw_5_cdec_14HypergraphNode_3cat_1__get__(PyObject *__pyx_
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":272
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":272
*
* property cat:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -12736,7 +12736,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphNode_3cat___get__(struct __pyx_obj_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":273
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":273
* property cat:
* def __get__(self):
* if self.node.cat_: # <<<<<<<<<<<<<<
@@ -12745,7 +12745,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphNode_3cat___get__(struct __pyx_obj_
*/
if (__pyx_v_self->node->cat_) {
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":274
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":274
* def __get__(self):
* if self.node.cat_:
* return str(TDConvert(-self.node.cat_).c_str()) # <<<<<<<<<<<<<<
@@ -12800,7 +12800,7 @@ static PyObject *__pyx_pw_5_cdec_14HypergraphNode_1__richcmp__(PyObject *__pyx_v
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":276
+/* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":276
* return str(TDConvert(-self.node.cat_).c_str())
*
* def __richcmp__(HypergraphNode x, HypergraphNode y, int op): # <<<<<<<<<<<<<<
@@ -12818,7 +12818,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphNode___richcmp__(struct __pyx_obj_5
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__richcmp__", 0);
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":279
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":279
* if op == 2: # ==
* return x.node == y.node
* elif op == 3: # != # <<<<<<<<<<<<<<
@@ -12827,7 +12827,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphNode___richcmp__(struct __pyx_obj_5
*/
switch (__pyx_v_op) {
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":277
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":277
*
* def __richcmp__(HypergraphNode x, HypergraphNode y, int op):
* if op == 2: # == # <<<<<<<<<<<<<<
@@ -12836,7 +12836,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphNode___richcmp__(struct __pyx_obj_5
*/
case 2:
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":278
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":278
* def __richcmp__(HypergraphNode x, HypergraphNode y, int op):
* if op == 2: # ==
* return x.node == y.node # <<<<<<<<<<<<<<
@@ -12851,7 +12851,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphNode___richcmp__(struct __pyx_obj_5
goto __pyx_L0;
break;
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":279
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":279
* if op == 2: # ==
* return x.node == y.node
* elif op == 3: # != # <<<<<<<<<<<<<<
@@ -12860,7 +12860,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphNode___richcmp__(struct __pyx_obj_5
*/
case 3:
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":280
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":280
* return x.node == y.node
* elif op == 3: # !=
* return not (x == y) # <<<<<<<<<<<<<<
@@ -12878,7 +12878,7 @@ static PyObject *__pyx_pf_5_cdec_14HypergraphNode___richcmp__(struct __pyx_obj_5
break;
}
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":281
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":281
* elif op == 3: # !=
* return not (x == y)
* raise NotImplemented('comparison not implemented for HypergraphNode') # <<<<<<<<<<<<<<
@@ -12915,7 +12915,7 @@ static int __pyx_pw_5_cdec_7Lattice_1__cinit__(PyObject *__pyx_v_self, PyObject
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":6
+/* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":6
* cdef lattice.Lattice* lattice
*
* def __cinit__(self): # <<<<<<<<<<<<<<
@@ -12928,7 +12928,7 @@ static int __pyx_pf_5_cdec_7Lattice___cinit__(struct __pyx_obj_5_cdec_Lattice *_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":7
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":7
*
* def __cinit__(self):
* self.lattice = new lattice.Lattice() # <<<<<<<<<<<<<<
@@ -12993,7 +12993,7 @@ static int __pyx_pw_5_cdec_7Lattice_3__init__(PyObject *__pyx_v_self, PyObject *
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":9
+/* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":9
* self.lattice = new lattice.Lattice()
*
* def __init__(self, inp): # <<<<<<<<<<<<<<
@@ -13018,7 +13018,7 @@ static int __pyx_pf_5_cdec_7Lattice_2__init__(struct __pyx_obj_5_cdec_Lattice *_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":12
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":12
* """Lattice(tuple) -> Lattice from node list.
* Lattice(string) -> Lattice from PLF representation."""
* if isinstance(inp, tuple): # <<<<<<<<<<<<<<
@@ -13031,7 +13031,7 @@ static int __pyx_pf_5_cdec_7Lattice_2__init__(struct __pyx_obj_5_cdec_Lattice *_
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":13
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":13
* Lattice(string) -> Lattice from PLF representation."""
* if isinstance(inp, tuple):
* self.lattice.resize(len(inp)) # <<<<<<<<<<<<<<
@@ -13041,7 +13041,7 @@ static int __pyx_pf_5_cdec_7Lattice_2__init__(struct __pyx_obj_5_cdec_Lattice *_
__pyx_t_3 = PyObject_Length(__pyx_v_inp); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->lattice->resize(__pyx_t_3);
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":14
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":14
* if isinstance(inp, tuple):
* self.lattice.resize(len(inp))
* for i, arcs in enumerate(inp): # <<<<<<<<<<<<<<
@@ -13096,7 +13096,7 @@ static int __pyx_pf_5_cdec_7Lattice_2__init__(struct __pyx_obj_5_cdec_Lattice *_
__pyx_t_1 = __pyx_t_6;
__pyx_t_6 = 0;
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":15
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":15
* self.lattice.resize(len(inp))
* for i, arcs in enumerate(inp):
* self[i] = arcs # <<<<<<<<<<<<<<
@@ -13110,7 +13110,7 @@ static int __pyx_pf_5_cdec_7Lattice_2__init__(struct __pyx_obj_5_cdec_Lattice *_
goto __pyx_L3;
}
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":16
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":16
* for i, arcs in enumerate(inp):
* self[i] = arcs
* elif isinstance(inp, basestring): # <<<<<<<<<<<<<<
@@ -13123,7 +13123,7 @@ static int __pyx_pf_5_cdec_7Lattice_2__init__(struct __pyx_obj_5_cdec_Lattice *_
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":17
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":17
* self[i] = arcs
* elif isinstance(inp, basestring):
* lattice.ConvertTextOrPLF(as_str(inp), self.lattice) # <<<<<<<<<<<<<<
@@ -13139,7 +13139,7 @@ static int __pyx_pf_5_cdec_7Lattice_2__init__(struct __pyx_obj_5_cdec_Lattice *_
}
/*else*/ {
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":19
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":19
* lattice.ConvertTextOrPLF(as_str(inp), self.lattice)
* else:
* raise TypeError('cannot create lattice from %s' % type(inp)) # <<<<<<<<<<<<<<
@@ -13186,7 +13186,7 @@ static void __pyx_pw_5_cdec_7Lattice_5__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyFinishContext();
}
-/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":21
+/* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":21
* raise TypeError('cannot create lattice from %s' % type(inp))
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -13198,7 +13198,7 @@ static void __pyx_pf_5_cdec_7Lattice_4__dealloc__(CYTHON_UNUSED struct __pyx_obj
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":22
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":22
*
* def __dealloc__(self):
* del self.lattice # <<<<<<<<<<<<<<
@@ -13231,7 +13231,7 @@ static PyObject *__pyx_pw_5_cdec_7Lattice_7__getitem__(PyObject *__pyx_v_self, P
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":24
+/* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":24
* del self.lattice
*
* def __getitem__(self, int index): # <<<<<<<<<<<<<<
@@ -13261,7 +13261,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_6__getitem__(struct __pyx_obj_5_cdec_L
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getitem__", 0);
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":25
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":25
*
* def __getitem__(self, int index):
* if not 0 <= index < len(self): # <<<<<<<<<<<<<<
@@ -13276,7 +13276,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_6__getitem__(struct __pyx_obj_5_cdec_L
__pyx_t_3 = (!__pyx_t_1);
if (__pyx_t_3) {
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":26
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":26
* def __getitem__(self, int index):
* if not 0 <= index < len(self):
* raise IndexError('lattice index out of range') # <<<<<<<<<<<<<<
@@ -13292,7 +13292,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_6__getitem__(struct __pyx_obj_5_cdec_L
}
__pyx_L3:;
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":27
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":27
* if not 0 <= index < len(self):
* raise IndexError('lattice index out of range')
* arcs = [] # <<<<<<<<<<<<<<
@@ -13304,7 +13304,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_6__getitem__(struct __pyx_obj_5_cdec_L
__pyx_v_arcs = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":28
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":28
* raise IndexError('lattice index out of range')
* arcs = []
* cdef vector[lattice.LatticeArc] arc_vector = self.lattice[0][index] # <<<<<<<<<<<<<<
@@ -13313,7 +13313,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_6__getitem__(struct __pyx_obj_5_cdec_L
*/
__pyx_v_arc_vector = ((__pyx_v_self->lattice[0])[__pyx_v_index]);
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":31
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":31
* cdef lattice.LatticeArc* arc
* cdef unsigned i
* for i in range(arc_vector.size()): # <<<<<<<<<<<<<<
@@ -13324,7 +13324,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_6__getitem__(struct __pyx_obj_5_cdec_L
for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
__pyx_v_i = __pyx_t_6;
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":32
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":32
* cdef unsigned i
* for i in range(arc_vector.size()):
* arc = &arc_vector[i] # <<<<<<<<<<<<<<
@@ -13333,7 +13333,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_6__getitem__(struct __pyx_obj_5_cdec_L
*/
__pyx_v_arc = (&(__pyx_v_arc_vector[__pyx_v_i]));
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":33
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":33
* for i in range(arc_vector.size()):
* arc = &arc_vector[i]
* label = unicode(TDConvert(arc.label).c_str(), 'utf8') # <<<<<<<<<<<<<<
@@ -13357,7 +13357,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_6__getitem__(struct __pyx_obj_5_cdec_L
__pyx_v_label = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":34
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":34
* arc = &arc_vector[i]
* label = unicode(TDConvert(arc.label).c_str(), 'utf8')
* arcs.append((label, arc.cost, arc.dist2next)) # <<<<<<<<<<<<<<
@@ -13383,7 +13383,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_6__getitem__(struct __pyx_obj_5_cdec_L
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
}
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":35
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":35
* label = unicode(TDConvert(arc.label).c_str(), 'utf8')
* arcs.append((label, arc.cost, arc.dist2next))
* return tuple(arcs) # <<<<<<<<<<<<<<
@@ -13439,7 +13439,7 @@ static int __pyx_pw_5_cdec_7Lattice_9__setitem__(PyObject *__pyx_v_self, PyObjec
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":37
+/* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":37
* return tuple(arcs)
*
* def __setitem__(self, int index, tuple arcs): # <<<<<<<<<<<<<<
@@ -13473,7 +13473,7 @@ static int __pyx_pf_5_cdec_7Lattice_8__setitem__(struct __pyx_obj_5_cdec_Lattice
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__setitem__", 0);
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":38
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":38
*
* def __setitem__(self, int index, tuple arcs):
* if not 0 <= index < len(self): # <<<<<<<<<<<<<<
@@ -13488,7 +13488,7 @@ static int __pyx_pf_5_cdec_7Lattice_8__setitem__(struct __pyx_obj_5_cdec_Lattice
__pyx_t_3 = (!__pyx_t_1);
if (__pyx_t_3) {
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":39
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":39
* def __setitem__(self, int index, tuple arcs):
* if not 0 <= index < len(self):
* raise IndexError('lattice index out of range') # <<<<<<<<<<<<<<
@@ -13504,7 +13504,7 @@ static int __pyx_pf_5_cdec_7Lattice_8__setitem__(struct __pyx_obj_5_cdec_Lattice
}
__pyx_L3:;
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":41
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":41
* raise IndexError('lattice index out of range')
* cdef lattice.LatticeArc* arc
* for (label, cost, dist2next) in arcs: # <<<<<<<<<<<<<<
@@ -13588,7 +13588,7 @@ static int __pyx_pf_5_cdec_7Lattice_8__setitem__(struct __pyx_obj_5_cdec_Lattice
__pyx_v_dist2next = __pyx_t_8;
__pyx_t_8 = 0;
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":42
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":42
* cdef lattice.LatticeArc* arc
* for (label, cost, dist2next) in arcs:
* label_str = as_str(label) # <<<<<<<<<<<<<<
@@ -13601,7 +13601,7 @@ static int __pyx_pf_5_cdec_7Lattice_8__setitem__(struct __pyx_obj_5_cdec_Lattice
__pyx_v_label_str = ((PyObject*)__pyx_t_5);
__pyx_t_5 = 0;
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":43
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":43
* for (label, cost, dist2next) in arcs:
* label_str = as_str(label)
* arc = new lattice.LatticeArc(TDConvert(label_str), cost, dist2next) # <<<<<<<<<<<<<<
@@ -13613,7 +13613,7 @@ static int __pyx_pf_5_cdec_7Lattice_8__setitem__(struct __pyx_obj_5_cdec_Lattice
__pyx_t_13 = __Pyx_PyInt_AsInt(__pyx_v_dist2next); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_arc = new LatticeArc(TD::Convert(__pyx_t_11), __pyx_t_12, __pyx_t_13);
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":44
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":44
* label_str = as_str(label)
* arc = new lattice.LatticeArc(TDConvert(label_str), cost, dist2next)
* self.lattice[0][index].push_back(arc[0]) # <<<<<<<<<<<<<<
@@ -13622,7 +13622,7 @@ static int __pyx_pf_5_cdec_7Lattice_8__setitem__(struct __pyx_obj_5_cdec_Lattice
*/
((__pyx_v_self->lattice[0])[__pyx_v_index]).push_back((__pyx_v_arc[0]));
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":45
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":45
* arc = new lattice.LatticeArc(TDConvert(label_str), cost, dist2next)
* self.lattice[0][index].push_back(arc[0])
* del arc # <<<<<<<<<<<<<<
@@ -13664,7 +13664,7 @@ static Py_ssize_t __pyx_pw_5_cdec_7Lattice_11__len__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":47
+/* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":47
* del arc
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -13677,7 +13677,7 @@ static Py_ssize_t __pyx_pf_5_cdec_7Lattice_10__len__(struct __pyx_obj_5_cdec_Lat
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__", 0);
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":48
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":48
*
* def __len__(self):
* return self.lattice.size() # <<<<<<<<<<<<<<
@@ -13704,7 +13704,7 @@ static PyObject *__pyx_pw_5_cdec_7Lattice_13__str__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":50
+/* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":50
* return self.lattice.size()
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -13722,7 +13722,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_12__str__(struct __pyx_obj_5_cdec_Latt
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__str__", 0);
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":51
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":51
*
* def __str__(self):
* return str(hypergraph.AsPLF(self.lattice[0], True).c_str()) # <<<<<<<<<<<<<<
@@ -13768,7 +13768,7 @@ static PyObject *__pyx_pw_5_cdec_7Lattice_15__unicode__(PyObject *__pyx_v_self,
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":53
+/* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":53
* return str(hypergraph.AsPLF(self.lattice[0], True).c_str())
*
* def __unicode__(self): # <<<<<<<<<<<<<<
@@ -13786,7 +13786,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_14__unicode__(struct __pyx_obj_5_cdec_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__unicode__", 0);
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":54
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":54
*
* def __unicode__(self):
* return unicode(str(self), 'utf8') # <<<<<<<<<<<<<<
@@ -13842,7 +13842,7 @@ static PyObject *__pyx_pw_5_cdec_7Lattice_17__iter__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":56
+/* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":56
* return unicode(str(self), 'utf8')
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -13905,7 +13905,7 @@ static PyObject *__pyx_gb_5_cdec_7Lattice_18generator14(__pyx_GeneratorObject *_
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":58
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":58
* def __iter__(self):
* cdef unsigned i
* for i in range(len(self)): # <<<<<<<<<<<<<<
@@ -13916,7 +13916,7 @@ static PyObject *__pyx_gb_5_cdec_7Lattice_18generator14(__pyx_GeneratorObject *_
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_2;
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":59
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":59
* cdef unsigned i
* for i in range(len(self)):
* yield self[i] # <<<<<<<<<<<<<<
@@ -13977,7 +13977,7 @@ static PyObject *__pyx_pw_5_cdec_7Lattice_5todot_1lines(PyObject *__pyx_self, CY
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":63
+/* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":63
* def todot(self):
* """lattice.todot() -> Representation of the lattice in GraphViz dot format."""
* def lines(): # <<<<<<<<<<<<<<
@@ -14054,7 +14054,7 @@ static PyObject *__pyx_gb_5_cdec_7Lattice_5todot_2generator20(__pyx_GeneratorObj
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":64
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":64
* """lattice.todot() -> Representation of the lattice in GraphViz dot format."""
* def lines():
* yield 'digraph lattice {' # <<<<<<<<<<<<<<
@@ -14071,7 +14071,7 @@ static PyObject *__pyx_gb_5_cdec_7Lattice_5todot_2generator20(__pyx_GeneratorObj
__pyx_L4_resume_from_yield:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":65
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":65
* def lines():
* yield 'digraph lattice {'
* yield 'rankdir = LR;' # <<<<<<<<<<<<<<
@@ -14088,7 +14088,7 @@ static PyObject *__pyx_gb_5_cdec_7Lattice_5todot_2generator20(__pyx_GeneratorObj
__pyx_L5_resume_from_yield:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":66
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":66
* yield 'digraph lattice {'
* yield 'rankdir = LR;'
* yield 'node [shape=circle];' # <<<<<<<<<<<<<<
@@ -14105,7 +14105,7 @@ static PyObject *__pyx_gb_5_cdec_7Lattice_5todot_2generator20(__pyx_GeneratorObj
__pyx_L6_resume_from_yield:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":67
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":67
* yield 'rankdir = LR;'
* yield 'node [shape=circle];'
* for i in range(len(self)): # <<<<<<<<<<<<<<
@@ -14168,7 +14168,7 @@ static PyObject *__pyx_gb_5_cdec_7Lattice_5todot_2generator20(__pyx_GeneratorObj
__pyx_cur_scope->__pyx_v_i = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":68
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":68
* yield 'node [shape=circle];'
* for i in range(len(self)):
* for label, weight, delta in self[i]: # <<<<<<<<<<<<<<
@@ -14283,7 +14283,7 @@ static PyObject *__pyx_gb_5_cdec_7Lattice_5todot_2generator20(__pyx_GeneratorObj
__pyx_cur_scope->__pyx_v_delta = __pyx_t_10;
__pyx_t_10 = 0;
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":69
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":69
* for i in range(len(self)):
* for label, weight, delta in self[i]:
* yield '%d -> %d [label="%s"];' % (i, i+delta, label.replace('"', '\\"')) # <<<<<<<<<<<<<<
@@ -14343,7 +14343,7 @@ static PyObject *__pyx_gb_5_cdec_7Lattice_5todot_2generator20(__pyx_GeneratorObj
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":70
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":70
* for label, weight, delta in self[i]:
* yield '%d -> %d [label="%s"];' % (i, i+delta, label.replace('"', '\\"'))
* yield '%d [shape=doublecircle]' % len(self) # <<<<<<<<<<<<<<
@@ -14369,7 +14369,7 @@ static PyObject *__pyx_gb_5_cdec_7Lattice_5todot_2generator20(__pyx_GeneratorObj
__pyx_L14_resume_from_yield:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":71
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":71
* yield '%d -> %d [label="%s"];' % (i, i+delta, label.replace('"', '\\"'))
* yield '%d [shape=doublecircle]' % len(self)
* yield '}' # <<<<<<<<<<<<<<
@@ -14404,7 +14404,7 @@ static PyObject *__pyx_gb_5_cdec_7Lattice_5todot_2generator20(__pyx_GeneratorObj
return NULL;
}
-/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":61
+/* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":61
* yield self[i]
*
* def todot(self): # <<<<<<<<<<<<<<
@@ -14434,7 +14434,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_19todot(struct __pyx_obj_5_cdec_Lattic
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":63
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":63
* def todot(self):
* """lattice.todot() -> Representation of the lattice in GraphViz dot format."""
* def lines(): # <<<<<<<<<<<<<<
@@ -14446,7 +14446,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_19todot(struct __pyx_obj_5_cdec_Lattic
__pyx_v_lines = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":72
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":72
* yield '%d [shape=doublecircle]' % len(self)
* yield '}'
* return '\n'.join(lines()).encode('utf8') # <<<<<<<<<<<<<<
@@ -14505,7 +14505,7 @@ static PyObject *__pyx_pw_5_cdec_7Lattice_22as_hypergraph(PyObject *__pyx_v_self
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/lattice.pxi":74
+/* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":74
* return '\n'.join(lines()).encode('utf8')
*
* def as_hypergraph(self): # <<<<<<<<<<<<<<
@@ -14526,7 +14526,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_21as_hypergraph(struct __pyx_obj_5_cde
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("as_hypergraph", 0);
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":76
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":76
* def as_hypergraph(self):
* """lattice.as_hypergraph() -> Hypergraph representation of the lattice."""
* cdef Hypergraph result = Hypergraph.__new__(Hypergraph) # <<<<<<<<<<<<<<
@@ -14539,7 +14539,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_21as_hypergraph(struct __pyx_obj_5_cde
__pyx_v_result = ((struct __pyx_obj_5_cdec_Hypergraph *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":77
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":77
* """lattice.as_hypergraph() -> Hypergraph representation of the lattice."""
* cdef Hypergraph result = Hypergraph.__new__(Hypergraph)
* result.hg = new hypergraph.Hypergraph() # <<<<<<<<<<<<<<
@@ -14548,7 +14548,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_21as_hypergraph(struct __pyx_obj_5_cde
*/
__pyx_v_result->hg = new Hypergraph();
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":78
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":78
* cdef Hypergraph result = Hypergraph.__new__(Hypergraph)
* result.hg = new hypergraph.Hypergraph()
* cdef bytes plf = str(self) # <<<<<<<<<<<<<<
@@ -14567,7 +14567,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_21as_hypergraph(struct __pyx_obj_5_cde
__pyx_v_plf = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":79
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":79
* result.hg = new hypergraph.Hypergraph()
* cdef bytes plf = str(self)
* hypergraph.ReadFromPLF(plf, result.hg) # <<<<<<<<<<<<<<
@@ -14576,7 +14576,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_21as_hypergraph(struct __pyx_obj_5_cde
__pyx_t_3 = __pyx_convert_string_from_py_(((PyObject *)__pyx_v_plf)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
HypergraphIO::ReadFromPLF(__pyx_t_3, __pyx_v_result->hg);
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":80
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":80
* cdef bytes plf = str(self)
* hypergraph.ReadFromPLF(plf, result.hg)
* return result # <<<<<<<<<<<<<<
@@ -14601,7 +14601,7 @@ static PyObject *__pyx_pf_5_cdec_7Lattice_21as_hypergraph(struct __pyx_obj_5_cde
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":3
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":3
* cimport mteval
*
* cdef SufficientStats as_stats(x, y): # <<<<<<<<<<<<<<
@@ -14622,7 +14622,7 @@ static struct __pyx_obj_5_cdec_SufficientStats *__pyx_f_5_cdec_as_stats(PyObject
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("as_stats", 0);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":4
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":4
*
* cdef SufficientStats as_stats(x, y):
* if isinstance(x, SufficientStats): # <<<<<<<<<<<<<<
@@ -14635,7 +14635,7 @@ static struct __pyx_obj_5_cdec_SufficientStats *__pyx_f_5_cdec_as_stats(PyObject
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":5
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":5
* cdef SufficientStats as_stats(x, y):
* if isinstance(x, SufficientStats):
* return x # <<<<<<<<<<<<<<
@@ -14650,7 +14650,7 @@ static struct __pyx_obj_5_cdec_SufficientStats *__pyx_f_5_cdec_as_stats(PyObject
goto __pyx_L3;
}
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":6
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":6
* if isinstance(x, SufficientStats):
* return x
* elif x == 0 and isinstance(y, SufficientStats): # <<<<<<<<<<<<<<
@@ -14671,7 +14671,7 @@ static struct __pyx_obj_5_cdec_SufficientStats *__pyx_f_5_cdec_as_stats(PyObject
}
if (__pyx_t_4) {
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":7
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":7
* return x
* elif x == 0 and isinstance(y, SufficientStats):
* stats = SufficientStats() # <<<<<<<<<<<<<<
@@ -14683,7 +14683,7 @@ static struct __pyx_obj_5_cdec_SufficientStats *__pyx_f_5_cdec_as_stats(PyObject
__pyx_v_stats = ((struct __pyx_obj_5_cdec_SufficientStats *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":8
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":8
* elif x == 0 and isinstance(y, SufficientStats):
* stats = SufficientStats()
* stats.stats = new mteval.SufficientStats() # <<<<<<<<<<<<<<
@@ -14692,7 +14692,7 @@ static struct __pyx_obj_5_cdec_SufficientStats *__pyx_f_5_cdec_as_stats(PyObject
*/
__pyx_v_stats->stats = new SufficientStats();
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":9
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":9
* stats = SufficientStats()
* stats.stats = new mteval.SufficientStats()
* stats.metric = (<SufficientStats> y).metric # <<<<<<<<<<<<<<
@@ -14701,7 +14701,7 @@ static struct __pyx_obj_5_cdec_SufficientStats *__pyx_f_5_cdec_as_stats(PyObject
*/
__pyx_v_stats->metric = ((struct __pyx_obj_5_cdec_SufficientStats *)__pyx_v_y)->metric;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":10
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":10
* stats.stats = new mteval.SufficientStats()
* stats.metric = (<SufficientStats> y).metric
* return stats # <<<<<<<<<<<<<<
@@ -14740,7 +14740,7 @@ static PyObject *__pyx_pw_5_cdec_9Candidate_5words_1__get__(PyObject *__pyx_v_se
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":17
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":17
*
* property words:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -14759,7 +14759,7 @@ static PyObject *__pyx_pf_5_cdec_9Candidate_5words___get__(struct __pyx_obj_5_cd
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":18
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":18
* property words:
* def __get__(self):
* return unicode(GetString(self.candidate.ewords).c_str(), encoding='utf8') # <<<<<<<<<<<<<<
@@ -14810,7 +14810,7 @@ static PyObject *__pyx_pw_5_cdec_9Candidate_4fmap_1__get__(PyObject *__pyx_v_sel
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":21
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":21
*
* property fmap:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -14828,7 +14828,7 @@ static PyObject *__pyx_pf_5_cdec_9Candidate_4fmap___get__(struct __pyx_obj_5_cde
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":22
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":22
* property fmap:
* def __get__(self):
* cdef SparseVector fmap = SparseVector.__new__(SparseVector) # <<<<<<<<<<<<<<
@@ -14841,7 +14841,7 @@ static PyObject *__pyx_pf_5_cdec_9Candidate_4fmap___get__(struct __pyx_obj_5_cde
__pyx_v_fmap = ((struct __pyx_obj_5_cdec_SparseVector *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":23
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":23
* def __get__(self):
* cdef SparseVector fmap = SparseVector.__new__(SparseVector)
* fmap.vector = new FastSparseVector[weight_t](self.candidate.fmap) # <<<<<<<<<<<<<<
@@ -14850,7 +14850,7 @@ static PyObject *__pyx_pf_5_cdec_9Candidate_4fmap___get__(struct __pyx_obj_5_cde
*/
__pyx_v_fmap->vector = new FastSparseVector<weight_t>(__pyx_v_self->candidate->fmap);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":24
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":24
* cdef SparseVector fmap = SparseVector.__new__(SparseVector)
* fmap.vector = new FastSparseVector[weight_t](self.candidate.fmap)
* return fmap # <<<<<<<<<<<<<<
@@ -14886,7 +14886,7 @@ static PyObject *__pyx_pw_5_cdec_9Candidate_5score_1__get__(PyObject *__pyx_v_se
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":14
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":14
* cdef class Candidate:
* cdef mteval.const_Candidate* candidate
* cdef public float score # <<<<<<<<<<<<<<
@@ -14962,7 +14962,7 @@ static void __pyx_pw_5_cdec_15SufficientStats_1__dealloc__(PyObject *__pyx_v_sel
__Pyx_RefNannyFinishContext();
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":30
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":30
* cdef mteval.EvaluationMetric* metric
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -14974,7 +14974,7 @@ static void __pyx_pf_5_cdec_15SufficientStats___dealloc__(CYTHON_UNUSED struct _
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":31
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":31
*
* def __dealloc__(self):
* del self.stats # <<<<<<<<<<<<<<
@@ -14997,7 +14997,7 @@ static PyObject *__pyx_pw_5_cdec_15SufficientStats_5score_1__get__(PyObject *__p
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":34
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":34
*
* property score:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -15014,7 +15014,7 @@ static PyObject *__pyx_pf_5_cdec_15SufficientStats_5score___get__(struct __pyx_o
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":35
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":35
* property score:
* def __get__(self):
* return self.metric.ComputeScore(self.stats[0]) # <<<<<<<<<<<<<<
@@ -15051,7 +15051,7 @@ static PyObject *__pyx_pw_5_cdec_15SufficientStats_6detail_1__get__(PyObject *__
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":38
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":38
*
* property detail:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -15069,7 +15069,7 @@ static PyObject *__pyx_pf_5_cdec_15SufficientStats_6detail___get__(struct __pyx_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":39
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":39
* property detail:
* def __get__(self):
* return str(self.metric.DetailedScore(self.stats[0]).c_str()) # <<<<<<<<<<<<<<
@@ -15115,7 +15115,7 @@ static Py_ssize_t __pyx_pw_5_cdec_15SufficientStats_3__len__(PyObject *__pyx_v_s
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":41
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":41
* return str(self.metric.DetailedScore(self.stats[0]).c_str())
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -15128,7 +15128,7 @@ static Py_ssize_t __pyx_pf_5_cdec_15SufficientStats_2__len__(struct __pyx_obj_5_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__", 0);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":42
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":42
*
* def __len__(self):
* return self.stats.size() # <<<<<<<<<<<<<<
@@ -15156,7 +15156,7 @@ static PyObject *__pyx_pw_5_cdec_15SufficientStats_5__iter__(PyObject *__pyx_v_s
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":44
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":44
* return self.stats.size()
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -15220,7 +15220,7 @@ static PyObject *__pyx_gb_5_cdec_15SufficientStats_6generator15(__pyx_GeneratorO
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":45
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":45
*
* def __iter__(self):
* for i in range(len(self)): # <<<<<<<<<<<<<<
@@ -15279,7 +15279,7 @@ static PyObject *__pyx_gb_5_cdec_15SufficientStats_6generator15(__pyx_GeneratorO
__pyx_cur_scope->__pyx_v_i = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":46
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":46
* def __iter__(self):
* for i in range(len(self)):
* yield self[i] # <<<<<<<<<<<<<<
@@ -15343,7 +15343,7 @@ static PyObject *__pyx_pw_5_cdec_15SufficientStats_8__getitem__(PyObject *__pyx_
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":48
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":48
* yield self[i]
*
* def __getitem__(self, int index): # <<<<<<<<<<<<<<
@@ -15363,7 +15363,7 @@ static PyObject *__pyx_pf_5_cdec_15SufficientStats_7__getitem__(struct __pyx_obj
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getitem__", 0);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":49
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":49
*
* def __getitem__(self, int index):
* if not 0 <= index < len(self): # <<<<<<<<<<<<<<
@@ -15378,7 +15378,7 @@ static PyObject *__pyx_pf_5_cdec_15SufficientStats_7__getitem__(struct __pyx_obj
__pyx_t_3 = (!__pyx_t_1);
if (__pyx_t_3) {
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":50
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":50
* def __getitem__(self, int index):
* if not 0 <= index < len(self):
* raise IndexError('sufficient stats vector index out of range') # <<<<<<<<<<<<<<
@@ -15394,7 +15394,7 @@ static PyObject *__pyx_pf_5_cdec_15SufficientStats_7__getitem__(struct __pyx_obj
}
__pyx_L3:;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":51
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":51
* if not 0 <= index < len(self):
* raise IndexError('sufficient stats vector index out of range')
* return self.stats[0][index] # <<<<<<<<<<<<<<
@@ -15436,7 +15436,7 @@ static PyObject *__pyx_pw_5_cdec_15SufficientStats_10__iadd__(PyObject *__pyx_v_
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":53
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":53
* return self.stats[0][index]
*
* def __iadd__(SufficientStats self, SufficientStats other): # <<<<<<<<<<<<<<
@@ -15449,7 +15449,7 @@ static PyObject *__pyx_pf_5_cdec_15SufficientStats_9__iadd__(struct __pyx_obj_5_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iadd__", 0);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":54
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":54
*
* def __iadd__(SufficientStats self, SufficientStats other):
* self.stats[0] += other.stats[0] # <<<<<<<<<<<<<<
@@ -15458,7 +15458,7 @@ static PyObject *__pyx_pf_5_cdec_15SufficientStats_9__iadd__(struct __pyx_obj_5_
*/
(__pyx_v_self->stats[0]) += (__pyx_v_other->stats[0]);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":55
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":55
* def __iadd__(SufficientStats self, SufficientStats other):
* self.stats[0] += other.stats[0]
* return self # <<<<<<<<<<<<<<
@@ -15488,7 +15488,7 @@ static PyObject *__pyx_pw_5_cdec_15SufficientStats_12__add__(PyObject *__pyx_v_x
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":57
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":57
* return self
*
* def __add__(x, y): # <<<<<<<<<<<<<<
@@ -15508,7 +15508,7 @@ static PyObject *__pyx_pf_5_cdec_15SufficientStats_11__add__(PyObject *__pyx_v_x
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__add__", 0);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":58
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":58
*
* def __add__(x, y):
* cdef SufficientStats sx = as_stats(x, y) # <<<<<<<<<<<<<<
@@ -15520,7 +15520,7 @@ static PyObject *__pyx_pf_5_cdec_15SufficientStats_11__add__(PyObject *__pyx_v_x
__pyx_v_sx = ((struct __pyx_obj_5_cdec_SufficientStats *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":59
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":59
* def __add__(x, y):
* cdef SufficientStats sx = as_stats(x, y)
* cdef SufficientStats sy = as_stats(y, x) # <<<<<<<<<<<<<<
@@ -15532,7 +15532,7 @@ static PyObject *__pyx_pf_5_cdec_15SufficientStats_11__add__(PyObject *__pyx_v_x
__pyx_v_sy = ((struct __pyx_obj_5_cdec_SufficientStats *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":60
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":60
* cdef SufficientStats sx = as_stats(x, y)
* cdef SufficientStats sy = as_stats(y, x)
* cdef SufficientStats result = SufficientStats() # <<<<<<<<<<<<<<
@@ -15544,7 +15544,7 @@ static PyObject *__pyx_pf_5_cdec_15SufficientStats_11__add__(PyObject *__pyx_v_x
__pyx_v_result = ((struct __pyx_obj_5_cdec_SufficientStats *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":61
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":61
* cdef SufficientStats sy = as_stats(y, x)
* cdef SufficientStats result = SufficientStats()
* result.stats = new mteval.SufficientStats(mteval.add(sx.stats[0], sy.stats[0])) # <<<<<<<<<<<<<<
@@ -15553,7 +15553,7 @@ static PyObject *__pyx_pf_5_cdec_15SufficientStats_11__add__(PyObject *__pyx_v_x
*/
__pyx_v_result->stats = new SufficientStats(operator+((__pyx_v_sx->stats[0]), (__pyx_v_sy->stats[0])));
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":62
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":62
* cdef SufficientStats result = SufficientStats()
* result.stats = new mteval.SufficientStats(mteval.add(sx.stats[0], sy.stats[0]))
* result.metric = sx.metric # <<<<<<<<<<<<<<
@@ -15562,7 +15562,7 @@ static PyObject *__pyx_pf_5_cdec_15SufficientStats_11__add__(PyObject *__pyx_v_x
*/
__pyx_v_result->metric = __pyx_v_sx->metric;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":63
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":63
* result.stats = new mteval.SufficientStats(mteval.add(sx.stats[0], sy.stats[0]))
* result.metric = sx.metric
* return result # <<<<<<<<<<<<<<
@@ -15641,7 +15641,7 @@ static int __pyx_pw_5_cdec_12CandidateSet_1__cinit__(PyObject *__pyx_v_self, PyO
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":70
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":70
* cdef mteval.CandidateSet* cs
*
* def __cinit__(self, SegmentEvaluator evaluator): # <<<<<<<<<<<<<<
@@ -15654,7 +15654,7 @@ static int __pyx_pf_5_cdec_12CandidateSet___cinit__(struct __pyx_obj_5_cdec_Cand
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":71
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":71
*
* def __cinit__(self, SegmentEvaluator evaluator):
* self.scorer = new shared_ptr[mteval.SegmentEvaluator](evaluator.scorer[0]) # <<<<<<<<<<<<<<
@@ -15663,7 +15663,7 @@ static int __pyx_pf_5_cdec_12CandidateSet___cinit__(struct __pyx_obj_5_cdec_Cand
*/
__pyx_v_self->scorer = new boost::shared_ptr<SegmentEvaluator>((__pyx_v_evaluator->scorer[0]));
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":72
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":72
* def __cinit__(self, SegmentEvaluator evaluator):
* self.scorer = new shared_ptr[mteval.SegmentEvaluator](evaluator.scorer[0])
* self.metric = evaluator.metric # <<<<<<<<<<<<<<
@@ -15672,7 +15672,7 @@ static int __pyx_pf_5_cdec_12CandidateSet___cinit__(struct __pyx_obj_5_cdec_Cand
*/
__pyx_v_self->metric = __pyx_v_evaluator->metric;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":73
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":73
* self.scorer = new shared_ptr[mteval.SegmentEvaluator](evaluator.scorer[0])
* self.metric = evaluator.metric
* self.cs = new mteval.CandidateSet() # <<<<<<<<<<<<<<
@@ -15695,7 +15695,7 @@ static void __pyx_pw_5_cdec_12CandidateSet_3__dealloc__(PyObject *__pyx_v_self)
__Pyx_RefNannyFinishContext();
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":75
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":75
* self.cs = new mteval.CandidateSet()
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -15707,7 +15707,7 @@ static void __pyx_pf_5_cdec_12CandidateSet_2__dealloc__(CYTHON_UNUSED struct __p
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":76
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":76
*
* def __dealloc__(self):
* del self.scorer # <<<<<<<<<<<<<<
@@ -15716,7 +15716,7 @@ static void __pyx_pf_5_cdec_12CandidateSet_2__dealloc__(CYTHON_UNUSED struct __p
*/
delete __pyx_v_self->scorer;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":77
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":77
* def __dealloc__(self):
* del self.scorer
* del self.cs # <<<<<<<<<<<<<<
@@ -15739,7 +15739,7 @@ static Py_ssize_t __pyx_pw_5_cdec_12CandidateSet_5__len__(PyObject *__pyx_v_self
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":79
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":79
* del self.cs
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -15752,7 +15752,7 @@ static Py_ssize_t __pyx_pf_5_cdec_12CandidateSet_4__len__(struct __pyx_obj_5_cde
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__", 0);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":80
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":80
*
* def __len__(self):
* return self.cs.size() # <<<<<<<<<<<<<<
@@ -15789,7 +15789,7 @@ static PyObject *__pyx_pw_5_cdec_12CandidateSet_7__getitem__(PyObject *__pyx_v_s
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":82
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":82
* return self.cs.size()
*
* def __getitem__(self,int k): # <<<<<<<<<<<<<<
@@ -15809,7 +15809,7 @@ static PyObject *__pyx_pf_5_cdec_12CandidateSet_6__getitem__(struct __pyx_obj_5_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getitem__", 0);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":83
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":83
*
* def __getitem__(self,int k):
* if not 0 <= k < self.cs.size(): # <<<<<<<<<<<<<<
@@ -15823,7 +15823,7 @@ static PyObject *__pyx_pf_5_cdec_12CandidateSet_6__getitem__(struct __pyx_obj_5_
__pyx_t_2 = (!__pyx_t_1);
if (__pyx_t_2) {
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":84
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":84
* def __getitem__(self,int k):
* if not 0 <= k < self.cs.size():
* raise IndexError('candidate set index out of range') # <<<<<<<<<<<<<<
@@ -15839,7 +15839,7 @@ static PyObject *__pyx_pf_5_cdec_12CandidateSet_6__getitem__(struct __pyx_obj_5_
}
__pyx_L3:;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":85
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":85
* if not 0 <= k < self.cs.size():
* raise IndexError('candidate set index out of range')
* cdef Candidate candidate = Candidate() # <<<<<<<<<<<<<<
@@ -15851,7 +15851,7 @@ static PyObject *__pyx_pf_5_cdec_12CandidateSet_6__getitem__(struct __pyx_obj_5_
__pyx_v_candidate = ((struct __pyx_obj_5_cdec_Candidate *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":86
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":86
* raise IndexError('candidate set index out of range')
* cdef Candidate candidate = Candidate()
* candidate.candidate = &self.cs[0][k] # <<<<<<<<<<<<<<
@@ -15860,7 +15860,7 @@ static PyObject *__pyx_pf_5_cdec_12CandidateSet_6__getitem__(struct __pyx_obj_5_
*/
__pyx_v_candidate->candidate = (&((__pyx_v_self->cs[0])[__pyx_v_k]));
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":87
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":87
* cdef Candidate candidate = Candidate()
* candidate.candidate = &self.cs[0][k]
* candidate.score = self.metric.ComputeScore(self.cs[0][k].eval_feats) # <<<<<<<<<<<<<<
@@ -15869,7 +15869,7 @@ static PyObject *__pyx_pf_5_cdec_12CandidateSet_6__getitem__(struct __pyx_obj_5_
*/
__pyx_v_candidate->score = __pyx_v_self->metric->ComputeScore(((__pyx_v_self->cs[0])[__pyx_v_k]).eval_feats);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":88
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":88
* candidate.candidate = &self.cs[0][k]
* candidate.score = self.metric.ComputeScore(self.cs[0][k].eval_feats)
* return candidate # <<<<<<<<<<<<<<
@@ -15906,7 +15906,7 @@ static PyObject *__pyx_pw_5_cdec_12CandidateSet_9__iter__(PyObject *__pyx_v_self
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":90
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":90
* return candidate
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -15969,7 +15969,7 @@ static PyObject *__pyx_gb_5_cdec_12CandidateSet_10generator16(__pyx_GeneratorObj
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":92
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":92
* def __iter__(self):
* cdef unsigned i
* for i in range(len(self)): # <<<<<<<<<<<<<<
@@ -15980,7 +15980,7 @@ static PyObject *__pyx_gb_5_cdec_12CandidateSet_10generator16(__pyx_GeneratorObj
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_2;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":93
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":93
* cdef unsigned i
* for i in range(len(self)):
* yield self[i] # <<<<<<<<<<<<<<
@@ -16078,7 +16078,7 @@ static PyObject *__pyx_pw_5_cdec_12CandidateSet_12add_kbest(PyObject *__pyx_v_se
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":95
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":95
* yield self[i]
*
* def add_kbest(self, Hypergraph hypergraph, unsigned k): # <<<<<<<<<<<<<<
@@ -16091,7 +16091,7 @@ static PyObject *__pyx_pf_5_cdec_12CandidateSet_11add_kbest(struct __pyx_obj_5_c
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("add_kbest", 0);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":98
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":98
* """cs.add_kbest(Hypergraph hypergraph, int k) -> Extract K-best hypotheses
* from the hypergraph and add them to the candidate set."""
* self.cs.AddKBestCandidates(hypergraph.hg[0], k, self.scorer.get()) # <<<<<<<<<<<<<<
@@ -16115,7 +16115,7 @@ static void __pyx_pw_5_cdec_16SegmentEvaluator_1__dealloc__(PyObject *__pyx_v_se
__Pyx_RefNannyFinishContext();
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":104
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":104
* cdef mteval.EvaluationMetric* metric
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -16127,7 +16127,7 @@ static void __pyx_pf_5_cdec_16SegmentEvaluator___dealloc__(CYTHON_UNUSED struct
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":105
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":105
*
* def __dealloc__(self):
* del self.scorer # <<<<<<<<<<<<<<
@@ -16151,7 +16151,7 @@ static PyObject *__pyx_pw_5_cdec_16SegmentEvaluator_3evaluate(PyObject *__pyx_v_
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":107
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":107
* del self.scorer
*
* def evaluate(self, sentence): # <<<<<<<<<<<<<<
@@ -16172,7 +16172,7 @@ static PyObject *__pyx_pf_5_cdec_16SegmentEvaluator_2evaluate(struct __pyx_obj_5
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("evaluate", 0);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":110
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":110
* """se.evaluate(sentence) -> SufficientStats for the given hypothesis."""
* cdef vector[WordID] hyp
* cdef SufficientStats sf = SufficientStats() # <<<<<<<<<<<<<<
@@ -16184,7 +16184,7 @@ static PyObject *__pyx_pf_5_cdec_16SegmentEvaluator_2evaluate(struct __pyx_obj_5
__pyx_v_sf = ((struct __pyx_obj_5_cdec_SufficientStats *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":111
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":111
* cdef vector[WordID] hyp
* cdef SufficientStats sf = SufficientStats()
* sf.metric = self.metric # <<<<<<<<<<<<<<
@@ -16193,7 +16193,7 @@ static PyObject *__pyx_pf_5_cdec_16SegmentEvaluator_2evaluate(struct __pyx_obj_5
*/
__pyx_v_sf->metric = __pyx_v_self->metric;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":112
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":112
* cdef SufficientStats sf = SufficientStats()
* sf.metric = self.metric
* sf.stats = new mteval.SufficientStats() # <<<<<<<<<<<<<<
@@ -16202,7 +16202,7 @@ static PyObject *__pyx_pf_5_cdec_16SegmentEvaluator_2evaluate(struct __pyx_obj_5
*/
__pyx_v_sf->stats = new SufficientStats();
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":113
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":113
* sf.metric = self.metric
* sf.stats = new mteval.SufficientStats()
* ConvertSentence(as_str(sentence.strip()), &hyp) # <<<<<<<<<<<<<<
@@ -16221,7 +16221,7 @@ static PyObject *__pyx_pf_5_cdec_16SegmentEvaluator_2evaluate(struct __pyx_obj_5
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
TD::ConvertSentence(__pyx_t_3, (&__pyx_v_hyp));
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":114
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":114
* sf.stats = new mteval.SufficientStats()
* ConvertSentence(as_str(sentence.strip()), &hyp)
* self.scorer.get().Evaluate(hyp, sf.stats) # <<<<<<<<<<<<<<
@@ -16230,7 +16230,7 @@ static PyObject *__pyx_pf_5_cdec_16SegmentEvaluator_2evaluate(struct __pyx_obj_5
*/
__pyx_v_self->scorer->get()->Evaluate(__pyx_v_hyp, __pyx_v_sf->stats);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":115
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":115
* ConvertSentence(as_str(sentence.strip()), &hyp)
* self.scorer.get().Evaluate(hyp, sf.stats)
* return sf # <<<<<<<<<<<<<<
@@ -16268,7 +16268,7 @@ static PyObject *__pyx_pw_5_cdec_16SegmentEvaluator_5candidate_set(PyObject *__p
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":117
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":117
* return sf
*
* def candidate_set(self): # <<<<<<<<<<<<<<
@@ -16286,7 +16286,7 @@ static PyObject *__pyx_pf_5_cdec_16SegmentEvaluator_4candidate_set(struct __pyx_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("candidate_set", 0);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":119
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":119
* def candidate_set(self):
* """se.candidate_set() -> Candidate set using this segment evaluator for scoring."""
* return CandidateSet(self) # <<<<<<<<<<<<<<
@@ -16330,7 +16330,7 @@ static int __pyx_pw_5_cdec_6Scorer_1__cinit__(PyObject *__pyx_v_self, PyObject *
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__name,0};
PyObject* values[1] = {0};
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":125
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":125
* cdef mteval.EvaluationMetric* metric
*
* def __cinit__(self, bytes name=None): # <<<<<<<<<<<<<<
@@ -16395,7 +16395,7 @@ static int __pyx_pf_5_cdec_6Scorer___cinit__(struct __pyx_obj_5_cdec_Scorer *__p
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":126
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":126
*
* def __cinit__(self, bytes name=None):
* if name: # <<<<<<<<<<<<<<
@@ -16405,7 +16405,7 @@ static int __pyx_pf_5_cdec_6Scorer___cinit__(struct __pyx_obj_5_cdec_Scorer *__p
__pyx_t_1 = (((PyObject *)__pyx_v_name) != Py_None) && (PyBytes_GET_SIZE(((PyObject *)__pyx_v_name)) != 0);
if (__pyx_t_1) {
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":127
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":127
* def __cinit__(self, bytes name=None):
* if name:
* self.name = new string(name) # <<<<<<<<<<<<<<
@@ -16416,7 +16416,7 @@ static int __pyx_pf_5_cdec_6Scorer___cinit__(struct __pyx_obj_5_cdec_Scorer *__p
try {__pyx_t_3 = new std::string(__pyx_t_2);} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
__pyx_v_self->name = __pyx_t_3;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":128
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":128
* if name:
* self.name = new string(name)
* self.metric = mteval.MetricInstance(self.name[0]) # <<<<<<<<<<<<<<
@@ -16447,7 +16447,7 @@ static void __pyx_pw_5_cdec_6Scorer_3__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyFinishContext();
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":130
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":130
* self.metric = mteval.MetricInstance(self.name[0])
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -16459,7 +16459,7 @@ static void __pyx_pf_5_cdec_6Scorer_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":131
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":131
*
* def __dealloc__(self):
* del self.name # <<<<<<<<<<<<<<
@@ -16518,7 +16518,7 @@ static PyObject *__pyx_pw_5_cdec_6Scorer_5__call__(PyObject *__pyx_v_self, PyObj
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":133
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":133
* del self.name
*
* def __call__(self, refs): # <<<<<<<<<<<<<<
@@ -16548,7 +16548,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_4__call__(struct __pyx_obj_5_cdec_Score
__Pyx_RefNannySetupContext("__call__", 0);
__Pyx_INCREF(__pyx_v_refs);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":134
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":134
*
* def __call__(self, refs):
* if isinstance(refs, basestring): # <<<<<<<<<<<<<<
@@ -16561,7 +16561,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_4__call__(struct __pyx_obj_5_cdec_Score
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":135
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":135
* def __call__(self, refs):
* if isinstance(refs, basestring):
* refs = [refs] # <<<<<<<<<<<<<<
@@ -16580,7 +16580,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_4__call__(struct __pyx_obj_5_cdec_Score
}
__pyx_L3:;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":136
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":136
* if isinstance(refs, basestring):
* refs = [refs]
* cdef vector[vector[WordID]]* refsv = new vector[vector[WordID]]() # <<<<<<<<<<<<<<
@@ -16590,7 +16590,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_4__call__(struct __pyx_obj_5_cdec_Score
try {__pyx_t_3 = new std::vector<std::vector<WordID> >();} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
__pyx_v_refsv = __pyx_t_3;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":138
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":138
* cdef vector[vector[WordID]]* refsv = new vector[vector[WordID]]()
* cdef vector[WordID]* refv
* for ref in refs: # <<<<<<<<<<<<<<
@@ -16635,7 +16635,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_4__call__(struct __pyx_obj_5_cdec_Score
__pyx_v_ref = __pyx_t_6;
__pyx_t_6 = 0;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":139
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":139
* cdef vector[WordID]* refv
* for ref in refs:
* refv = new vector[WordID]() # <<<<<<<<<<<<<<
@@ -16645,7 +16645,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_4__call__(struct __pyx_obj_5_cdec_Score
try {__pyx_t_7 = new std::vector<WordID>();} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
__pyx_v_refv = __pyx_t_7;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":140
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":140
* for ref in refs:
* refv = new vector[WordID]()
* ConvertSentence(as_str(ref.strip()), refv) # <<<<<<<<<<<<<<
@@ -16664,7 +16664,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_4__call__(struct __pyx_obj_5_cdec_Score
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
TD::ConvertSentence(__pyx_t_9, __pyx_v_refv);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":141
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":141
* refv = new vector[WordID]()
* ConvertSentence(as_str(ref.strip()), refv)
* refsv.push_back(refv[0]) # <<<<<<<<<<<<<<
@@ -16673,7 +16673,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_4__call__(struct __pyx_obj_5_cdec_Score
*/
__pyx_v_refsv->push_back((__pyx_v_refv[0]));
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":142
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":142
* ConvertSentence(as_str(ref.strip()), refv)
* refsv.push_back(refv[0])
* del refv # <<<<<<<<<<<<<<
@@ -16684,7 +16684,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_4__call__(struct __pyx_obj_5_cdec_Score
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":144
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":144
* del refv
* cdef unsigned i
* cdef SegmentEvaluator evaluator = SegmentEvaluator() # <<<<<<<<<<<<<<
@@ -16696,7 +16696,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_4__call__(struct __pyx_obj_5_cdec_Score
__pyx_v_evaluator = ((struct __pyx_obj_5_cdec_SegmentEvaluator *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":145
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":145
* cdef unsigned i
* cdef SegmentEvaluator evaluator = SegmentEvaluator()
* evaluator.metric = self.metric # <<<<<<<<<<<<<<
@@ -16705,7 +16705,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_4__call__(struct __pyx_obj_5_cdec_Score
*/
__pyx_v_evaluator->metric = __pyx_v_self->metric;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":146
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":146
* cdef SegmentEvaluator evaluator = SegmentEvaluator()
* evaluator.metric = self.metric
* evaluator.scorer = new shared_ptr[mteval.SegmentEvaluator]( # <<<<<<<<<<<<<<
@@ -16714,7 +16714,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_4__call__(struct __pyx_obj_5_cdec_Score
*/
__pyx_v_evaluator->scorer = new boost::shared_ptr<SegmentEvaluator>(__pyx_v_self->metric->CreateSegmentEvaluator((__pyx_v_refsv[0])));
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":148
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":148
* evaluator.scorer = new shared_ptr[mteval.SegmentEvaluator](
* self.metric.CreateSegmentEvaluator(refsv[0]))
* del refsv # in theory should not delete but store in SegmentEvaluator # <<<<<<<<<<<<<<
@@ -16723,7 +16723,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_4__call__(struct __pyx_obj_5_cdec_Score
*/
delete __pyx_v_refsv;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":149
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":149
* self.metric.CreateSegmentEvaluator(refsv[0]))
* del refsv # in theory should not delete but store in SegmentEvaluator
* return evaluator # <<<<<<<<<<<<<<
@@ -16763,7 +16763,7 @@ static PyObject *__pyx_pw_5_cdec_6Scorer_7__str__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":151
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":151
* return evaluator
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -16781,7 +16781,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_6__str__(struct __pyx_obj_5_cdec_Scorer
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__str__", 0);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":152
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":152
*
* def __str__(self):
* return str(self.name.c_str()) # <<<<<<<<<<<<<<
@@ -16816,7 +16816,7 @@ static PyObject *__pyx_pf_5_cdec_6Scorer_6__str__(struct __pyx_obj_5_cdec_Scorer
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":154
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":154
* return str(self.name.c_str())
*
* cdef float _compute_score(void* metric_, mteval.SufficientStats* stats): # <<<<<<<<<<<<<<
@@ -16842,7 +16842,7 @@ static float __pyx_f_5_cdec__compute_score(void *__pyx_v_metric_, SufficientStat
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_compute_score", 0);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":155
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":155
*
* cdef float _compute_score(void* metric_, mteval.SufficientStats* stats):
* cdef Metric metric = <Metric> metric_ # <<<<<<<<<<<<<<
@@ -16852,7 +16852,7 @@ static float __pyx_f_5_cdec__compute_score(void *__pyx_v_metric_, SufficientStat
__Pyx_INCREF(((PyObject *)((struct __pyx_obj_5_cdec_Metric *)__pyx_v_metric_)));
__pyx_v_metric = ((struct __pyx_obj_5_cdec_Metric *)__pyx_v_metric_);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":156
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":156
* cdef float _compute_score(void* metric_, mteval.SufficientStats* stats):
* cdef Metric metric = <Metric> metric_
* cdef list ss = [] # <<<<<<<<<<<<<<
@@ -16864,7 +16864,7 @@ static float __pyx_f_5_cdec__compute_score(void *__pyx_v_metric_, SufficientStat
__pyx_v_ss = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":158
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":158
* cdef list ss = []
* cdef unsigned i
* for i in range(stats.size()): # <<<<<<<<<<<<<<
@@ -16875,7 +16875,7 @@ static float __pyx_f_5_cdec__compute_score(void *__pyx_v_metric_, SufficientStat
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":159
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":159
* cdef unsigned i
* for i in range(stats.size()):
* ss.append(stats[0][i]) # <<<<<<<<<<<<<<
@@ -16888,7 +16888,7 @@ static float __pyx_f_5_cdec__compute_score(void *__pyx_v_metric_, SufficientStat
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":160
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":160
* for i in range(stats.size()):
* ss.append(stats[0][i])
* return metric.score(ss) # <<<<<<<<<<<<<<
@@ -16926,7 +16926,7 @@ static float __pyx_f_5_cdec__compute_score(void *__pyx_v_metric_, SufficientStat
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":162
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":162
* return metric.score(ss)
*
* cdef void _compute_sufficient_stats(void* metric_, # <<<<<<<<<<<<<<
@@ -16953,7 +16953,7 @@ static void __pyx_f_5_cdec__compute_sufficient_stats(void *__pyx_v_metric_, std:
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_compute_sufficient_stats", 0);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":166
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":166
* vector[string]* refs,
* mteval.SufficientStats* out):
* cdef Metric metric = <Metric> metric_ # <<<<<<<<<<<<<<
@@ -16963,7 +16963,7 @@ static void __pyx_f_5_cdec__compute_sufficient_stats(void *__pyx_v_metric_, std:
__Pyx_INCREF(((PyObject *)((struct __pyx_obj_5_cdec_Metric *)__pyx_v_metric_)));
__pyx_v_metric = ((struct __pyx_obj_5_cdec_Metric *)__pyx_v_metric_);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":167
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":167
* mteval.SufficientStats* out):
* cdef Metric metric = <Metric> metric_
* cdef list refs_ = [] # <<<<<<<<<<<<<<
@@ -16975,7 +16975,7 @@ static void __pyx_f_5_cdec__compute_sufficient_stats(void *__pyx_v_metric_, std:
__pyx_v_refs_ = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":169
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":169
* cdef list refs_ = []
* cdef unsigned i
* for i in range(refs.size()): # <<<<<<<<<<<<<<
@@ -16986,7 +16986,7 @@ static void __pyx_f_5_cdec__compute_sufficient_stats(void *__pyx_v_metric_, std:
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":170
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":170
* cdef unsigned i
* for i in range(refs.size()):
* refs_.append(str(refs[0][i].c_str())) # <<<<<<<<<<<<<<
@@ -17007,7 +17007,7 @@ static void __pyx_f_5_cdec__compute_sufficient_stats(void *__pyx_v_metric_, std:
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":171
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":171
* for i in range(refs.size()):
* refs_.append(str(refs[0][i].c_str()))
* cdef list ss = metric.evaluate(str(hyp.c_str()), refs_) # <<<<<<<<<<<<<<
@@ -17042,7 +17042,7 @@ static void __pyx_f_5_cdec__compute_sufficient_stats(void *__pyx_v_metric_, std:
__pyx_v_ss = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":172
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":172
* refs_.append(str(refs[0][i].c_str()))
* cdef list ss = metric.evaluate(str(hyp.c_str()), refs_)
* out.fields.resize(len(ss)) # <<<<<<<<<<<<<<
@@ -17056,7 +17056,7 @@ static void __pyx_f_5_cdec__compute_sufficient_stats(void *__pyx_v_metric_, std:
__pyx_t_7 = PyList_GET_SIZE(((PyObject *)__pyx_v_ss)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_out->fields.resize(__pyx_t_7);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":173
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":173
* cdef list ss = metric.evaluate(str(hyp.c_str()), refs_)
* out.fields.resize(len(ss))
* for i in range(len(ss)): # <<<<<<<<<<<<<<
@@ -17071,7 +17071,7 @@ static void __pyx_f_5_cdec__compute_sufficient_stats(void *__pyx_v_metric_, std:
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_7; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":174
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":174
* out.fields.resize(len(ss))
* for i in range(len(ss)):
* out.fields[i] = ss[i] # <<<<<<<<<<<<<<
@@ -17116,7 +17116,7 @@ static int __pyx_pw_5_cdec_6Metric_1__cinit__(PyObject *__pyx_v_self, PyObject *
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":178
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":178
* cdef class Metric:
* cdef Scorer scorer
* def __cinit__(self): # <<<<<<<<<<<<<<
@@ -17137,7 +17137,7 @@ static int __pyx_pf_5_cdec_6Metric___cinit__(struct __pyx_obj_5_cdec_Metric *__p
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":179
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":179
* cdef Scorer scorer
* def __cinit__(self):
* self.scorer = Scorer() # <<<<<<<<<<<<<<
@@ -17152,7 +17152,7 @@ static int __pyx_pf_5_cdec_6Metric___cinit__(struct __pyx_obj_5_cdec_Metric *__p
__pyx_v_self->scorer = ((struct __pyx_obj_5_cdec_Scorer *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":180
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":180
* def __cinit__(self):
* self.scorer = Scorer()
* cdef bytes class_name = self.__class__.__name__ # <<<<<<<<<<<<<<
@@ -17168,7 +17168,7 @@ static int __pyx_pf_5_cdec_6Metric___cinit__(struct __pyx_obj_5_cdec_Metric *__p
__pyx_v_class_name = ((PyObject*)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":181
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":181
* self.scorer = Scorer()
* cdef bytes class_name = self.__class__.__name__
* self.scorer.name = new string(class_name) # <<<<<<<<<<<<<<
@@ -17179,7 +17179,7 @@ static int __pyx_pf_5_cdec_6Metric___cinit__(struct __pyx_obj_5_cdec_Metric *__p
try {__pyx_t_4 = new std::string(__pyx_t_3);} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
__pyx_v_self->scorer->name = __pyx_t_4;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":182
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":182
* cdef bytes class_name = self.__class__.__name__
* self.scorer.name = new string(class_name)
* self.scorer.metric = mteval.PyMetricInstance(self.scorer.name[0], # <<<<<<<<<<<<<<
@@ -17248,7 +17248,7 @@ static PyObject *__pyx_pw_5_cdec_6Metric_3__call__(PyObject *__pyx_v_self, PyObj
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":185
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":185
* <void*> self, _compute_sufficient_stats, _compute_score)
*
* def __call__(self, refs): # <<<<<<<<<<<<<<
@@ -17266,7 +17266,7 @@ static PyObject *__pyx_pf_5_cdec_6Metric_2__call__(struct __pyx_obj_5_cdec_Metri
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__call__", 0);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":186
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":186
*
* def __call__(self, refs):
* return self.scorer(refs) # <<<<<<<<<<<<<<
@@ -17310,7 +17310,7 @@ static PyObject *__pyx_pw_5_cdec_6Metric_5score(PyObject *__pyx_v_stats, CYTHON_
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":188
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":188
* return self.scorer(refs)
*
* def score(SufficientStats stats): # <<<<<<<<<<<<<<
@@ -17323,7 +17323,7 @@ static PyObject *__pyx_pf_5_cdec_6Metric_4score(CYTHON_UNUSED struct __pyx_obj_5
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("score", 0);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":189
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":189
*
* def score(SufficientStats stats):
* return 0 # <<<<<<<<<<<<<<
@@ -17398,7 +17398,7 @@ static PyObject *__pyx_pw_5_cdec_6Metric_7evaluate(PyObject *__pyx_v_self, PyObj
return __pyx_r;
}
-/* "/home/vchahune/tools/cdec/python/src/mteval.pxi":191
+/* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":191
* return 0
*
* def evaluate(self, hyp, refs): # <<<<<<<<<<<<<<
@@ -17415,7 +17415,7 @@ static PyObject *__pyx_pf_5_cdec_6Metric_6evaluate(CYTHON_UNUSED struct __pyx_ob
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("evaluate", 0);
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":192
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":192
*
* def evaluate(self, hyp, refs):
* return [] # <<<<<<<<<<<<<<
@@ -28849,7 +28849,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__utf8));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2));
- /* "/home/vchahune/tools/cdec/python/src/vectors.pxi":95
+ /* "/home/pauldb/workspace/cdec/python/src/vectors.pxi":95
* elif op == 3: # !=
* return not (x == y)
* raise NotImplemented('comparison not implemented for SparseVector') # <<<<<<<<<<<<<<
@@ -28863,7 +28863,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5));
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":6
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":6
*
* def _phrase(phrase):
* return ' '.join(w.encode('utf8') if isinstance(w, unicode) else str(w) for w in phrase) # <<<<<<<<<<<<<<
@@ -28877,7 +28877,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__utf8));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6));
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":226
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":226
* trule = convert_rule(trule)
* elif not isinstance(trule, TRule):
* raise ValueError('the grammar should contain TRule objects') # <<<<<<<<<<<<<<
@@ -28890,7 +28890,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_13));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_14));
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":244
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":244
* elif op == 3: # !=
* return not (x == y)
* raise NotImplemented('comparison not implemented for HypergraphEdge') # <<<<<<<<<<<<<<
@@ -28904,7 +28904,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19));
- /* "/home/vchahune/tools/cdec/python/src/hypergraph.pxi":281
+ /* "/home/pauldb/workspace/cdec/python/src/hypergraph.pxi":281
* elif op == 3: # !=
* return not (x == y)
* raise NotImplemented('comparison not implemented for HypergraphNode') # <<<<<<<<<<<<<<
@@ -28916,7 +28916,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_20));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_21));
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":26
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":26
* def __getitem__(self, int index):
* if not 0 <= index < len(self):
* raise IndexError('lattice index out of range') # <<<<<<<<<<<<<<
@@ -28930,7 +28930,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_23));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24));
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":39
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":39
* def __setitem__(self, int index, tuple arcs):
* if not 0 <= index < len(self):
* raise IndexError('lattice index out of range') # <<<<<<<<<<<<<<
@@ -28944,7 +28944,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_23));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_25));
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":69
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":69
* for i in range(len(self)):
* for label, weight, delta in self[i]:
* yield '%d -> %d [label="%s"];' % (i, i+delta, label.replace('"', '\\"')) # <<<<<<<<<<<<<<
@@ -28961,7 +28961,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_31));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_32));
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":63
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":63
* def todot(self):
* """lattice.todot() -> Representation of the lattice in GraphViz dot format."""
* def lines(): # <<<<<<<<<<<<<<
@@ -28985,7 +28985,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_35));
__pyx_k_codeobj_36 = (PyObject*)__Pyx_PyCode_New(0, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_37, __pyx_n_s__lines, 63, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_36)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/vchahune/tools/cdec/python/src/lattice.pxi":72
+ /* "/home/pauldb/workspace/cdec/python/src/lattice.pxi":72
* yield '%d [shape=doublecircle]' % len(self)
* yield '}'
* return '\n'.join(lines()).encode('utf8') # <<<<<<<<<<<<<<
@@ -28999,7 +28999,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__utf8));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_39));
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":50
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":50
* def __getitem__(self, int index):
* if not 0 <= index < len(self):
* raise IndexError('sufficient stats vector index out of range') # <<<<<<<<<<<<<<
@@ -29013,7 +29013,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_40));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_41));
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":84
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":84
* def __getitem__(self,int k):
* if not 0 <= k < self.cs.size():
* raise IndexError('candidate set index out of range') # <<<<<<<<<<<<<<
@@ -29078,7 +29078,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(Py_None);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_51));
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":5
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":5
* import cdec.sa._sa as _sa
*
* def _phrase(phrase): # <<<<<<<<<<<<<<
@@ -29099,7 +29099,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_55));
__pyx_k_codeobj_56 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_57, __pyx_n_s___phrase, 5, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_56)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":194
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":194
* return []
*
* BLEU = Scorer('IBM_BLEU') # <<<<<<<<<<<<<<
@@ -29113,7 +29113,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__IBM_BLEU));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_58));
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":195
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":195
*
* BLEU = Scorer('IBM_BLEU')
* TER = Scorer('TER') # <<<<<<<<<<<<<<
@@ -29126,7 +29126,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__TER));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_59));
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":196
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":196
* BLEU = Scorer('IBM_BLEU')
* TER = Scorer('TER')
* CER = Scorer('CER') # <<<<<<<<<<<<<<
@@ -29491,7 +29491,7 @@ PyMODINIT_FUNC PyInit__cdec(void)
Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/*--- Execution code ---*/
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":3
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":3
* cimport grammar
* cimport cdec.sa._sa as _sa
* import cdec.sa._sa as _sa # <<<<<<<<<<<<<<
@@ -29509,7 +29509,7 @@ PyMODINIT_FUNC PyInit__cdec(void)
if (PyObject_SetAttr(__pyx_m, __pyx_n_s___sa, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/vchahune/tools/cdec/python/src/grammar.pxi":5
+ /* "/home/pauldb/workspace/cdec/python/src/grammar.pxi":5
* import cdec.sa._sa as _sa
*
* def _phrase(phrase): # <<<<<<<<<<<<<<
@@ -29521,7 +29521,7 @@ PyMODINIT_FUNC PyInit__cdec(void)
if (PyObject_SetAttr(__pyx_m, __pyx_n_s___phrase, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":194
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":194
* return []
*
* BLEU = Scorer('IBM_BLEU') # <<<<<<<<<<<<<<
@@ -29533,7 +29533,7 @@ PyMODINIT_FUNC PyInit__cdec(void)
if (PyObject_SetAttr(__pyx_m, __pyx_n_s__BLEU, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":195
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":195
*
* BLEU = Scorer('IBM_BLEU')
* TER = Scorer('TER') # <<<<<<<<<<<<<<
@@ -29544,7 +29544,7 @@ PyMODINIT_FUNC PyInit__cdec(void)
if (PyObject_SetAttr(__pyx_m, __pyx_n_s__TER, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/vchahune/tools/cdec/python/src/mteval.pxi":196
+ /* "/home/pauldb/workspace/cdec/python/src/mteval.pxi":196
* BLEU = Scorer('IBM_BLEU')
* TER = Scorer('TER')
* CER = Scorer('CER') # <<<<<<<<<<<<<<
diff --git a/python/src/sa/_sa.c b/python/src/sa/_sa.c
index 89445b45..17957593 100644
--- a/python/src/sa/_sa.c
+++ b/python/src/sa/_sa.c
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.17.1 on Mon Jan 28 14:28:01 2013 */
+/* Generated by Cython 0.17.1 on Thu Feb 21 14:13:02 2013 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
@@ -420,7 +420,7 @@ struct __pyx_t_3_sa__Trie_Node;
struct __pyx_t_3_sa_match_node;
struct __pyx_t_3_sa_Matching;
-/* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":9
+/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":9
* from libc.string cimport memset, strcpy
*
* cdef struct _node: # <<<<<<<<<<<<<<
@@ -434,7 +434,7 @@ struct __pyx_t_3_sa__node {
int val;
};
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":30
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":30
* _init_lower_mask()
*
* cdef struct _BitSet: # <<<<<<<<<<<<<<
@@ -448,7 +448,7 @@ struct __pyx_t_3_sa__BitSet {
int size;
};
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":168
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":168
* return result
*
* cdef struct _VEB: # <<<<<<<<<<<<<<
@@ -465,7 +465,7 @@ struct __pyx_t_3_sa__VEB {
void **bottom;
};
-/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":10
+/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":10
* cdef struct _Trie_Node # forward decl
*
* cdef struct _Trie_Edge: # <<<<<<<<<<<<<<
@@ -479,7 +479,7 @@ struct __pyx_t_3_sa__Trie_Edge {
struct __pyx_t_3_sa__Trie_Edge *smaller;
};
-/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":8
+/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":8
* from libc.string cimport memset, memcpy
*
* cdef struct _Trie_Node # forward decl # <<<<<<<<<<<<<<
@@ -492,7 +492,7 @@ struct __pyx_t_3_sa__Trie_Node {
int arr_len;
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":76
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":76
*
* # linked list structure for storing matches in BaselineRuleFactory
* cdef struct match_node: # <<<<<<<<<<<<<<
@@ -504,7 +504,7 @@ struct __pyx_t_3_sa_match_node {
struct __pyx_t_3_sa_match_node *next;
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":172
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":172
*
* # struct used to encapsulate a single matching
* cdef struct Matching: # <<<<<<<<<<<<<<
@@ -519,7 +519,7 @@ struct __pyx_t_3_sa_Matching {
int size;
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":228
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":228
*
*
* cdef class HieroCachingRuleFactory: # <<<<<<<<<<<<<<
@@ -554,6 +554,7 @@ struct __pyx_obj_3_sa_HieroCachingRuleFactory {
float by_slack_factor;
PyObject *prev_norm_prefix;
float extract_time;
+ float intersect_time;
struct __pyx_obj_3_sa_SuffixArray *fsa;
struct __pyx_obj_3_sa_DataArray *fda;
struct __pyx_obj_3_sa_DataArray *eda;
@@ -577,7 +578,7 @@ struct __pyx_obj_3_sa_HieroCachingRuleFactory {
};
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":118
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":118
* for arc in node for node in lattice)
*
* def decode_sentence(lattice): # <<<<<<<<<<<<<<
@@ -590,7 +591,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_9_decode_sentence {
};
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":187
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":187
* fields = [sym_tostring(self.lhs), str(self.f), str(self.e), str(self.scores)]
* if self.word_alignments is not None:
* fields.append(' '.join('%d-%d' % a for a in self.alignments())) # <<<<<<<<<<<<<<
@@ -607,7 +608,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_17_genexpr {
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1182
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1187
* # Online rule extraction and scoring
* if self.online:
* f_syms = tuple(word[0][0] for word in fwords) # <<<<<<<<<<<<<<
@@ -624,7 +625,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_20_genexpr {
};
-/* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":36
+/* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":36
* logger.info("LCP array completed")
*
* def compute_stats(self, int max_n): # <<<<<<<<<<<<<<
@@ -655,7 +656,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_3_compute_stats {
};
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":122
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":122
*
* def encode_words(words):
* return tuple(sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<<
@@ -672,7 +673,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_12_genexpr {
};
-/* "/home/m/workspace/cdec/python/src/sa/features.pxi":21
+/* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":21
*
* def __str__(self):
* return ' '.join('%s=%s' % feat for feat in self) # <<<<<<<<<<<<<<
@@ -706,7 +707,7 @@ struct __pyx_obj_3_sa_IntList {
};
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":340
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":340
*
*
* cdef class VEBIterator: # <<<<<<<<<<<<<<
@@ -720,7 +721,7 @@ struct __pyx_obj_3_sa_VEBIterator {
};
-/* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":47
+/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":47
*
*
* cdef class BiLex: # <<<<<<<<<<<<<<
@@ -741,7 +742,7 @@ struct __pyx_obj_3_sa_BiLex {
};
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":354
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":354
*
*
* cdef class VEB: # <<<<<<<<<<<<<<
@@ -755,7 +756,7 @@ struct __pyx_obj_3_sa_VEB {
};
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":121
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":121
* return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice)
*
* def encode_words(words): # <<<<<<<<<<<<<<
@@ -768,7 +769,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_11_encode_words {
};
-/* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":5
+/* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":5
* as k most frequent n-grams"""
*
* cdef class LCP: # <<<<<<<<<<<<<<
@@ -782,7 +783,7 @@ struct __pyx_obj_3_sa_LCP {
};
-/* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":9
+/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":9
* from libc.string cimport memset, strcpy
*
* cdef class DataArray: # <<<<<<<<<<<<<<
@@ -801,7 +802,7 @@ struct __pyx_obj_3_sa_DataArray {
};
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":100
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":100
*
*
* cdef class BitSetIterator: # <<<<<<<<<<<<<<
@@ -815,7 +816,7 @@ struct __pyx_obj_3_sa_BitSetIterator {
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2110
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2115
* f = Phrase(f_sym)
* e = Phrase(e_sym)
* a = tuple(self.alignment.link(i, j) for (i, j) in links) # <<<<<<<<<<<<<<
@@ -833,7 +834,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_23_genexpr {
};
-/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":188
+/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":188
*
*
* cdef class Precomputation: # <<<<<<<<<<<<<<
@@ -854,7 +855,7 @@ struct __pyx_obj_3_sa_Precomputation {
};
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":190
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":190
* return ' ||| '.join(fields)
*
* def alignments(self): # <<<<<<<<<<<<<<
@@ -871,7 +872,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_18_alignments {
};
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":125
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":125
*
* def decode_words(syms):
* return tuple(sym_tostring(sym) for sym in syms) # <<<<<<<<<<<<<<
@@ -886,7 +887,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_14_genexpr {
};
-/* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":6
+/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":6
* from libc.stdio cimport FILE, fclose, fopen
*
* cdef class SuffixArray: # <<<<<<<<<<<<<<
@@ -902,7 +903,7 @@ struct __pyx_obj_3_sa_SuffixArray {
};
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":183
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":183
* return self.f.arity()
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -915,7 +916,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_16___str__ {
};
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":7
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":7
* cdef int INDEX_MASK = (1<<INDEX_SHIFT)-1
*
* cdef class Alphabet: # <<<<<<<<<<<<<<
@@ -951,7 +952,7 @@ struct __pyx_obj_3_sa_Rule {
};
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":112
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":112
* def make_lattice(words):
* word_ids = (sym_fromstring(word, True) for word in words)
* return tuple(((word, None, 1), ) for word in word_ids) # <<<<<<<<<<<<<<
@@ -968,7 +969,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_6_genexpr {
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1879
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1884
* # Aggregate stats from a training instance
* # (Extract rules, update counts)
* def add_instance(self, f_words, e_words, alignment): # <<<<<<<<<<<<<<
@@ -991,7 +992,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_21_add_instance {
};
-/* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":74
+/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":74
* def read_bitext(self, char* filename, int side):
* with gzip_or_text(filename) as fp:
* data = (line.split(' ||| ')[side] for line in fp) # <<<<<<<<<<<<<<
@@ -1008,7 +1009,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_2_genexpr {
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":84
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":84
* # in the suffix array; if discontiguous, it is the set of
* # actual locations (packed into an array)
* cdef class PhraseLocation: # <<<<<<<<<<<<<<
@@ -1027,7 +1028,7 @@ struct __pyx_obj_3_sa_PhraseLocation {
};
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":141
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":141
* return self.syms[i]
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -1042,7 +1043,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_15___iter__ {
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2049
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2054
*
* # Create a rule from source, target, non-terminals, and alignments
* def form_rule(self, f_i, e_i, f_span, e_span, nt, al): # <<<<<<<<<<<<<<
@@ -1056,7 +1057,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_22_form_rule {
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2115
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2120
* # Rule string from rule
* def fmt_rule(self, f, e, a):
* a_str = ' '.join('{0}-{1}'.format(*self.alignment.unlink(packed)) for packed in a) # <<<<<<<<<<<<<<
@@ -1073,7 +1074,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_25_genexpr {
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2114
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2119
*
* # Rule string from rule
* def fmt_rule(self, f, e, a): # <<<<<<<<<<<<<<
@@ -1087,7 +1088,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_24_fmt_rule {
};
-/* "/home/m/workspace/cdec/python/src/sa/features.pxi":20
+/* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":20
* yield (FD.word(self.names[i]), self.values[i])
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -1100,7 +1101,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_28___str__ {
};
-/* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":72
+/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":72
* self.read_text_data(fp)
*
* def read_bitext(self, char* filename, int side): # <<<<<<<<<<<<<<
@@ -1114,7 +1115,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_1_read_bitext {
};
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":124
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":124
* return tuple(sym_fromstring(word, True) for word in words)
*
* def decode_words(syms): # <<<<<<<<<<<<<<
@@ -1140,7 +1141,7 @@ struct __pyx_obj_3_sa_FeatureVector {
};
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":114
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":114
* return tuple(((word, None, 1), ) for word in word_ids)
*
* def decode_lattice(lattice): # <<<<<<<<<<<<<<
@@ -1153,7 +1154,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_7_decode_lattice {
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":972
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":973
* return sorted(result);
*
* def input(self, fwords, meta): # <<<<<<<<<<<<<<
@@ -1189,6 +1190,8 @@ struct __pyx_obj_3_sa___pyx_scope_struct_19_input {
long __pyx_v_hit;
int __pyx_v_i;
PyObject *__pyx_v_input_match;
+ PyObject *__pyx_v_intersect_start_time;
+ PyObject *__pyx_v_intersect_stop_time;
PyObject *__pyx_v_is_shadow_path;
int __pyx_v_j;
int __pyx_v_k;
@@ -1232,9 +1235,9 @@ struct __pyx_obj_3_sa___pyx_scope_struct_19_input {
PyObject *__pyx_v_xnode;
PyObject *__pyx_v_xroot;
Py_ssize_t __pyx_t_0;
- PyObject *__pyx_t_1;
- Py_ssize_t __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3;
PyObject *__pyx_t_4;
PyObject *__pyx_t_5;
int __pyx_t_6;
@@ -1246,7 +1249,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_19_input {
};
-/* "/home/m/workspace/cdec/python/src/sa/features.pxi":23
+/* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":23
* return ' '.join('%s=%s' % feat for feat in self)
*
* cdef class Scorer: # <<<<<<<<<<<<<<
@@ -1260,7 +1263,7 @@ struct __pyx_obj_3_sa_Scorer {
};
-/* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":8
+/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":8
* # May need to revisit if things get really tight, though.
*
* cdef class Alignment: # <<<<<<<<<<<<<<
@@ -1275,7 +1278,7 @@ struct __pyx_obj_3_sa_Alignment {
};
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":118
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":118
* # (entirely C-implemented) _BitSet struct.
* # Very slow; use only for debugging
* cdef class BitSet: # <<<<<<<<<<<<<<
@@ -1288,7 +1291,7 @@ struct __pyx_obj_3_sa_BitSet {
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":106
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":106
*
*
* cdef class Sampler: # <<<<<<<<<<<<<<
@@ -1302,7 +1305,7 @@ struct __pyx_obj_3_sa_Sampler {
};
-/* "/home/m/workspace/cdec/python/src/sa/str_map.pxi":8
+/* "/home/pauldb/workspace/cdec/python/src/sa/str_map.pxi":8
* char* stringmap_word(StrMap *vocab, int i)
*
* cdef class StringMap: # <<<<<<<<<<<<<<
@@ -1316,7 +1319,7 @@ struct __pyx_obj_3_sa_StringMap {
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2161
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2166
* # (Used for EGivenFCoherent)
* # Return set of (fphrase, lex_i, lex_j)
* def get_f_phrases(self, f_words): # <<<<<<<<<<<<<<
@@ -1333,7 +1336,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_26_get_f_phrases {
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":46
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":46
* cdef int EPSILON = sym_fromstring('*EPS*', True)
*
* cdef class TrieNode: # <<<<<<<<<<<<<<
@@ -1346,7 +1349,7 @@ struct __pyx_obj_3_sa_TrieNode {
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":52
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":52
* self.children = {}
*
* cdef class ExtendedTrieNode(TrieNode): # <<<<<<<<<<<<<<
@@ -1361,7 +1364,7 @@ struct __pyx_obj_3_sa_ExtendedTrieNode {
};
-/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":109
+/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":109
* trie_node_to_map(edge.node, result, prefix, include_zeros)
*
* cdef class TrieMap: # <<<<<<<<<<<<<<
@@ -1376,7 +1379,7 @@ struct __pyx_obj_3_sa_TrieMap {
};
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":115
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":115
*
* def decode_lattice(lattice):
* return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<<
@@ -1403,7 +1406,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_8_genexpr {
};
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":110
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":110
* return sym_isvar(sym)
*
* def make_lattice(words): # <<<<<<<<<<<<<<
@@ -1434,7 +1437,7 @@ struct __pyx_obj_3_sa_Phrase {
};
-/* "/home/m/workspace/cdec/python/src/sa/features.pxi":15
+/* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":15
* self.values.append(value)
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -1450,7 +1453,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_27___iter__ {
};
-/* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":81
+/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":81
* free(self.arr)
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -1466,7 +1469,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct____iter__ {
};
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":63
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":63
*
*
* cdef class TrieTable: # <<<<<<<<<<<<<<
@@ -1481,7 +1484,7 @@ struct __pyx_obj_3_sa_TrieTable {
};
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":111
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":111
*
* def make_lattice(words):
* word_ids = (sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<<
@@ -1498,7 +1501,7 @@ struct __pyx_obj_3_sa___pyx_scope_struct_5_genexpr {
};
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":119
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":119
*
* def decode_sentence(lattice):
* return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice) # <<<<<<<<<<<<<<
@@ -1534,7 +1537,7 @@ struct __pyx_obj_3_sa_FloatList {
-/* "/home/m/workspace/cdec/python/src/sa/str_map.pxi":8
+/* "/home/pauldb/workspace/cdec/python/src/sa/str_map.pxi":8
* char* stringmap_word(StrMap *vocab, int i)
*
* cdef class StringMap: # <<<<<<<<<<<<<<
@@ -1549,7 +1552,7 @@ struct __pyx_vtabstruct_3_sa_StringMap {
static struct __pyx_vtabstruct_3_sa_StringMap *__pyx_vtabptr_3_sa_StringMap;
-/* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":9
+/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":9
* from libc.string cimport memset, strcpy
*
* cdef class DataArray: # <<<<<<<<<<<<<<
@@ -1564,7 +1567,7 @@ struct __pyx_vtabstruct_3_sa_DataArray {
static struct __pyx_vtabstruct_3_sa_DataArray *__pyx_vtabptr_3_sa_DataArray;
-/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":109
+/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":109
* trie_node_to_map(edge.node, result, prefix, include_zeros)
*
* cdef class TrieMap: # <<<<<<<<<<<<<<
@@ -1579,7 +1582,7 @@ struct __pyx_vtabstruct_3_sa_TrieMap {
static struct __pyx_vtabstruct_3_sa_TrieMap *__pyx_vtabptr_3_sa_TrieMap;
-/* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":8
+/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":8
* # May need to revisit if things get really tight, though.
*
* cdef class Alignment: # <<<<<<<<<<<<<<
@@ -1595,7 +1598,7 @@ struct __pyx_vtabstruct_3_sa_Alignment {
static struct __pyx_vtabstruct_3_sa_Alignment *__pyx_vtabptr_3_sa_Alignment;
-/* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":47
+/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":47
*
*
* cdef class BiLex: # <<<<<<<<<<<<<<
@@ -1614,7 +1617,7 @@ struct __pyx_vtabstruct_3_sa_BiLex {
static struct __pyx_vtabstruct_3_sa_BiLex *__pyx_vtabptr_3_sa_BiLex;
-/* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":9
+/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":9
* from libc.string cimport memset, memcpy
*
* cdef class IntList: # <<<<<<<<<<<<<<
@@ -1634,7 +1637,7 @@ struct __pyx_vtabstruct_3_sa_IntList {
static struct __pyx_vtabstruct_3_sa_IntList *__pyx_vtabptr_3_sa_IntList;
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":4
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":4
* from libc.string cimport strsep, strcpy, strlen
*
* cdef class Phrase: # <<<<<<<<<<<<<<
@@ -1649,7 +1652,7 @@ struct __pyx_vtabstruct_3_sa_Phrase {
static struct __pyx_vtabstruct_3_sa_Phrase *__pyx_vtabptr_3_sa_Phrase;
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":84
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":84
* # in the suffix array; if discontiguous, it is the set of
* # actual locations (packed into an array)
* cdef class PhraseLocation: # <<<<<<<<<<<<<<
@@ -1663,7 +1666,7 @@ struct __pyx_vtabstruct_3_sa_PhraseLocation {
static struct __pyx_vtabstruct_3_sa_PhraseLocation *__pyx_vtabptr_3_sa_PhraseLocation;
-/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":188
+/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":188
*
*
* cdef class Precomputation: # <<<<<<<<<<<<<<
@@ -1678,7 +1681,7 @@ struct __pyx_vtabstruct_3_sa_Precomputation {
static struct __pyx_vtabstruct_3_sa_Precomputation *__pyx_vtabptr_3_sa_Precomputation;
-/* "/home/m/workspace/cdec/python/src/sa/features.pxi":23
+/* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":23
* return ' '.join('%s=%s' % feat for feat in self)
*
* cdef class Scorer: # <<<<<<<<<<<<<<
@@ -1692,7 +1695,7 @@ struct __pyx_vtabstruct_3_sa_Scorer {
static struct __pyx_vtabstruct_3_sa_Scorer *__pyx_vtabptr_3_sa_Scorer;
-/* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":9
+/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":9
* from libc.string cimport memset, strcpy, strlen
*
* cdef class FloatList: # <<<<<<<<<<<<<<
@@ -1708,7 +1711,7 @@ struct __pyx_vtabstruct_3_sa_FloatList {
static struct __pyx_vtabstruct_3_sa_FloatList *__pyx_vtabptr_3_sa_FloatList;
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":354
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":354
*
*
* cdef class VEB: # <<<<<<<<<<<<<<
@@ -1724,7 +1727,7 @@ struct __pyx_vtabstruct_3_sa_VEB {
static struct __pyx_vtabstruct_3_sa_VEB *__pyx_vtabptr_3_sa_VEB;
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":7
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":7
* cdef int INDEX_MASK = (1<<INDEX_SHIFT)-1
*
* cdef class Alphabet: # <<<<<<<<<<<<<<
@@ -1747,7 +1750,7 @@ struct __pyx_vtabstruct_3_sa_Alphabet {
static struct __pyx_vtabstruct_3_sa_Alphabet *__pyx_vtabptr_3_sa_Alphabet;
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":228
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":228
*
*
* cdef class HieroCachingRuleFactory: # <<<<<<<<<<<<<<
@@ -1775,7 +1778,7 @@ struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory {
static struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *__pyx_vtabptr_3_sa_HieroCachingRuleFactory;
-/* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":6
+/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":6
* from libc.stdio cimport FILE, fclose, fopen
*
* cdef class SuffixArray: # <<<<<<<<<<<<<<
@@ -2447,7 +2450,6 @@ static struct __pyx_obj_3_sa_StringMap *__pyx_v_3_sa_FD = 0;
static char *__pyx_f_3_sa_sym_tostring(int); /*proto*/
static int __pyx_f_3_sa_sym_isvar(int); /*proto*/
static int __pyx_f_3_sa_sym_getindex(int); /*proto*/
-static float __pyx_f_3_sa_monitor_cpu(void); /*proto*/
static struct __pyx_t_3_sa__node *__pyx_f_3_sa_new_node(int); /*proto*/
static PyObject *__pyx_f_3_sa_del_node(struct __pyx_t_3_sa__node *); /*proto*/
static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *, int); /*proto*/
@@ -2494,7 +2496,8 @@ static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_cmp;
static PyObject *__pyx_builtin_sorted;
static PyObject *__pyx_builtin_max;
-static PyObject *__pyx_pf_3_sa_gzip_or_text(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_filename); /* proto */
+static PyObject *__pyx_pf_3_sa_monitor_cpu(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
+static PyObject *__pyx_pf_3_sa_2gzip_or_text(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_filename); /* proto */
static int __pyx_pf_3_sa_9FloatList___cinit__(struct __pyx_obj_3_sa_FloatList *__pyx_v_self, int __pyx_v_size, int __pyx_v_increment, int __pyx_v_initial_len); /* proto */
static void __pyx_pf_3_sa_9FloatList_2__dealloc__(struct __pyx_obj_3_sa_FloatList *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3_sa_9FloatList_4__getitem__(struct __pyx_obj_3_sa_FloatList *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
@@ -2596,18 +2599,18 @@ static int __pyx_pf_3_sa_8Alphabet___cinit__(struct __pyx_obj_3_sa_Alphabet *__p
static void __pyx_pf_3_sa_8Alphabet_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_3_sa_Alphabet *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3_sa_8Alphabet_9terminals___get__(struct __pyx_obj_3_sa_Alphabet *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3_sa_8Alphabet_12nonterminals___get__(struct __pyx_obj_3_sa_Alphabet *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_3_sa_2isvar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sym); /* proto */
+static PyObject *__pyx_pf_3_sa_4isvar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sym); /* proto */
static PyObject *__pyx_pf_3_sa_12make_lattice_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_3_sa_12make_lattice_3genexpr(PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_3_sa_4make_lattice(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_words); /* proto */
+static PyObject *__pyx_pf_3_sa_6make_lattice(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_words); /* proto */
static PyObject *__pyx_pf_3_sa_14decode_lattice_genexpr(PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_3_sa_6decode_lattice(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lattice); /* proto */
+static PyObject *__pyx_pf_3_sa_8decode_lattice(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lattice); /* proto */
static PyObject *__pyx_pf_3_sa_15decode_sentence_genexpr(PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_3_sa_8decode_sentence(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lattice); /* proto */
+static PyObject *__pyx_pf_3_sa_10decode_sentence(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lattice); /* proto */
static PyObject *__pyx_pf_3_sa_12encode_words_genexpr(PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_3_sa_10encode_words(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_words); /* proto */
+static PyObject *__pyx_pf_3_sa_12encode_words(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_words); /* proto */
static PyObject *__pyx_pf_3_sa_12decode_words_genexpr(PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_3_sa_12decode_words(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_syms); /* proto */
+static PyObject *__pyx_pf_3_sa_14decode_words(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_syms); /* proto */
static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, PyObject *__pyx_v_words); /* proto */
static void __pyx_pf_3_sa_6Phrase_2__dealloc__(struct __pyx_obj_3_sa_Phrase *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3_sa_6Phrase_4__str__(struct __pyx_obj_3_sa_Phrase *__pyx_v_self); /* proto */
@@ -2714,9 +2717,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_33dump_online_rules(str
static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_f, PyObject *__pyx_v_e); /* proto */
static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract(PyObject *__pyx_self, PyObject *__pyx_v_f_i, PyObject *__pyx_v_f_j, PyObject *__pyx_v_lex_i, PyObject *__pyx_v_lex_j, PyObject *__pyx_v_wc, PyObject *__pyx_v_ntc, PyObject *__pyx_v_syms); /* proto */
static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_37get_f_phrases(struct __pyx_obj_3_sa_HieroCachingRuleFactory *__pyx_v_self, PyObject *__pyx_v_f_words); /* proto */
-static PyObject *__pyx_pf_3_sa_14span_check(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vec, PyObject *__pyx_v_i, PyObject *__pyx_v_j); /* proto */
-static PyObject *__pyx_pf_3_sa_16span_inc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vec, PyObject *__pyx_v_i, PyObject *__pyx_v_j); /* proto */
-static PyObject *__pyx_pf_3_sa_18span_dec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vec, PyObject *__pyx_v_i, PyObject *__pyx_v_j); /* proto */
+static PyObject *__pyx_pf_3_sa_16span_check(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vec, PyObject *__pyx_v_i, PyObject *__pyx_v_j); /* proto */
+static PyObject *__pyx_pf_3_sa_18span_inc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vec, PyObject *__pyx_v_i, PyObject *__pyx_v_j); /* proto */
+static PyObject *__pyx_pf_3_sa_20span_dec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vec, PyObject *__pyx_v_i, PyObject *__pyx_v_j); /* proto */
static int __pyx_pf_3_sa_13FeatureVector___cinit__(struct __pyx_obj_3_sa_FeatureVector *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_3_sa_13FeatureVector_2set(struct __pyx_obj_3_sa_FeatureVector *__pyx_v_self, unsigned int __pyx_v_name, float __pyx_v_value); /* proto */
static PyObject *__pyx_pf_3_sa_13FeatureVector_4__iter__(struct __pyx_obj_3_sa_FeatureVector *__pyx_v_self); /* proto */
@@ -2813,26 +2816,27 @@ static char __pyx_k_121[] = "Keyword trie error";
static char __pyx_k_123[] = "get_all_nodes_isteps_away";
static char __pyx_k_124[] = "Total time for rule lookup, extraction, and scoring = %f seconds";
static char __pyx_k_125[] = " Extract time = %f seconds";
-static char __pyx_k_126[] = "No aligned terminals";
-static char __pyx_k_127[] = "Unaligned chunk";
-static char __pyx_k_128[] = "Gaps are not tight phrases";
-static char __pyx_k_129[] = "Inside edges of preceding subphrase are not tight";
-static char __pyx_k_130[] = "Inside edges of following subphrase are not tight";
-static char __pyx_k_131[] = "Subphrase [%d, %d] failed integrity check";
-static char __pyx_k_132[] = "Didn't extract anything from [%d, %d] -> [%d, %d]";
-static char __pyx_k_133[] = "Unable to extract basic phrase";
-static char __pyx_k_136[] = "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi";
-static char __pyx_k_137[] = "{0}-{1}";
-static char __pyx_k_138[] = "[X] ||| {0} ||| {1} ||| {2}";
-static char __pyx_k_139[] = "------------------------------";
-static char __pyx_k_141[] = " Online Stats ";
-static char __pyx_k_145[] = " : ";
-static char __pyx_k_151[] = "OnlineFeatureContext";
-static char __pyx_k_154[] = "%s=%s";
-static char __pyx_k_157[] = "/home/m/workspace/cdec/python/src/sa/_sa.pyx";
-static char __pyx_k_158[] = "cdec.sa";
-static char __pyx_k_162[] = "/home/m/workspace/cdec/python/src/sa/sym.pxi";
-static char __pyx_k_173[] = "*EPS*";
+static char __pyx_k_126[] = " Intersect time = %f seconds";
+static char __pyx_k_127[] = "No aligned terminals";
+static char __pyx_k_128[] = "Unaligned chunk";
+static char __pyx_k_129[] = "Gaps are not tight phrases";
+static char __pyx_k_130[] = "Inside edges of preceding subphrase are not tight";
+static char __pyx_k_131[] = "Inside edges of following subphrase are not tight";
+static char __pyx_k_132[] = "Subphrase [%d, %d] failed integrity check";
+static char __pyx_k_133[] = "Didn't extract anything from [%d, %d] -> [%d, %d]";
+static char __pyx_k_134[] = "Unable to extract basic phrase";
+static char __pyx_k_137[] = "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi";
+static char __pyx_k_138[] = "{0}-{1}";
+static char __pyx_k_139[] = "[X] ||| {0} ||| {1} ||| {2}";
+static char __pyx_k_140[] = "------------------------------";
+static char __pyx_k_142[] = " Online Stats ";
+static char __pyx_k_146[] = " : ";
+static char __pyx_k_152[] = "OnlineFeatureContext";
+static char __pyx_k_155[] = "%s=%s";
+static char __pyx_k_157[] = "/home/pauldb/workspace/cdec/python/src/sa/_sa.pyx";
+static char __pyx_k_160[] = "cdec.sa";
+static char __pyx_k_164[] = "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi";
+static char __pyx_k_175[] = "*EPS*";
static char __pyx_k__FE[] = "FE";
static char __pyx_k__al[] = "al";
static char __pyx_k__fe[] = "fe";
@@ -3026,6 +3030,7 @@ static char __pyx_k__defaultdict[] = "defaultdict";
static char __pyx_k__from_binary[] = "from_binary";
static char __pyx_k__initial_len[] = "initial_len";
static char __pyx_k__input_match[] = "input_match";
+static char __pyx_k__monitor_cpu[] = "monitor_cpu";
static char __pyx_k__next_states[] = "next_states";
static char __pyx_k__old_last_nt[] = "old_last_nt";
static char __pyx_k__precomputed[] = "precomputed";
@@ -3105,18 +3110,19 @@ static PyObject *__pyx_kp_s_130;
static PyObject *__pyx_kp_s_131;
static PyObject *__pyx_kp_s_132;
static PyObject *__pyx_kp_s_133;
-static PyObject *__pyx_kp_s_136;
+static PyObject *__pyx_kp_s_134;
static PyObject *__pyx_kp_s_137;
static PyObject *__pyx_kp_s_138;
static PyObject *__pyx_kp_s_139;
static PyObject *__pyx_kp_s_14;
-static PyObject *__pyx_kp_s_141;
-static PyObject *__pyx_kp_s_145;
-static PyObject *__pyx_n_s_151;
-static PyObject *__pyx_kp_s_154;
+static PyObject *__pyx_kp_s_140;
+static PyObject *__pyx_kp_s_142;
+static PyObject *__pyx_kp_s_146;
+static PyObject *__pyx_n_s_152;
+static PyObject *__pyx_kp_s_155;
static PyObject *__pyx_kp_s_157;
-static PyObject *__pyx_kp_s_158;
-static PyObject *__pyx_kp_s_162;
+static PyObject *__pyx_kp_s_160;
+static PyObject *__pyx_kp_s_164;
static PyObject *__pyx_kp_s_18;
static PyObject *__pyx_kp_s_2;
static PyObject *__pyx_kp_s_21;
@@ -3323,6 +3329,7 @@ static PyObject *__pyx_n_s__meta;
static PyObject *__pyx_n_s__min_bound;
static PyObject *__pyx_n_s__min_dist;
static PyObject *__pyx_n_s__min_gap_size;
+static PyObject *__pyx_n_s__monitor_cpu;
static PyObject *__pyx_n_s__name;
static PyObject *__pyx_n_s__namedtuple;
static PyObject *__pyx_n_s__new_e_i;
@@ -3479,57 +3486,69 @@ static PyObject *__pyx_k_tuple_98;
static PyObject *__pyx_k_tuple_102;
static PyObject *__pyx_k_tuple_107;
static PyObject *__pyx_k_tuple_122;
-static PyObject *__pyx_k_tuple_134;
-static PyObject *__pyx_k_tuple_140;
-static PyObject *__pyx_k_tuple_142;
+static PyObject *__pyx_k_tuple_135;
+static PyObject *__pyx_k_tuple_141;
static PyObject *__pyx_k_tuple_143;
static PyObject *__pyx_k_tuple_144;
-static PyObject *__pyx_k_tuple_146;
+static PyObject *__pyx_k_tuple_145;
static PyObject *__pyx_k_tuple_147;
static PyObject *__pyx_k_tuple_148;
static PyObject *__pyx_k_tuple_149;
static PyObject *__pyx_k_tuple_150;
-static PyObject *__pyx_k_tuple_152;
-static PyObject *__pyx_k_tuple_155;
-static PyObject *__pyx_k_tuple_159;
-static PyObject *__pyx_k_tuple_160;
-static PyObject *__pyx_k_tuple_163;
+static PyObject *__pyx_k_tuple_151;
+static PyObject *__pyx_k_tuple_153;
+static PyObject *__pyx_k_tuple_158;
+static PyObject *__pyx_k_tuple_161;
+static PyObject *__pyx_k_tuple_162;
static PyObject *__pyx_k_tuple_165;
static PyObject *__pyx_k_tuple_167;
static PyObject *__pyx_k_tuple_169;
static PyObject *__pyx_k_tuple_171;
-static PyObject *__pyx_k_tuple_174;
+static PyObject *__pyx_k_tuple_173;
static PyObject *__pyx_k_tuple_176;
static PyObject *__pyx_k_tuple_178;
-static PyObject *__pyx_k_codeobj_135;
-static PyObject *__pyx_k_codeobj_153;
+static PyObject *__pyx_k_tuple_180;
+static PyObject *__pyx_k_codeobj_136;
+static PyObject *__pyx_k_codeobj_154;
static PyObject *__pyx_k_codeobj_156;
-static PyObject *__pyx_k_codeobj_161;
-static PyObject *__pyx_k_codeobj_164;
+static PyObject *__pyx_k_codeobj_159;
+static PyObject *__pyx_k_codeobj_163;
static PyObject *__pyx_k_codeobj_166;
static PyObject *__pyx_k_codeobj_168;
static PyObject *__pyx_k_codeobj_170;
static PyObject *__pyx_k_codeobj_172;
-static PyObject *__pyx_k_codeobj_175;
+static PyObject *__pyx_k_codeobj_174;
static PyObject *__pyx_k_codeobj_177;
static PyObject *__pyx_k_codeobj_179;
+static PyObject *__pyx_k_codeobj_181;
+
+/* Python wrapper */
+static PyObject *__pyx_pw_3_sa_1monitor_cpu(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_3_sa_1monitor_cpu = {__Pyx_NAMESTR("monitor_cpu"), (PyCFunction)__pyx_pw_3_sa_1monitor_cpu, METH_NOARGS, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pw_3_sa_1monitor_cpu(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("monitor_cpu (wrapper)", 0);
+ __pyx_r = __pyx_pf_3_sa_monitor_cpu(__pyx_self);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
/* "_sa.pyx":5
* import gzip
*
- * cdef float monitor_cpu(): # <<<<<<<<<<<<<<
+ * def monitor_cpu(): # <<<<<<<<<<<<<<
* return (resource.getrusage(resource.RUSAGE_SELF).ru_utime+
* resource.getrusage(resource.RUSAGE_SELF).ru_stime)
*/
-static float __pyx_f_3_sa_monitor_cpu(void) {
- float __pyx_r;
+static PyObject *__pyx_pf_3_sa_monitor_cpu(CYTHON_UNUSED PyObject *__pyx_self) {
+ PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
- float __pyx_t_5;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
@@ -3537,11 +3556,12 @@ static float __pyx_f_3_sa_monitor_cpu(void) {
/* "_sa.pyx":6
*
- * cdef float monitor_cpu():
+ * def monitor_cpu():
* return (resource.getrusage(resource.RUSAGE_SELF).ru_utime+ # <<<<<<<<<<<<<<
* resource.getrusage(resource.RUSAGE_SELF).ru_stime)
*
*/
+ __Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__resource); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__getrusage); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -3566,7 +3586,7 @@ static float __pyx_f_3_sa_monitor_cpu(void) {
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
/* "_sa.pyx":7
- * cdef float monitor_cpu():
+ * def monitor_cpu():
* return (resource.getrusage(resource.RUSAGE_SELF).ru_utime+
* resource.getrusage(resource.RUSAGE_SELF).ru_stime) # <<<<<<<<<<<<<<
*
@@ -3598,29 +3618,29 @@ static float __pyx_f_3_sa_monitor_cpu(void) {
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_r = __pyx_t_5;
+ __pyx_r = __pyx_t_4;
+ __pyx_t_4 = 0;
goto __pyx_L0;
- __pyx_r = 0;
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
- __Pyx_WriteUnraisable("_sa.monitor_cpu", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
+ __Pyx_AddTraceback("_sa.monitor_cpu", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
__pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_1gzip_or_text(PyObject *__pyx_self, PyObject *__pyx_arg_filename); /*proto*/
-static PyMethodDef __pyx_mdef_3_sa_1gzip_or_text = {__Pyx_NAMESTR("gzip_or_text"), (PyCFunction)__pyx_pw_3_sa_1gzip_or_text, METH_O, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_3_sa_1gzip_or_text(PyObject *__pyx_self, PyObject *__pyx_arg_filename) {
+static PyObject *__pyx_pw_3_sa_3gzip_or_text(PyObject *__pyx_self, PyObject *__pyx_arg_filename); /*proto*/
+static PyMethodDef __pyx_mdef_3_sa_3gzip_or_text = {__Pyx_NAMESTR("gzip_or_text"), (PyCFunction)__pyx_pw_3_sa_3gzip_or_text, METH_O, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pw_3_sa_3gzip_or_text(PyObject *__pyx_self, PyObject *__pyx_arg_filename) {
char *__pyx_v_filename;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
@@ -3634,7 +3654,7 @@ static PyObject *__pyx_pw_3_sa_1gzip_or_text(PyObject *__pyx_self, PyObject *__p
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_3_sa_gzip_or_text(__pyx_self, ((char *)__pyx_v_filename));
+ __pyx_r = __pyx_pf_3_sa_2gzip_or_text(__pyx_self, ((char *)__pyx_v_filename));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
@@ -3647,7 +3667,7 @@ static PyObject *__pyx_pw_3_sa_1gzip_or_text(PyObject *__pyx_self, PyObject *__p
* return gzip.GzipFile(filename)
*/
-static PyObject *__pyx_pf_3_sa_gzip_or_text(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_filename) {
+static PyObject *__pyx_pf_3_sa_2gzip_or_text(CYTHON_UNUSED PyObject *__pyx_self, char *__pyx_v_filename) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -3822,7 +3842,7 @@ static int __pyx_pw_3_sa_9FloatList_1__cinit__(PyObject *__pyx_v_self, PyObject
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":11
+/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":11
* cdef class FloatList:
*
* def __cinit__(self, int size=0, int increment=1, int initial_len=0): # <<<<<<<<<<<<<<
@@ -3836,7 +3856,7 @@ static int __pyx_pf_3_sa_9FloatList___cinit__(struct __pyx_obj_3_sa_FloatList *_
int __pyx_t_1;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":12
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":12
*
* def __cinit__(self, int size=0, int increment=1, int initial_len=0):
* if initial_len > size: # <<<<<<<<<<<<<<
@@ -3846,7 +3866,7 @@ static int __pyx_pf_3_sa_9FloatList___cinit__(struct __pyx_obj_3_sa_FloatList *_
__pyx_t_1 = (__pyx_v_initial_len > __pyx_v_size);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":13
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":13
* def __cinit__(self, int size=0, int increment=1, int initial_len=0):
* if initial_len > size:
* size = initial_len # <<<<<<<<<<<<<<
@@ -3858,7 +3878,7 @@ static int __pyx_pf_3_sa_9FloatList___cinit__(struct __pyx_obj_3_sa_FloatList *_
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":14
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":14
* if initial_len > size:
* size = initial_len
* self.size = size # <<<<<<<<<<<<<<
@@ -3867,7 +3887,7 @@ static int __pyx_pf_3_sa_9FloatList___cinit__(struct __pyx_obj_3_sa_FloatList *_
*/
__pyx_v_self->size = __pyx_v_size;
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":15
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":15
* size = initial_len
* self.size = size
* self.increment = increment # <<<<<<<<<<<<<<
@@ -3876,7 +3896,7 @@ static int __pyx_pf_3_sa_9FloatList___cinit__(struct __pyx_obj_3_sa_FloatList *_
*/
__pyx_v_self->increment = __pyx_v_increment;
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":16
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":16
* self.size = size
* self.increment = increment
* self.len = initial_len # <<<<<<<<<<<<<<
@@ -3885,7 +3905,7 @@ static int __pyx_pf_3_sa_9FloatList___cinit__(struct __pyx_obj_3_sa_FloatList *_
*/
__pyx_v_self->len = __pyx_v_initial_len;
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":17
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":17
* self.increment = increment
* self.len = initial_len
* self.arr = <float*> malloc(size*sizeof(float)) # <<<<<<<<<<<<<<
@@ -3894,7 +3914,7 @@ static int __pyx_pf_3_sa_9FloatList___cinit__(struct __pyx_obj_3_sa_FloatList *_
*/
__pyx_v_self->arr = ((float *)malloc((__pyx_v_size * (sizeof(float)))));
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":18
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":18
* self.len = initial_len
* self.arr = <float*> malloc(size*sizeof(float))
* memset(self.arr, 0, initial_len*sizeof(float)) # <<<<<<<<<<<<<<
@@ -3917,7 +3937,7 @@ static void __pyx_pw_3_sa_9FloatList_3__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyFinishContext();
}
-/* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":20
+/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":20
* memset(self.arr, 0, initial_len*sizeof(float))
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -3929,7 +3949,7 @@ static void __pyx_pf_3_sa_9FloatList_2__dealloc__(struct __pyx_obj_3_sa_FloatLis
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":21
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":21
*
* def __dealloc__(self):
* free(self.arr) # <<<<<<<<<<<<<<
@@ -3952,7 +3972,7 @@ static PyObject *__pyx_pw_3_sa_9FloatList_5__getitem__(PyObject *__pyx_v_self, P
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":23
+/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":23
* free(self.arr)
*
* def __getitem__(self, i): # <<<<<<<<<<<<<<
@@ -3975,7 +3995,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_4__getitem__(struct __pyx_obj_3_sa_Flo
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getitem__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":24
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":24
*
* def __getitem__(self, i):
* j = i # <<<<<<<<<<<<<<
@@ -3985,7 +4005,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_4__getitem__(struct __pyx_obj_3_sa_Flo
__Pyx_INCREF(__pyx_v_i);
__pyx_v_j = __pyx_v_i;
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":25
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":25
* def __getitem__(self, i):
* j = i
* if i<0: # <<<<<<<<<<<<<<
@@ -3997,7 +4017,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_4__getitem__(struct __pyx_obj_3_sa_Flo
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":26
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":26
* j = i
* if i<0:
* j = self.len + i # <<<<<<<<<<<<<<
@@ -4016,7 +4036,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_4__getitem__(struct __pyx_obj_3_sa_Flo
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":27
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":27
* if i<0:
* j = self.len + i
* if j<0 or j>=self.len: # <<<<<<<<<<<<<<
@@ -4039,7 +4059,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_4__getitem__(struct __pyx_obj_3_sa_Flo
}
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":28
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":28
* j = self.len + i
* if j<0 or j>=self.len:
* raise IndexError("Requested index %d of %d-length FloatList" % (i, self.len)) # <<<<<<<<<<<<<<
@@ -4074,7 +4094,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_4__getitem__(struct __pyx_obj_3_sa_Flo
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":29
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":29
* if j<0 or j>=self.len:
* raise IndexError("Requested index %d of %d-length FloatList" % (i, self.len))
* return self.arr[j] # <<<<<<<<<<<<<<
@@ -4103,7 +4123,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_4__getitem__(struct __pyx_obj_3_sa_Flo
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":31
+/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":31
* return self.arr[j]
*
* cdef void set(self, int i, float v): # <<<<<<<<<<<<<<
@@ -4125,7 +4145,7 @@ static void __pyx_f_3_sa_9FloatList_set(struct __pyx_obj_3_sa_FloatList *__pyx_v
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set", 0);
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":32
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":32
*
* cdef void set(self, int i, float v):
* j = i # <<<<<<<<<<<<<<
@@ -4134,7 +4154,7 @@ static void __pyx_f_3_sa_9FloatList_set(struct __pyx_obj_3_sa_FloatList *__pyx_v
*/
__pyx_v_j = __pyx_v_i;
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":33
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":33
* cdef void set(self, int i, float v):
* j = i
* if i<0: # <<<<<<<<<<<<<<
@@ -4144,7 +4164,7 @@ static void __pyx_f_3_sa_9FloatList_set(struct __pyx_obj_3_sa_FloatList *__pyx_v
__pyx_t_1 = (__pyx_v_i < 0);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":34
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":34
* j = i
* if i<0:
* j = self.len + i # <<<<<<<<<<<<<<
@@ -4156,7 +4176,7 @@ static void __pyx_f_3_sa_9FloatList_set(struct __pyx_obj_3_sa_FloatList *__pyx_v
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":35
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":35
* if i<0:
* j = self.len + i
* if j<0 or j>=self.len: # <<<<<<<<<<<<<<
@@ -4172,7 +4192,7 @@ static void __pyx_f_3_sa_9FloatList_set(struct __pyx_obj_3_sa_FloatList *__pyx_v
}
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":36
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":36
* j = self.len + i
* if j<0 or j>=self.len:
* raise IndexError("Requested index %d of %d-length FloatList" % (i, self.len)) # <<<<<<<<<<<<<<
@@ -4209,7 +4229,7 @@ static void __pyx_f_3_sa_9FloatList_set(struct __pyx_obj_3_sa_FloatList *__pyx_v
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":37
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":37
* if j<0 or j>=self.len:
* raise IndexError("Requested index %d of %d-length FloatList" % (i, self.len))
* self.arr[j] = v # <<<<<<<<<<<<<<
@@ -4239,7 +4259,7 @@ static int __pyx_pw_3_sa_9FloatList_7__setitem__(PyObject *__pyx_v_self, PyObjec
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":39
+/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":39
* self.arr[j] = v
*
* def __setitem__(self, i, val): # <<<<<<<<<<<<<<
@@ -4257,7 +4277,7 @@ static int __pyx_pf_3_sa_9FloatList_6__setitem__(struct __pyx_obj_3_sa_FloatList
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__setitem__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":40
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":40
*
* def __setitem__(self, i, val):
* self.set(i, val) # <<<<<<<<<<<<<<
@@ -4289,7 +4309,7 @@ static Py_ssize_t __pyx_pw_3_sa_9FloatList_9__len__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":42
+/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":42
* self.set(i, val)
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -4302,7 +4322,7 @@ static Py_ssize_t __pyx_pf_3_sa_9FloatList_8__len__(struct __pyx_obj_3_sa_FloatL
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":43
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":43
*
* def __len__(self):
* return self.len # <<<<<<<<<<<<<<
@@ -4339,7 +4359,7 @@ static PyObject *__pyx_pw_3_sa_9FloatList_11append(PyObject *__pyx_v_self, PyObj
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":45
+/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":45
* return self.len
*
* def append(self, float val): # <<<<<<<<<<<<<<
@@ -4353,7 +4373,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_10append(struct __pyx_obj_3_sa_FloatLi
int __pyx_t_1;
__Pyx_RefNannySetupContext("append", 0);
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":46
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":46
*
* def append(self, float val):
* if self.len == self.size: # <<<<<<<<<<<<<<
@@ -4363,7 +4383,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_10append(struct __pyx_obj_3_sa_FloatLi
__pyx_t_1 = (__pyx_v_self->len == __pyx_v_self->size);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":47
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":47
* def append(self, float val):
* if self.len == self.size:
* self.size = self.size + self.increment # <<<<<<<<<<<<<<
@@ -4372,7 +4392,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_10append(struct __pyx_obj_3_sa_FloatLi
*/
__pyx_v_self->size = (__pyx_v_self->size + __pyx_v_self->increment);
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":48
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":48
* if self.len == self.size:
* self.size = self.size + self.increment
* self.arr = <float*> realloc(self.arr, self.size*sizeof(float)) # <<<<<<<<<<<<<<
@@ -4384,7 +4404,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_10append(struct __pyx_obj_3_sa_FloatLi
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":49
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":49
* self.size = self.size + self.increment
* self.arr = <float*> realloc(self.arr, self.size*sizeof(float))
* self.arr[self.len] = val # <<<<<<<<<<<<<<
@@ -4393,7 +4413,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_10append(struct __pyx_obj_3_sa_FloatLi
*/
(__pyx_v_self->arr[__pyx_v_self->len]) = __pyx_v_val;
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":50
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":50
* self.arr = <float*> realloc(self.arr, self.size*sizeof(float))
* self.arr[self.len] = val
* self.len = self.len + 1 # <<<<<<<<<<<<<<
@@ -4408,7 +4428,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_10append(struct __pyx_obj_3_sa_FloatLi
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":52
+/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":52
* self.len = self.len + 1
*
* cdef void write_handle(self, FILE* f): # <<<<<<<<<<<<<<
@@ -4420,7 +4440,7 @@ static void __pyx_f_3_sa_9FloatList_write_handle(struct __pyx_obj_3_sa_FloatList
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write_handle", 0);
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":53
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":53
*
* cdef void write_handle(self, FILE* f):
* fwrite(&(self.len), sizeof(float), 1, f) # <<<<<<<<<<<<<<
@@ -4429,7 +4449,7 @@ static void __pyx_f_3_sa_9FloatList_write_handle(struct __pyx_obj_3_sa_FloatList
*/
fwrite((&__pyx_v_self->len), (sizeof(float)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":54
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":54
* cdef void write_handle(self, FILE* f):
* fwrite(&(self.len), sizeof(float), 1, f)
* fwrite(self.arr, sizeof(float), self.len, f) # <<<<<<<<<<<<<<
@@ -4462,7 +4482,7 @@ static PyObject *__pyx_pw_3_sa_9FloatList_13write(PyObject *__pyx_v_self, PyObje
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":56
+/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":56
* fwrite(self.arr, sizeof(float), self.len, f)
*
* def write(self, char* filename): # <<<<<<<<<<<<<<
@@ -4476,7 +4496,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_12write(struct __pyx_obj_3_sa_FloatLis
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write", 0);
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":58
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":58
* def write(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "w") # <<<<<<<<<<<<<<
@@ -4485,7 +4505,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_12write(struct __pyx_obj_3_sa_FloatLis
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w);
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":59
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":59
* cdef FILE* f
* f = fopen(filename, "w")
* self.write_handle(f) # <<<<<<<<<<<<<<
@@ -4494,7 +4514,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_12write(struct __pyx_obj_3_sa_FloatLis
*/
((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->__pyx_vtab)->write_handle(__pyx_v_self, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":60
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":60
* f = fopen(filename, "w")
* self.write_handle(f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -4509,7 +4529,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_12write(struct __pyx_obj_3_sa_FloatLis
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":62
+/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":62
* fclose(f)
*
* cdef void read_handle(self, FILE* f): # <<<<<<<<<<<<<<
@@ -4521,7 +4541,7 @@ static void __pyx_f_3_sa_9FloatList_read_handle(struct __pyx_obj_3_sa_FloatList
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_handle", 0);
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":63
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":63
*
* cdef void read_handle(self, FILE* f):
* free(self.arr) # <<<<<<<<<<<<<<
@@ -4530,7 +4550,7 @@ static void __pyx_f_3_sa_9FloatList_read_handle(struct __pyx_obj_3_sa_FloatList
*/
free(__pyx_v_self->arr);
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":64
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":64
* cdef void read_handle(self, FILE* f):
* free(self.arr)
* fread(&(self.len), sizeof(float), 1, f) # <<<<<<<<<<<<<<
@@ -4539,7 +4559,7 @@ static void __pyx_f_3_sa_9FloatList_read_handle(struct __pyx_obj_3_sa_FloatList
*/
fread((&__pyx_v_self->len), (sizeof(float)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":65
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":65
* free(self.arr)
* fread(&(self.len), sizeof(float), 1, f)
* self.arr = <float*> malloc(self.len * sizeof(float)) # <<<<<<<<<<<<<<
@@ -4548,7 +4568,7 @@ static void __pyx_f_3_sa_9FloatList_read_handle(struct __pyx_obj_3_sa_FloatList
*/
__pyx_v_self->arr = ((float *)malloc((__pyx_v_self->len * (sizeof(float)))));
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":66
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":66
* fread(&(self.len), sizeof(float), 1, f)
* self.arr = <float*> malloc(self.len * sizeof(float))
* self.size = self.len # <<<<<<<<<<<<<<
@@ -4557,7 +4577,7 @@ static void __pyx_f_3_sa_9FloatList_read_handle(struct __pyx_obj_3_sa_FloatList
*/
__pyx_v_self->size = __pyx_v_self->len;
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":67
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":67
* self.arr = <float*> malloc(self.len * sizeof(float))
* self.size = self.len
* fread(self.arr, sizeof(float), self.len, f) # <<<<<<<<<<<<<<
@@ -4590,7 +4610,7 @@ static PyObject *__pyx_pw_3_sa_9FloatList_15read(PyObject *__pyx_v_self, PyObjec
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":69
+/* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":69
* fread(self.arr, sizeof(float), self.len, f)
*
* def read(self, char* filename): # <<<<<<<<<<<<<<
@@ -4604,7 +4624,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_14read(struct __pyx_obj_3_sa_FloatList
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read", 0);
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":71
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":71
* def read(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "r") # <<<<<<<<<<<<<<
@@ -4613,7 +4633,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_14read(struct __pyx_obj_3_sa_FloatList
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r);
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":72
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":72
* cdef FILE* f
* f = fopen(filename, "r")
* self.read_handle(f) # <<<<<<<<<<<<<<
@@ -4621,7 +4641,7 @@ static PyObject *__pyx_pf_3_sa_9FloatList_14read(struct __pyx_obj_3_sa_FloatList
*/
((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->__pyx_vtab)->read_handle(__pyx_v_self, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/float_list.pxi":73
+ /* "/home/pauldb/workspace/cdec/python/src/sa/float_list.pxi":73
* f = fopen(filename, "r")
* self.read_handle(f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -4715,7 +4735,7 @@ static int __pyx_pw_3_sa_7IntList_1__cinit__(PyObject *__pyx_v_self, PyObject *_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":11
+/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":11
* cdef class IntList:
*
* def __cinit__(self, int size=0, int increment=1, int initial_len=0): # <<<<<<<<<<<<<<
@@ -4729,7 +4749,7 @@ static int __pyx_pf_3_sa_7IntList___cinit__(struct __pyx_obj_3_sa_IntList *__pyx
int __pyx_t_1;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":12
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":12
*
* def __cinit__(self, int size=0, int increment=1, int initial_len=0):
* if initial_len > size: # <<<<<<<<<<<<<<
@@ -4739,7 +4759,7 @@ static int __pyx_pf_3_sa_7IntList___cinit__(struct __pyx_obj_3_sa_IntList *__pyx
__pyx_t_1 = (__pyx_v_initial_len > __pyx_v_size);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":13
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":13
* def __cinit__(self, int size=0, int increment=1, int initial_len=0):
* if initial_len > size:
* size = initial_len # <<<<<<<<<<<<<<
@@ -4751,7 +4771,7 @@ static int __pyx_pf_3_sa_7IntList___cinit__(struct __pyx_obj_3_sa_IntList *__pyx
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":14
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":14
* if initial_len > size:
* size = initial_len
* self.size = size # <<<<<<<<<<<<<<
@@ -4760,7 +4780,7 @@ static int __pyx_pf_3_sa_7IntList___cinit__(struct __pyx_obj_3_sa_IntList *__pyx
*/
__pyx_v_self->size = __pyx_v_size;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":15
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":15
* size = initial_len
* self.size = size
* self.increment = increment # <<<<<<<<<<<<<<
@@ -4769,7 +4789,7 @@ static int __pyx_pf_3_sa_7IntList___cinit__(struct __pyx_obj_3_sa_IntList *__pyx
*/
__pyx_v_self->increment = __pyx_v_increment;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":16
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":16
* self.size = size
* self.increment = increment
* self.len = initial_len # <<<<<<<<<<<<<<
@@ -4778,7 +4798,7 @@ static int __pyx_pf_3_sa_7IntList___cinit__(struct __pyx_obj_3_sa_IntList *__pyx
*/
__pyx_v_self->len = __pyx_v_initial_len;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":17
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":17
* self.increment = increment
* self.len = initial_len
* self.arr = <int*> malloc(size*sizeof(int)) # <<<<<<<<<<<<<<
@@ -4787,7 +4807,7 @@ static int __pyx_pf_3_sa_7IntList___cinit__(struct __pyx_obj_3_sa_IntList *__pyx
*/
__pyx_v_self->arr = ((int *)malloc((__pyx_v_size * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":18
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":18
* self.len = initial_len
* self.arr = <int*> malloc(size*sizeof(int))
* memset(self.arr, 0, initial_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -4812,7 +4832,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_3__str__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":20
+/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":20
* memset(self.arr, 0, initial_len*sizeof(int))
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -4835,7 +4855,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList *
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__str__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":22
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":22
* def __str__(self):
* cdef unsigned i
* ret = "IntList[" # <<<<<<<<<<<<<<
@@ -4845,7 +4865,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList *
__Pyx_INCREF(((PyObject *)__pyx_kp_s_3));
__pyx_v_ret = ((PyObject *)__pyx_kp_s_3);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":23
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":23
* cdef unsigned i
* ret = "IntList["
* for idx in range(self.size): # <<<<<<<<<<<<<<
@@ -4856,7 +4876,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList *
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_idx = __pyx_t_2;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":24
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":24
* ret = "IntList["
* for idx in range(self.size):
* if idx>0: # <<<<<<<<<<<<<<
@@ -4866,7 +4886,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList *
__pyx_t_3 = (__pyx_v_idx > 0);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":25
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":25
* for idx in range(self.size):
* if idx>0:
* ret += "," # <<<<<<<<<<<<<<
@@ -4882,7 +4902,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList *
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":26
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":26
* if idx>0:
* ret += ","
* ret += str(self.arr[idx]) # <<<<<<<<<<<<<<
@@ -4907,7 +4927,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList *
__pyx_t_5 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":27
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":27
* ret += ","
* ret += str(self.arr[idx])
* ret += "]" # <<<<<<<<<<<<<<
@@ -4920,7 +4940,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList *
__pyx_v_ret = __pyx_t_5;
__pyx_t_5 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":28
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":28
* ret += str(self.arr[idx])
* ret += "]"
* ret += "len=" # <<<<<<<<<<<<<<
@@ -4933,7 +4953,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList *
__pyx_v_ret = __pyx_t_5;
__pyx_t_5 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":29
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":29
* ret += "]"
* ret += "len="
* ret += str(self.len) # <<<<<<<<<<<<<<
@@ -4957,7 +4977,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_2__str__(struct __pyx_obj_3_sa_IntList *
__pyx_v_ret = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":30
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":30
* ret += "len="
* ret += str(self.len)
* return ret # <<<<<<<<<<<<<<
@@ -4994,7 +5014,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_5index(PyObject *__pyx_v_self, PyObject
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":32
+/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":32
* return ret
*
* def index(self, val): # <<<<<<<<<<<<<<
@@ -5016,7 +5036,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_4index(struct __pyx_obj_3_sa_IntList *__
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("index", 0);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":34
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":34
* def index(self, val):
* cdef unsigned i
* for i in range(self.len): # <<<<<<<<<<<<<<
@@ -5027,7 +5047,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_4index(struct __pyx_obj_3_sa_IntList *__
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":35
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":35
* cdef unsigned i
* for i in range(self.len):
* if self.arr[i] == val: # <<<<<<<<<<<<<<
@@ -5042,7 +5062,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_4index(struct __pyx_obj_3_sa_IntList *__
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":36
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":36
* for i in range(self.len):
* if self.arr[i] == val:
* return i # <<<<<<<<<<<<<<
@@ -5060,7 +5080,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_4index(struct __pyx_obj_3_sa_IntList *__
__pyx_L5:;
}
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":37
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":37
* if self.arr[i] == val:
* return i
* return IndexError # <<<<<<<<<<<<<<
@@ -5141,7 +5161,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_7partition(PyObject *__pyx_v_self, PyObj
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":39
+/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":39
* return IndexError
*
* def partition(self,start,end): # <<<<<<<<<<<<<<
@@ -5167,7 +5187,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("partition", 0);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":40
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":40
*
* def partition(self,start,end):
* pivot = self.arr[end] # <<<<<<<<<<<<<<
@@ -5180,7 +5200,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList
__pyx_v_pivot = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":41
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":41
* def partition(self,start,end):
* pivot = self.arr[end]
* bottom = start-1 # <<<<<<<<<<<<<<
@@ -5192,7 +5212,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList
__pyx_v_bottom = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":42
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":42
* pivot = self.arr[end]
* bottom = start-1
* top = end # <<<<<<<<<<<<<<
@@ -5202,7 +5222,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList
__Pyx_INCREF(__pyx_v_end);
__pyx_v_top = __pyx_v_end;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":43
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":43
* bottom = start-1
* top = end
* done = 0 # <<<<<<<<<<<<<<
@@ -5211,7 +5231,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList
*/
__pyx_v_done = 0;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":44
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":44
* top = end
* done = 0
* while not done: # <<<<<<<<<<<<<<
@@ -5222,7 +5242,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList
__pyx_t_3 = (!__pyx_v_done);
if (!__pyx_t_3) break;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":45
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":45
* done = 0
* while not done:
* while not done: # <<<<<<<<<<<<<<
@@ -5233,7 +5253,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList
__pyx_t_3 = (!__pyx_v_done);
if (!__pyx_t_3) break;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":46
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":46
* while not done:
* while not done:
* bottom += 1 # <<<<<<<<<<<<<<
@@ -5246,7 +5266,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList
__pyx_v_bottom = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":47
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":47
* while not done:
* bottom += 1
* if bottom == top: # <<<<<<<<<<<<<<
@@ -5258,7 +5278,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":48
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":48
* bottom += 1
* if bottom == top:
* done = 1 # <<<<<<<<<<<<<<
@@ -5267,7 +5287,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList
*/
__pyx_v_done = 1;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":49
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":49
* if bottom == top:
* done = 1
* break # <<<<<<<<<<<<<<
@@ -5279,7 +5299,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList
}
__pyx_L7:;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":50
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":50
* done = 1
* break
* if self.arr[bottom] > pivot: # <<<<<<<<<<<<<<
@@ -5295,7 +5315,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":51
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":51
* break
* if self.arr[bottom] > pivot:
* self.arr[top] = self.arr[bottom] # <<<<<<<<<<<<<<
@@ -5306,7 +5326,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList
__pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_top); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
(__pyx_v_self->arr[__pyx_t_5]) = (__pyx_v_self->arr[__pyx_t_1]);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":52
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":52
* if self.arr[bottom] > pivot:
* self.arr[top] = self.arr[bottom]
* break # <<<<<<<<<<<<<<
@@ -5320,7 +5340,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList
}
__pyx_L6_break:;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":53
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":53
* self.arr[top] = self.arr[bottom]
* break
* while not done: # <<<<<<<<<<<<<<
@@ -5331,7 +5351,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList
__pyx_t_3 = (!__pyx_v_done);
if (!__pyx_t_3) break;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":54
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":54
* break
* while not done:
* top -= 1 # <<<<<<<<<<<<<<
@@ -5344,7 +5364,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList
__pyx_v_top = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":55
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":55
* while not done:
* top -= 1
* if top == bottom: # <<<<<<<<<<<<<<
@@ -5356,7 +5376,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":56
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":56
* top -= 1
* if top == bottom:
* done = 1 # <<<<<<<<<<<<<<
@@ -5365,7 +5385,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList
*/
__pyx_v_done = 1;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":57
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":57
* if top == bottom:
* done = 1
* break # <<<<<<<<<<<<<<
@@ -5377,7 +5397,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList
}
__pyx_L11:;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":58
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":58
* done = 1
* break
* if self.arr[top] < pivot: # <<<<<<<<<<<<<<
@@ -5393,7 +5413,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":59
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":59
* break
* if self.arr[top] < pivot:
* self.arr[bottom] = self.arr[top] # <<<<<<<<<<<<<<
@@ -5404,7 +5424,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList
__pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_bottom); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
(__pyx_v_self->arr[__pyx_t_5]) = (__pyx_v_self->arr[__pyx_t_1]);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":60
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":60
* if self.arr[top] < pivot:
* self.arr[bottom] = self.arr[top]
* break # <<<<<<<<<<<<<<
@@ -5419,7 +5439,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList
__pyx_L10_break:;
}
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":61
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":61
* self.arr[bottom] = self.arr[top]
* break
* self.arr[top] = pivot # <<<<<<<<<<<<<<
@@ -5430,7 +5450,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_6partition(struct __pyx_obj_3_sa_IntList
__pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_top); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
(__pyx_v_self->arr[__pyx_t_1]) = __pyx_t_6;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":62
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":62
* break
* self.arr[top] = pivot
* return top # <<<<<<<<<<<<<<
@@ -5514,7 +5534,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_9_doquicksort(PyObject *__pyx_v_self, Py
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":64
+/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":64
* return top
*
* def _doquicksort(self,start,end): # <<<<<<<<<<<<<<
@@ -5535,7 +5555,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_8_doquicksort(struct __pyx_obj_3_sa_IntL
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_doquicksort", 0);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":65
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":65
*
* def _doquicksort(self,start,end):
* if start < end: # <<<<<<<<<<<<<<
@@ -5547,7 +5567,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_8_doquicksort(struct __pyx_obj_3_sa_IntL
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":66
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":66
* def _doquicksort(self,start,end):
* if start < end:
* split = self.partition(start,end) # <<<<<<<<<<<<<<
@@ -5571,7 +5591,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_8_doquicksort(struct __pyx_obj_3_sa_IntL
__pyx_v_split = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":67
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":67
* if start < end:
* split = self.partition(start,end)
* self._doquicksort(start,split-1) # <<<<<<<<<<<<<<
@@ -5596,7 +5616,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_8_doquicksort(struct __pyx_obj_3_sa_IntL
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":68
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":68
* split = self.partition(start,end)
* self._doquicksort(start,split-1)
* self._doquicksort(split+1,end) # <<<<<<<<<<<<<<
@@ -5624,7 +5644,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_8_doquicksort(struct __pyx_obj_3_sa_IntL
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":70
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":70
* self._doquicksort(split+1,end)
* else:
* return # <<<<<<<<<<<<<<
@@ -5663,7 +5683,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_11sort(PyObject *__pyx_v_self, CYTHON_UN
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":72
+/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":72
* return
*
* def sort(self): # <<<<<<<<<<<<<<
@@ -5682,7 +5702,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_10sort(struct __pyx_obj_3_sa_IntList *__
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("sort", 0);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":73
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":73
*
* def sort(self):
* self._doquicksort(0,self.len-1) # <<<<<<<<<<<<<<
@@ -5732,7 +5752,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_13reset(PyObject *__pyx_v_self, CYTHON_U
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":75
+/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":75
* self._doquicksort(0,self.len-1)
*
* def reset(self): # <<<<<<<<<<<<<<
@@ -5745,7 +5765,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_12reset(struct __pyx_obj_3_sa_IntList *_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reset", 0);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":76
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":76
*
* def reset(self):
* self.len = 0 # <<<<<<<<<<<<<<
@@ -5769,7 +5789,7 @@ static void __pyx_pw_3_sa_7IntList_15__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyFinishContext();
}
-/* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":78
+/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":78
* self.len = 0
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -5781,7 +5801,7 @@ static void __pyx_pf_3_sa_7IntList_14__dealloc__(struct __pyx_obj_3_sa_IntList *
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":79
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":79
*
* def __dealloc__(self):
* free(self.arr) # <<<<<<<<<<<<<<
@@ -5805,7 +5825,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_17__iter__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":81
+/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":81
* free(self.arr)
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -5868,7 +5888,7 @@ static PyObject *__pyx_gb_3_sa_7IntList_18generator(__pyx_GeneratorObject *__pyx
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":83
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":83
* def __iter__(self):
* cdef int i
* for i in range(self.len): # <<<<<<<<<<<<<<
@@ -5879,7 +5899,7 @@ static PyObject *__pyx_gb_3_sa_7IntList_18generator(__pyx_GeneratorObject *__pyx
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_2;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":84
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":84
* cdef int i
* for i in range(self.len):
* yield self.arr[i] # <<<<<<<<<<<<<<
@@ -5926,7 +5946,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_20__getitem__(PyObject *__pyx_v_self, Py
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":86
+/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":86
* yield self.arr[i]
*
* def __getitem__(self, index): # <<<<<<<<<<<<<<
@@ -5956,7 +5976,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getitem__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":88
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":88
* def __getitem__(self, index):
* cdef int i, j, k
* if isinstance(index, int): # <<<<<<<<<<<<<<
@@ -5969,7 +5989,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":89
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":89
* cdef int i, j, k
* if isinstance(index, int):
* j = index # <<<<<<<<<<<<<<
@@ -5979,7 +5999,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL
__pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_v_index); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_j = __pyx_t_3;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":90
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":90
* if isinstance(index, int):
* j = index
* if j < 0: # <<<<<<<<<<<<<<
@@ -5989,7 +6009,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL
__pyx_t_2 = (__pyx_v_j < 0);
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":91
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":91
* j = index
* if j < 0:
* j = self.len + j # <<<<<<<<<<<<<<
@@ -6001,7 +6021,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":92
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":92
* if j < 0:
* j = self.len + j
* if j<0 or j>=self.len: # <<<<<<<<<<<<<<
@@ -6017,7 +6037,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL
}
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":93
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":93
* j = self.len + j
* if j<0 or j>=self.len:
* raise IndexError("Requested index %d of %d-length IntList" % (index, self.len)) # <<<<<<<<<<<<<<
@@ -6052,7 +6072,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":94
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":94
* if j<0 or j>=self.len:
* raise IndexError("Requested index %d of %d-length IntList" % (index, self.len))
* return self.arr[j] # <<<<<<<<<<<<<<
@@ -6068,7 +6088,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL
goto __pyx_L3;
}
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":95
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":95
* raise IndexError("Requested index %d of %d-length IntList" % (index, self.len))
* return self.arr[j]
* elif isinstance(index, slice): # <<<<<<<<<<<<<<
@@ -6081,7 +6101,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":96
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":96
* return self.arr[j]
* elif isinstance(index, slice):
* i = index.start # <<<<<<<<<<<<<<
@@ -6094,7 +6114,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_i = __pyx_t_3;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":97
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":97
* elif isinstance(index, slice):
* i = index.start
* j = index.stop # <<<<<<<<<<<<<<
@@ -6107,7 +6127,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_j = __pyx_t_3;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":98
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":98
* i = index.start
* j = index.stop
* if i < 0: # <<<<<<<<<<<<<<
@@ -6117,7 +6137,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL
__pyx_t_5 = (__pyx_v_i < 0);
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":99
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":99
* j = index.stop
* if i < 0:
* i = self.len + i # <<<<<<<<<<<<<<
@@ -6129,7 +6149,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL
}
__pyx_L6:;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":100
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":100
* if i < 0:
* i = self.len + i
* if j < 0: # <<<<<<<<<<<<<<
@@ -6139,7 +6159,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL
__pyx_t_5 = (__pyx_v_j < 0);
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":101
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":101
* i = self.len + i
* if j < 0:
* j = self.len + j # <<<<<<<<<<<<<<
@@ -6151,7 +6171,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL
}
__pyx_L7:;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":102
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":102
* if j < 0:
* j = self.len + j
* if i < 0 or i >= self.len or j < 0 or j > self.len: # <<<<<<<<<<<<<<
@@ -6179,7 +6199,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL
}
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":103
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":103
* j = self.len + j
* if i < 0 or i >= self.len or j < 0 or j > self.len:
* raise IndexError("Requested index %d:%d of %d-length IntList" % (index.start, index.stop, self.len)) # <<<<<<<<<<<<<<
@@ -6221,7 +6241,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL
}
__pyx_L8:;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":104
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":104
* if i < 0 or i >= self.len or j < 0 or j > self.len:
* raise IndexError("Requested index %d:%d of %d-length IntList" % (index.start, index.stop, self.len))
* result = () # <<<<<<<<<<<<<<
@@ -6231,7 +6251,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL
__Pyx_INCREF(((PyObject *)__pyx_empty_tuple));
__pyx_v_result = __pyx_empty_tuple;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":105
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":105
* raise IndexError("Requested index %d:%d of %d-length IntList" % (index.start, index.stop, self.len))
* result = ()
* for k from i <= k < j: # <<<<<<<<<<<<<<
@@ -6241,7 +6261,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL
__pyx_t_3 = __pyx_v_j;
for (__pyx_v_k = __pyx_v_i; __pyx_v_k < __pyx_t_3; __pyx_v_k++) {
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":106
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":106
* result = ()
* for k from i <= k < j:
* result = result + (self.arr[k],) # <<<<<<<<<<<<<<
@@ -6263,7 +6283,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL
__pyx_t_9 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":107
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":107
* for k from i <= k < j:
* result = result + (self.arr[k],)
* return result # <<<<<<<<<<<<<<
@@ -6278,7 +6298,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":109
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":109
* return result
* else:
* raise TypeError("Illegal key type %s for IntList" % type(index)) # <<<<<<<<<<<<<<
@@ -6317,7 +6337,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_19__getitem__(struct __pyx_obj_3_sa_IntL
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":111
+/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":111
* raise TypeError("Illegal key type %s for IntList" % type(index))
*
* cdef void set(self, int i, int val): # <<<<<<<<<<<<<<
@@ -6339,7 +6359,7 @@ static void __pyx_f_3_sa_7IntList_set(struct __pyx_obj_3_sa_IntList *__pyx_v_sel
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set", 0);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":112
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":112
*
* cdef void set(self, int i, int val):
* j = i # <<<<<<<<<<<<<<
@@ -6348,7 +6368,7 @@ static void __pyx_f_3_sa_7IntList_set(struct __pyx_obj_3_sa_IntList *__pyx_v_sel
*/
__pyx_v_j = __pyx_v_i;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":113
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":113
* cdef void set(self, int i, int val):
* j = i
* if i<0: # <<<<<<<<<<<<<<
@@ -6358,7 +6378,7 @@ static void __pyx_f_3_sa_7IntList_set(struct __pyx_obj_3_sa_IntList *__pyx_v_sel
__pyx_t_1 = (__pyx_v_i < 0);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":114
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":114
* j = i
* if i<0:
* j = self.len + i # <<<<<<<<<<<<<<
@@ -6370,7 +6390,7 @@ static void __pyx_f_3_sa_7IntList_set(struct __pyx_obj_3_sa_IntList *__pyx_v_sel
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":115
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":115
* if i<0:
* j = self.len + i
* if j<0 or j>=self.len: # <<<<<<<<<<<<<<
@@ -6386,7 +6406,7 @@ static void __pyx_f_3_sa_7IntList_set(struct __pyx_obj_3_sa_IntList *__pyx_v_sel
}
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":116
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":116
* j = self.len + i
* if j<0 or j>=self.len:
* raise IndexError("Requested index %d of %d-length IntList" % (i, self.len)) # <<<<<<<<<<<<<<
@@ -6423,7 +6443,7 @@ static void __pyx_f_3_sa_7IntList_set(struct __pyx_obj_3_sa_IntList *__pyx_v_sel
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":117
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":117
* if j<0 or j>=self.len:
* raise IndexError("Requested index %d of %d-length IntList" % (i, self.len))
* self.arr[j] = val # <<<<<<<<<<<<<<
@@ -6453,7 +6473,7 @@ static int __pyx_pw_3_sa_7IntList_22__setitem__(PyObject *__pyx_v_self, PyObject
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":119
+/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":119
* self.arr[j] = val
*
* def __setitem__(self, i, val): # <<<<<<<<<<<<<<
@@ -6471,7 +6491,7 @@ static int __pyx_pf_3_sa_7IntList_21__setitem__(struct __pyx_obj_3_sa_IntList *_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__setitem__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":120
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":120
*
* def __setitem__(self, i, val):
* self.set(i, val) # <<<<<<<<<<<<<<
@@ -6503,7 +6523,7 @@ static Py_ssize_t __pyx_pw_3_sa_7IntList_24__len__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":122
+/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":122
* self.set(i, val)
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -6516,7 +6536,7 @@ static Py_ssize_t __pyx_pf_3_sa_7IntList_23__len__(struct __pyx_obj_3_sa_IntList
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":123
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":123
*
* def __len__(self):
* return self.len # <<<<<<<<<<<<<<
@@ -6543,7 +6563,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_26get_size(PyObject *__pyx_v_self, CYTHO
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":125
+/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":125
* return self.len
*
* def get_size(self): # <<<<<<<<<<<<<<
@@ -6560,7 +6580,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_25get_size(struct __pyx_obj_3_sa_IntList
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_size", 0);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":126
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":126
*
* def get_size(self):
* return self.size # <<<<<<<<<<<<<<
@@ -6607,7 +6627,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_28append(PyObject *__pyx_v_self, PyObjec
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":128
+/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":128
* return self.size
*
* def append(self, int val): # <<<<<<<<<<<<<<
@@ -6620,7 +6640,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_27append(struct __pyx_obj_3_sa_IntList *
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("append", 0);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":129
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":129
*
* def append(self, int val):
* self._append(val) # <<<<<<<<<<<<<<
@@ -6635,7 +6655,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_27append(struct __pyx_obj_3_sa_IntList *
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":131
+/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":131
* self._append(val)
*
* cdef void _append(self, int val): # <<<<<<<<<<<<<<
@@ -6648,7 +6668,7 @@ static void __pyx_f_3_sa_7IntList__append(struct __pyx_obj_3_sa_IntList *__pyx_v
int __pyx_t_1;
__Pyx_RefNannySetupContext("_append", 0);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":132
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":132
*
* cdef void _append(self, int val):
* if self.len == self.size: # <<<<<<<<<<<<<<
@@ -6658,7 +6678,7 @@ static void __pyx_f_3_sa_7IntList__append(struct __pyx_obj_3_sa_IntList *__pyx_v
__pyx_t_1 = (__pyx_v_self->len == __pyx_v_self->size);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":133
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":133
* cdef void _append(self, int val):
* if self.len == self.size:
* self.size = self.size + self.increment # <<<<<<<<<<<<<<
@@ -6667,7 +6687,7 @@ static void __pyx_f_3_sa_7IntList__append(struct __pyx_obj_3_sa_IntList *__pyx_v
*/
__pyx_v_self->size = (__pyx_v_self->size + __pyx_v_self->increment);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":134
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":134
* if self.len == self.size:
* self.size = self.size + self.increment
* self.arr = <int*> realloc(self.arr, self.size*sizeof(int)) # <<<<<<<<<<<<<<
@@ -6679,7 +6699,7 @@ static void __pyx_f_3_sa_7IntList__append(struct __pyx_obj_3_sa_IntList *__pyx_v
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":135
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":135
* self.size = self.size + self.increment
* self.arr = <int*> realloc(self.arr, self.size*sizeof(int))
* self.arr[self.len] = val # <<<<<<<<<<<<<<
@@ -6688,7 +6708,7 @@ static void __pyx_f_3_sa_7IntList__append(struct __pyx_obj_3_sa_IntList *__pyx_v
*/
(__pyx_v_self->arr[__pyx_v_self->len]) = __pyx_v_val;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":136
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":136
* self.arr = <int*> realloc(self.arr, self.size*sizeof(int))
* self.arr[self.len] = val
* self.len = self.len + 1 # <<<<<<<<<<<<<<
@@ -6711,7 +6731,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_30extend(PyObject *__pyx_v_self, PyObjec
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":138
+/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":138
* self.len = self.len + 1
*
* def extend(self, other): # <<<<<<<<<<<<<<
@@ -6728,7 +6748,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_29extend(struct __pyx_obj_3_sa_IntList *
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("extend", 0);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":139
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":139
*
* def extend(self, other):
* self._extend(other) # <<<<<<<<<<<<<<
@@ -6753,7 +6773,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_29extend(struct __pyx_obj_3_sa_IntList *
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":141
+/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":141
* self._extend(other)
*
* cdef void _extend(self, IntList other): # <<<<<<<<<<<<<<
@@ -6765,7 +6785,7 @@ static void __pyx_f_3_sa_7IntList__extend(struct __pyx_obj_3_sa_IntList *__pyx_v
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_extend", 0);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":142
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":142
*
* cdef void _extend(self, IntList other):
* self._extend_arr(other.arr, other.len) # <<<<<<<<<<<<<<
@@ -6777,7 +6797,7 @@ static void __pyx_f_3_sa_7IntList__extend(struct __pyx_obj_3_sa_IntList *__pyx_v
__Pyx_RefNannyFinishContext();
}
-/* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":144
+/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":144
* self._extend_arr(other.arr, other.len)
*
* cdef void _extend_arr(self, int* other, int other_len): # <<<<<<<<<<<<<<
@@ -6790,7 +6810,7 @@ static void __pyx_f_3_sa_7IntList__extend_arr(struct __pyx_obj_3_sa_IntList *__p
int __pyx_t_1;
__Pyx_RefNannySetupContext("_extend_arr", 0);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":145
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":145
*
* cdef void _extend_arr(self, int* other, int other_len):
* if self.size < self.len + other_len: # <<<<<<<<<<<<<<
@@ -6800,7 +6820,7 @@ static void __pyx_f_3_sa_7IntList__extend_arr(struct __pyx_obj_3_sa_IntList *__p
__pyx_t_1 = (__pyx_v_self->size < (__pyx_v_self->len + __pyx_v_other_len));
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":146
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":146
* cdef void _extend_arr(self, int* other, int other_len):
* if self.size < self.len + other_len:
* self.size = self.len + other_len # <<<<<<<<<<<<<<
@@ -6809,7 +6829,7 @@ static void __pyx_f_3_sa_7IntList__extend_arr(struct __pyx_obj_3_sa_IntList *__p
*/
__pyx_v_self->size = (__pyx_v_self->len + __pyx_v_other_len);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":147
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":147
* if self.size < self.len + other_len:
* self.size = self.len + other_len
* self.arr = <int*> realloc(self.arr, self.size*sizeof(int)) # <<<<<<<<<<<<<<
@@ -6821,7 +6841,7 @@ static void __pyx_f_3_sa_7IntList__extend_arr(struct __pyx_obj_3_sa_IntList *__p
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":148
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":148
* self.size = self.len + other_len
* self.arr = <int*> realloc(self.arr, self.size*sizeof(int))
* memcpy(self.arr+self.len, other, other_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -6830,7 +6850,7 @@ static void __pyx_f_3_sa_7IntList__extend_arr(struct __pyx_obj_3_sa_IntList *__p
*/
memcpy((__pyx_v_self->arr + __pyx_v_self->len), __pyx_v_other, (__pyx_v_other_len * (sizeof(int))));
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":149
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":149
* self.arr = <int*> realloc(self.arr, self.size*sizeof(int))
* memcpy(self.arr+self.len, other, other_len*sizeof(int))
* self.len = self.len + other_len # <<<<<<<<<<<<<<
@@ -6842,7 +6862,7 @@ static void __pyx_f_3_sa_7IntList__extend_arr(struct __pyx_obj_3_sa_IntList *__p
__Pyx_RefNannyFinishContext();
}
-/* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":151
+/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":151
* self.len = self.len + other_len
*
* cdef void _clear(self): # <<<<<<<<<<<<<<
@@ -6854,7 +6874,7 @@ static void __pyx_f_3_sa_7IntList__clear(struct __pyx_obj_3_sa_IntList *__pyx_v_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_clear", 0);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":152
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":152
*
* cdef void _clear(self):
* free(self.arr) # <<<<<<<<<<<<<<
@@ -6863,7 +6883,7 @@ static void __pyx_f_3_sa_7IntList__clear(struct __pyx_obj_3_sa_IntList *__pyx_v_
*/
free(__pyx_v_self->arr);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":153
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":153
* cdef void _clear(self):
* free(self.arr)
* self.len = 0 # <<<<<<<<<<<<<<
@@ -6872,7 +6892,7 @@ static void __pyx_f_3_sa_7IntList__clear(struct __pyx_obj_3_sa_IntList *__pyx_v_
*/
__pyx_v_self->len = 0;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":154
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":154
* free(self.arr)
* self.len = 0
* self.size = 0 # <<<<<<<<<<<<<<
@@ -6881,7 +6901,7 @@ static void __pyx_f_3_sa_7IntList__clear(struct __pyx_obj_3_sa_IntList *__pyx_v_
*/
__pyx_v_self->size = 0;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":155
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":155
* self.len = 0
* self.size = 0
* self.arr = <int*> malloc(0) # <<<<<<<<<<<<<<
@@ -6893,7 +6913,7 @@ static void __pyx_f_3_sa_7IntList__clear(struct __pyx_obj_3_sa_IntList *__pyx_v_
__Pyx_RefNannyFinishContext();
}
-/* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":157
+/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":157
* self.arr = <int*> malloc(0)
*
* cdef void write_handle(self, FILE* f): # <<<<<<<<<<<<<<
@@ -6905,7 +6925,7 @@ static void __pyx_f_3_sa_7IntList_write_handle(struct __pyx_obj_3_sa_IntList *__
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write_handle", 0);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":158
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":158
*
* cdef void write_handle(self, FILE* f):
* fwrite(&(self.len), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -6914,7 +6934,7 @@ static void __pyx_f_3_sa_7IntList_write_handle(struct __pyx_obj_3_sa_IntList *__
*/
fwrite((&__pyx_v_self->len), (sizeof(int)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":159
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":159
* cdef void write_handle(self, FILE* f):
* fwrite(&(self.len), sizeof(int), 1, f)
* fwrite(self.arr, sizeof(int), self.len, f) # <<<<<<<<<<<<<<
@@ -6947,7 +6967,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_32write(PyObject *__pyx_v_self, PyObject
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":161
+/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":161
* fwrite(self.arr, sizeof(int), self.len, f)
*
* def write(self, char* filename): # <<<<<<<<<<<<<<
@@ -6961,7 +6981,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_31write(struct __pyx_obj_3_sa_IntList *_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write", 0);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":163
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":163
* def write(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "w") # <<<<<<<<<<<<<<
@@ -6970,7 +6990,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_31write(struct __pyx_obj_3_sa_IntList *_
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":164
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":164
* cdef FILE* f
* f = fopen(filename, "w")
* self.write_handle(f) # <<<<<<<<<<<<<<
@@ -6979,7 +6999,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_31write(struct __pyx_obj_3_sa_IntList *_
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->__pyx_vtab)->write_handle(__pyx_v_self, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":165
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":165
* f = fopen(filename, "w")
* self.write_handle(f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -6994,7 +7014,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_31write(struct __pyx_obj_3_sa_IntList *_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":167
+/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":167
* fclose(f)
*
* cdef void read_handle(self, FILE* f): # <<<<<<<<<<<<<<
@@ -7006,7 +7026,7 @@ static void __pyx_f_3_sa_7IntList_read_handle(struct __pyx_obj_3_sa_IntList *__p
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_handle", 0);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":168
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":168
*
* cdef void read_handle(self, FILE* f):
* (self.arr) # <<<<<<<<<<<<<<
@@ -7015,7 +7035,7 @@ static void __pyx_f_3_sa_7IntList_read_handle(struct __pyx_obj_3_sa_IntList *__p
*/
__pyx_v_self->arr;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":169
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":169
* cdef void read_handle(self, FILE* f):
* (self.arr)
* fread(&(self.len), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -7024,7 +7044,7 @@ static void __pyx_f_3_sa_7IntList_read_handle(struct __pyx_obj_3_sa_IntList *__p
*/
fread((&__pyx_v_self->len), (sizeof(int)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":170
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":170
* (self.arr)
* fread(&(self.len), sizeof(int), 1, f)
* self.arr = <int*> malloc(self.len * sizeof(int)) # <<<<<<<<<<<<<<
@@ -7033,7 +7053,7 @@ static void __pyx_f_3_sa_7IntList_read_handle(struct __pyx_obj_3_sa_IntList *__p
*/
__pyx_v_self->arr = ((int *)malloc((__pyx_v_self->len * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":171
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":171
* fread(&(self.len), sizeof(int), 1, f)
* self.arr = <int*> malloc(self.len * sizeof(int))
* self.size = self.len # <<<<<<<<<<<<<<
@@ -7042,7 +7062,7 @@ static void __pyx_f_3_sa_7IntList_read_handle(struct __pyx_obj_3_sa_IntList *__p
*/
__pyx_v_self->size = __pyx_v_self->len;
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":172
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":172
* self.arr = <int*> malloc(self.len * sizeof(int))
* self.size = self.len
* fread(self.arr, sizeof(int), self.len, f) # <<<<<<<<<<<<<<
@@ -7075,7 +7095,7 @@ static PyObject *__pyx_pw_3_sa_7IntList_34read(PyObject *__pyx_v_self, PyObject
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":174
+/* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":174
* fread(self.arr, sizeof(int), self.len, f)
*
* def read(self, char* filename): # <<<<<<<<<<<<<<
@@ -7089,7 +7109,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_33read(struct __pyx_obj_3_sa_IntList *__
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read", 0);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":176
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":176
* def read(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "r") # <<<<<<<<<<<<<<
@@ -7098,7 +7118,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_33read(struct __pyx_obj_3_sa_IntList *__
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":177
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":177
* cdef FILE* f
* f = fopen(filename, "r")
* self.read_handle(f) # <<<<<<<<<<<<<<
@@ -7106,7 +7126,7 @@ static PyObject *__pyx_pf_3_sa_7IntList_33read(struct __pyx_obj_3_sa_IntList *__
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->__pyx_vtab)->read_handle(__pyx_v_self, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/int_list.pxi":178
+ /* "/home/pauldb/workspace/cdec/python/src/sa/int_list.pxi":178
* f = fopen(filename, "r")
* self.read_handle(f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -7133,7 +7153,7 @@ static int __pyx_pw_3_sa_9StringMap_1__cinit__(PyObject *__pyx_v_self, PyObject
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/str_map.pxi":13
+/* "/home/pauldb/workspace/cdec/python/src/sa/str_map.pxi":13
* cdef int index(self, char *s)
*
* def __cinit__(self): # <<<<<<<<<<<<<<
@@ -7146,7 +7166,7 @@ static int __pyx_pf_3_sa_9StringMap___cinit__(struct __pyx_obj_3_sa_StringMap *_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/str_map.pxi":14
+ /* "/home/pauldb/workspace/cdec/python/src/sa/str_map.pxi":14
*
* def __cinit__(self):
* self.vocab = stringmap_new() # <<<<<<<<<<<<<<
@@ -7169,7 +7189,7 @@ static void __pyx_pw_3_sa_9StringMap_3__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyFinishContext();
}
-/* "/home/m/workspace/cdec/python/src/sa/str_map.pxi":16
+/* "/home/pauldb/workspace/cdec/python/src/sa/str_map.pxi":16
* self.vocab = stringmap_new()
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -7181,7 +7201,7 @@ static void __pyx_pf_3_sa_9StringMap_2__dealloc__(struct __pyx_obj_3_sa_StringMa
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/str_map.pxi":17
+ /* "/home/pauldb/workspace/cdec/python/src/sa/str_map.pxi":17
*
* def __dealloc__(self):
* stringmap_delete(self.vocab) # <<<<<<<<<<<<<<
@@ -7193,7 +7213,7 @@ static void __pyx_pf_3_sa_9StringMap_2__dealloc__(struct __pyx_obj_3_sa_StringMa
__Pyx_RefNannyFinishContext();
}
-/* "/home/m/workspace/cdec/python/src/sa/str_map.pxi":19
+/* "/home/pauldb/workspace/cdec/python/src/sa/str_map.pxi":19
* stringmap_delete(self.vocab)
*
* cdef char *word(self, int i): # <<<<<<<<<<<<<<
@@ -7206,7 +7226,7 @@ static char *__pyx_f_3_sa_9StringMap_word(struct __pyx_obj_3_sa_StringMap *__pyx
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("word", 0);
- /* "/home/m/workspace/cdec/python/src/sa/str_map.pxi":20
+ /* "/home/pauldb/workspace/cdec/python/src/sa/str_map.pxi":20
*
* cdef char *word(self, int i):
* return stringmap_word(self.vocab, i) # <<<<<<<<<<<<<<
@@ -7222,7 +7242,7 @@ static char *__pyx_f_3_sa_9StringMap_word(struct __pyx_obj_3_sa_StringMap *__pyx
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/str_map.pxi":22
+/* "/home/pauldb/workspace/cdec/python/src/sa/str_map.pxi":22
* return stringmap_word(self.vocab, i)
*
* cdef int index(self, char *s): # <<<<<<<<<<<<<<
@@ -7234,7 +7254,7 @@ static int __pyx_f_3_sa_9StringMap_index(struct __pyx_obj_3_sa_StringMap *__pyx_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("index", 0);
- /* "/home/m/workspace/cdec/python/src/sa/str_map.pxi":23
+ /* "/home/pauldb/workspace/cdec/python/src/sa/str_map.pxi":23
*
* cdef int index(self, char *s):
* return stringmap_index(self.vocab, s) # <<<<<<<<<<<<<<
@@ -7262,7 +7282,7 @@ static int __pyx_pw_3_sa_9DataArray_1__cinit__(PyObject *__pyx_v_self, PyObject
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_binary,&__pyx_n_s__from_text,&__pyx_n_s__side,&__pyx_n_s__use_sent_id,0};
PyObject* values[4] = {0,0,0,0};
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":17
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":17
* cdef bint use_sent_id
*
* def __cinit__(self, from_binary=None, from_text=None, side=None, bint use_sent_id=False): # <<<<<<<<<<<<<<
@@ -7354,7 +7374,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":18
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":18
*
* def __cinit__(self, from_binary=None, from_text=None, side=None, bint use_sent_id=False):
* self.word2id = {"END_OF_FILE":0, "END_OF_LINE":1} # <<<<<<<<<<<<<<
@@ -7371,7 +7391,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_
__pyx_v_self->word2id = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":19
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":19
* def __cinit__(self, from_binary=None, from_text=None, side=None, bint use_sent_id=False):
* self.word2id = {"END_OF_FILE":0, "END_OF_LINE":1}
* self.id2word = ["END_OF_FILE", "END_OF_LINE"] # <<<<<<<<<<<<<<
@@ -7392,7 +7412,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_
__pyx_v_self->id2word = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":20
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":20
* self.word2id = {"END_OF_FILE":0, "END_OF_LINE":1}
* self.id2word = ["END_OF_FILE", "END_OF_LINE"]
* self.data = IntList(1000,1000) # <<<<<<<<<<<<<<
@@ -7407,7 +7427,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_
__pyx_v_self->data = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":21
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":21
* self.id2word = ["END_OF_FILE", "END_OF_LINE"]
* self.data = IntList(1000,1000)
* self.sent_id = IntList(1000,1000) # <<<<<<<<<<<<<<
@@ -7422,7 +7442,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_
__pyx_v_self->sent_id = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":22
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":22
* self.data = IntList(1000,1000)
* self.sent_id = IntList(1000,1000)
* self.sent_index = IntList(1000,1000) # <<<<<<<<<<<<<<
@@ -7437,7 +7457,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_
__pyx_v_self->sent_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":23
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":23
* self.sent_id = IntList(1000,1000)
* self.sent_index = IntList(1000,1000)
* self.use_sent_id = use_sent_id # <<<<<<<<<<<<<<
@@ -7446,7 +7466,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_
*/
__pyx_v_self->use_sent_id = __pyx_v_use_sent_id;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":24
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":24
* self.sent_index = IntList(1000,1000)
* self.use_sent_id = use_sent_id
* if from_binary: # <<<<<<<<<<<<<<
@@ -7456,7 +7476,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_binary); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":25
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":25
* self.use_sent_id = use_sent_id
* if from_binary:
* self.read_binary(from_binary) # <<<<<<<<<<<<<<
@@ -7478,7 +7498,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_
goto __pyx_L3;
}
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":26
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":26
* if from_binary:
* self.read_binary(from_binary)
* elif from_text: # <<<<<<<<<<<<<<
@@ -7488,7 +7508,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_text); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":27
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":27
* self.read_binary(from_binary)
* elif from_text:
* if side: # <<<<<<<<<<<<<<
@@ -7498,7 +7518,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_side); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":28
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":28
* elif from_text:
* if side:
* self.read_bitext(from_text, (0 if side == 'source' else 1)) # <<<<<<<<<<<<<<
@@ -7534,7 +7554,7 @@ static int __pyx_pf_3_sa_9DataArray___cinit__(struct __pyx_obj_3_sa_DataArray *_
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":30
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":30
* self.read_bitext(from_text, (0 if side == 'source' else 1))
* else:
* self.read_text(from_text) # <<<<<<<<<<<<<<
@@ -7583,7 +7603,7 @@ static Py_ssize_t __pyx_pw_3_sa_9DataArray_3__len__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":32
+/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":32
* self.read_text(from_text)
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -7601,7 +7621,7 @@ static Py_ssize_t __pyx_pf_3_sa_9DataArray_2__len__(struct __pyx_obj_3_sa_DataAr
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__len__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":33
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":33
*
* def __len__(self):
* return len(self.data) # <<<<<<<<<<<<<<
@@ -7637,7 +7657,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_5get_sentence_id(PyObject *__pyx_v_sel
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":35
+/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":35
* return len(self.data)
*
* def get_sentence_id(self, i): # <<<<<<<<<<<<<<
@@ -7655,7 +7675,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_4get_sentence_id(struct __pyx_obj_3_sa
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_sentence_id", 0);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":36
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":36
*
* def get_sentence_id(self, i):
* return self.sent_id.arr[i] # <<<<<<<<<<<<<<
@@ -7693,7 +7713,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_7get_sentence(PyObject *__pyx_v_self,
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":38
+/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":38
* return self.sent_id.arr[i]
*
* def get_sentence(self, i): # <<<<<<<<<<<<<<
@@ -7718,7 +7738,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence(struct __pyx_obj_3_sa_Da
__Pyx_RefNannySetupContext("get_sentence", 0);
__Pyx_INCREF(__pyx_v_i);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":40
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":40
* def get_sentence(self, i):
* cdef int j, start, stop
* sent = [] # <<<<<<<<<<<<<<
@@ -7730,7 +7750,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence(struct __pyx_obj_3_sa_Da
__pyx_v_sent = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":41
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":41
* cdef int j, start, stop
* sent = []
* start = self.sent_index.arr[i] # <<<<<<<<<<<<<<
@@ -7740,7 +7760,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence(struct __pyx_obj_3_sa_Da
__pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_start = (__pyx_v_self->sent_index->arr[__pyx_t_2]);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":42
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":42
* sent = []
* start = self.sent_index.arr[i]
* stop = self.sent_index.arr[i+1] # <<<<<<<<<<<<<<
@@ -7753,7 +7773,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence(struct __pyx_obj_3_sa_Da
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_stop = (__pyx_v_self->sent_index->arr[__pyx_t_2]);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":43
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":43
* start = self.sent_index.arr[i]
* stop = self.sent_index.arr[i+1]
* for i from start <= i < stop: # <<<<<<<<<<<<<<
@@ -7768,7 +7788,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence(struct __pyx_obj_3_sa_Da
__pyx_v_i = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":44
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":44
* stop = self.sent_index.arr[i+1]
* for i from start <= i < stop:
* sent.append(self.id2word[self.data.arr[i]]) # <<<<<<<<<<<<<<
@@ -7783,7 +7803,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence(struct __pyx_obj_3_sa_Da
__pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":43
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":43
* start = self.sent_index.arr[i]
* stop = self.sent_index.arr[i+1]
* for i from start <= i < stop: # <<<<<<<<<<<<<<
@@ -7796,7 +7816,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_6get_sentence(struct __pyx_obj_3_sa_Da
__pyx_v_i = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":45
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":45
* for i from start <= i < stop:
* sent.append(self.id2word[self.data.arr[i]])
* return sent # <<<<<<<<<<<<<<
@@ -7833,7 +7853,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_9get_id(PyObject *__pyx_v_self, PyObje
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":47
+/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":47
* return sent
*
* def get_id(self, word): # <<<<<<<<<<<<<<
@@ -7853,7 +7873,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_8get_id(struct __pyx_obj_3_sa_DataArra
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_id", 0);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":48
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":48
*
* def get_id(self, word):
* if not word in self.word2id: # <<<<<<<<<<<<<<
@@ -7864,7 +7884,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_8get_id(struct __pyx_obj_3_sa_DataArra
__pyx_t_2 = (!__pyx_t_1);
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":49
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":49
* def get_id(self, word):
* if not word in self.word2id:
* self.word2id[word] = len(self.id2word) # <<<<<<<<<<<<<<
@@ -7880,7 +7900,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_8get_id(struct __pyx_obj_3_sa_DataArra
if (PyObject_SetItem(__pyx_v_self->word2id, __pyx_v_word, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":50
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":50
* if not word in self.word2id:
* self.word2id[word] = len(self.id2word)
* self.id2word.append(word) # <<<<<<<<<<<<<<
@@ -7894,7 +7914,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_8get_id(struct __pyx_obj_3_sa_DataArra
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":51
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":51
* self.word2id[word] = len(self.id2word)
* self.id2word.append(word)
* return self.word2id[word] # <<<<<<<<<<<<<<
@@ -7931,7 +7951,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_11__getitem__(PyObject *__pyx_v_self,
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":53
+/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":53
* return self.word2id[word]
*
* def __getitem__(self, loc): # <<<<<<<<<<<<<<
@@ -7949,7 +7969,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_10__getitem__(struct __pyx_obj_3_sa_Da
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getitem__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":54
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":54
*
* def __getitem__(self, loc):
* return self.id2word[self.data.arr[loc]] # <<<<<<<<<<<<<<
@@ -7987,7 +8007,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_13get_sentence_bounds(PyObject *__pyx_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":56
+/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":56
* return self.id2word[self.data.arr[loc]]
*
* def get_sentence_bounds(self, loc): # <<<<<<<<<<<<<<
@@ -8008,7 +8028,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_12get_sentence_bounds(struct __pyx_obj
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_sentence_bounds", 0);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":57
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":57
*
* def get_sentence_bounds(self, loc):
* cdef int sid = self.sent_id.arr[loc] # <<<<<<<<<<<<<<
@@ -8018,7 +8038,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_12get_sentence_bounds(struct __pyx_obj
__pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_loc); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_sid = (__pyx_v_self->sent_id->arr[__pyx_t_1]);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":58
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":58
* def get_sentence_bounds(self, loc):
* cdef int sid = self.sent_id.arr[loc]
* return (self.sent_index.arr[sid], self.sent_index.arr[sid+1]) # <<<<<<<<<<<<<<
@@ -8077,7 +8097,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_15write_text(PyObject *__pyx_v_self, P
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":60
+/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":60
* return (self.sent_index.arr[sid], self.sent_index.arr[sid+1])
*
* def write_text(self, char* filename): # <<<<<<<<<<<<<<
@@ -8109,7 +8129,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_text(struct __pyx_obj_3_sa_Dat
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_text", 0);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":61
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":61
*
* def write_text(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -8149,7 +8169,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_text(struct __pyx_obj_3_sa_Dat
__pyx_v_f = __pyx_t_4;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":62
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":62
* def write_text(self, char* filename):
* with open(filename, "w") as f:
* for w_id in self.data: # <<<<<<<<<<<<<<
@@ -8194,7 +8214,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_text(struct __pyx_obj_3_sa_Dat
__pyx_v_w_id = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":63
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":63
* with open(filename, "w") as f:
* for w_id in self.data:
* if w_id > 1: # <<<<<<<<<<<<<<
@@ -8206,7 +8226,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_text(struct __pyx_obj_3_sa_Dat
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_10) {
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":64
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":64
* for w_id in self.data:
* if w_id > 1:
* f.write("%s " % self.get_word(w_id)) # <<<<<<<<<<<<<<
@@ -8243,7 +8263,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_text(struct __pyx_obj_3_sa_Dat
}
__pyx_L18:;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":65
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":65
* if w_id > 1:
* f.write("%s " % self.get_word(w_id))
* if w_id == 1: # <<<<<<<<<<<<<<
@@ -8255,7 +8275,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_text(struct __pyx_obj_3_sa_Dat
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
if (__pyx_t_10) {
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":66
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":66
* f.write("%s " % self.get_word(w_id))
* if w_id == 1:
* f.write("\n") # <<<<<<<<<<<<<<
@@ -8285,7 +8305,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_14write_text(struct __pyx_obj_3_sa_Dat
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":61
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":61
*
* def write_text(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -8404,7 +8424,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_17read_text(PyObject *__pyx_v_self, Py
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":68
+/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":68
* f.write("\n")
*
* def read_text(self, char* filename): # <<<<<<<<<<<<<<
@@ -8432,7 +8452,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16read_text(struct __pyx_obj_3_sa_Data
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_text", 0);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":69
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":69
*
* def read_text(self, char* filename):
* with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<<
@@ -8472,7 +8492,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16read_text(struct __pyx_obj_3_sa_Data
__pyx_v_fp = __pyx_t_1;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":70
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":70
* def read_text(self, char* filename):
* with gzip_or_text(filename) as fp:
* self.read_text_data(fp) # <<<<<<<<<<<<<<
@@ -8501,7 +8521,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_16read_text(struct __pyx_obj_3_sa_Data
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":69
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":69
*
* def read_text(self, char* filename):
* with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<<
@@ -8654,7 +8674,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_19read_bitext(PyObject *__pyx_v_self,
}
static PyObject *__pyx_gb_3_sa_9DataArray_11read_bitext_2generator6(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":74
+/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":74
* def read_bitext(self, char* filename, int side):
* with gzip_or_text(filename) as fp:
* data = (line.split(' ||| ')[side] for line in fp) # <<<<<<<<<<<<<<
@@ -8801,7 +8821,7 @@ static PyObject *__pyx_gb_3_sa_9DataArray_11read_bitext_2generator6(__pyx_Genera
return NULL;
}
-/* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":72
+/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":72
* self.read_text_data(fp)
*
* def read_bitext(self, char* filename, int side): # <<<<<<<<<<<<<<
@@ -8837,7 +8857,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_bitext(struct __pyx_obj_3_sa_Da
__Pyx_GOTREF(__pyx_cur_scope);
__pyx_cur_scope->__pyx_v_side = __pyx_v_side;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":73
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":73
*
* def read_bitext(self, char* filename, int side):
* with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<<
@@ -8878,7 +8898,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_bitext(struct __pyx_obj_3_sa_Da
__pyx_cur_scope->__pyx_v_fp = __pyx_t_1;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":74
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":74
* def read_bitext(self, char* filename, int side):
* with gzip_or_text(filename) as fp:
* data = (line.split(' ||| ')[side] for line in fp) # <<<<<<<<<<<<<<
@@ -8890,7 +8910,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_bitext(struct __pyx_obj_3_sa_Da
__pyx_v_data = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":75
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":75
* with gzip_or_text(filename) as fp:
* data = (line.split(' ||| ')[side] for line in fp)
* self.read_text_data(data) # <<<<<<<<<<<<<<
@@ -8919,7 +8939,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_18read_bitext(struct __pyx_obj_3_sa_Da
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":73
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":73
*
* def read_bitext(self, char* filename, int side):
* with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<<
@@ -9027,7 +9047,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_21read_text_data(PyObject *__pyx_v_sel
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":77
+/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":77
* self.read_text_data(data)
*
* def read_text_data(self, data): # <<<<<<<<<<<<<<
@@ -9057,7 +9077,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_text_data", 0);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":78
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":78
*
* def read_text_data(self, data):
* cdef int word_count = 0 # <<<<<<<<<<<<<<
@@ -9066,7 +9086,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa
*/
__pyx_v_word_count = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":79
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":79
* def read_text_data(self, data):
* cdef int word_count = 0
* for line_num, line in enumerate(data): # <<<<<<<<<<<<<<
@@ -9121,7 +9141,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa
__pyx_t_1 = __pyx_t_5;
__pyx_t_5 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":80
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":80
* cdef int word_count = 0
* for line_num, line in enumerate(data):
* self.sent_index.append(word_count) # <<<<<<<<<<<<<<
@@ -9135,7 +9155,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":81
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":81
* for line_num, line in enumerate(data):
* self.sent_index.append(word_count)
* for word in line.split(): # <<<<<<<<<<<<<<
@@ -9186,7 +9206,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa
__pyx_v_word = __pyx_t_5;
__pyx_t_5 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":82
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":82
* self.sent_index.append(word_count)
* for word in line.split():
* self.data.append(self.get_id(word)) # <<<<<<<<<<<<<<
@@ -9209,7 +9229,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":83
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":83
* for word in line.split():
* self.data.append(self.get_id(word))
* if self.use_sent_id: # <<<<<<<<<<<<<<
@@ -9218,7 +9238,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa
*/
if (__pyx_v_self->use_sent_id) {
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":84
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":84
* self.data.append(self.get_id(word))
* if self.use_sent_id:
* self.sent_id.append(line_num) # <<<<<<<<<<<<<<
@@ -9232,7 +9252,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa
}
__pyx_L7:;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":85
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":85
* if self.use_sent_id:
* self.sent_id.append(line_num)
* word_count = word_count + 1 # <<<<<<<<<<<<<<
@@ -9243,7 +9263,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":86
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":86
* self.sent_id.append(line_num)
* word_count = word_count + 1
* self.data.append(1) # <<<<<<<<<<<<<<
@@ -9254,7 +9274,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":87
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":87
* word_count = word_count + 1
* self.data.append(1)
* if self.use_sent_id: # <<<<<<<<<<<<<<
@@ -9263,7 +9283,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa
*/
if (__pyx_v_self->use_sent_id) {
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":88
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":88
* self.data.append(1)
* if self.use_sent_id:
* self.sent_id.append(line_num) # <<<<<<<<<<<<<<
@@ -9277,7 +9297,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa
}
__pyx_L8:;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":89
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":89
* if self.use_sent_id:
* self.sent_id.append(line_num)
* word_count = word_count + 1 # <<<<<<<<<<<<<<
@@ -9289,7 +9309,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":90
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":90
* self.sent_id.append(line_num)
* word_count = word_count + 1
* self.data.append(0) # <<<<<<<<<<<<<<
@@ -9300,7 +9320,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_20read_text_data(struct __pyx_obj_3_sa
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":91
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":91
* word_count = word_count + 1
* self.data.append(0)
* self.sent_index.append(word_count) # <<<<<<<<<<<<<<
@@ -9355,7 +9375,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_23read_binary(PyObject *__pyx_v_self,
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":94
+/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":94
*
*
* def read_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -9369,7 +9389,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_binary(struct __pyx_obj_3_sa_Da
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_binary", 0);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":96
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":96
* def read_binary(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "r") # <<<<<<<<<<<<<<
@@ -9378,7 +9398,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_binary(struct __pyx_obj_3_sa_Da
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":97
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":97
* cdef FILE* f
* f = fopen(filename, "r")
* self.read_handle(f) # <<<<<<<<<<<<<<
@@ -9387,7 +9407,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_binary(struct __pyx_obj_3_sa_Da
*/
((struct __pyx_vtabstruct_3_sa_DataArray *)__pyx_v_self->__pyx_vtab)->read_handle(__pyx_v_self, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":98
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":98
* f = fopen(filename, "r")
* self.read_handle(f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -9402,7 +9422,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_22read_binary(struct __pyx_obj_3_sa_Da
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":100
+/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":100
* fclose(f)
*
* cdef void read_handle(self, FILE* f): # <<<<<<<<<<<<<<
@@ -9427,7 +9447,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_handle", 0);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":105
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":105
* cdef char* word
*
* self.data.read_handle(f) # <<<<<<<<<<<<<<
@@ -9436,7 +9456,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->data->__pyx_vtab)->read_handle(__pyx_v_self->data, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":106
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":106
*
* self.data.read_handle(f)
* self.sent_index.read_handle(f) # <<<<<<<<<<<<<<
@@ -9445,7 +9465,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sent_index->__pyx_vtab)->read_handle(__pyx_v_self->sent_index, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":107
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":107
* self.data.read_handle(f)
* self.sent_index.read_handle(f)
* self.sent_id.read_handle(f) # <<<<<<<<<<<<<<
@@ -9454,7 +9474,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sent_id->__pyx_vtab)->read_handle(__pyx_v_self->sent_id, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":108
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":108
* self.sent_index.read_handle(f)
* self.sent_id.read_handle(f)
* fread(&(num_words), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -9463,7 +9483,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray
*/
fread((&__pyx_v_num_words), (sizeof(int)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":109
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":109
* self.sent_id.read_handle(f)
* fread(&(num_words), sizeof(int), 1, f)
* for i in range(num_words): # <<<<<<<<<<<<<<
@@ -9474,7 +9494,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":110
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":110
* fread(&(num_words), sizeof(int), 1, f)
* for i in range(num_words):
* fread(&(word_len), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -9483,7 +9503,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray
*/
fread((&__pyx_v_word_len), (sizeof(int)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":111
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":111
* for i in range(num_words):
* fread(&(word_len), sizeof(int), 1, f)
* word = <char*> malloc (word_len * sizeof(char)) # <<<<<<<<<<<<<<
@@ -9492,7 +9512,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray
*/
__pyx_v_word = ((char *)malloc((__pyx_v_word_len * (sizeof(char)))));
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":112
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":112
* fread(&(word_len), sizeof(int), 1, f)
* word = <char*> malloc (word_len * sizeof(char))
* fread(word, sizeof(char), word_len, f) # <<<<<<<<<<<<<<
@@ -9501,7 +9521,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray
*/
fread(__pyx_v_word, (sizeof(char)), __pyx_v_word_len, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":113
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":113
* word = <char*> malloc (word_len * sizeof(char))
* fread(word, sizeof(char), word_len, f)
* self.word2id[word] = len(self.id2word) # <<<<<<<<<<<<<<
@@ -9520,7 +9540,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":114
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":114
* fread(word, sizeof(char), word_len, f)
* self.word2id[word] = len(self.id2word)
* self.id2word.append(word) # <<<<<<<<<<<<<<
@@ -9534,7 +9554,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":115
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":115
* self.word2id[word] = len(self.id2word)
* self.id2word.append(word)
* free(word) # <<<<<<<<<<<<<<
@@ -9544,7 +9564,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray
free(__pyx_v_word);
}
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":116
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":116
* self.id2word.append(word)
* free(word)
* if len(self.sent_id) == 0: # <<<<<<<<<<<<<<
@@ -9558,7 +9578,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray
__pyx_t_6 = (__pyx_t_4 == 0);
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":117
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":117
* free(word)
* if len(self.sent_id) == 0:
* self.use_sent_id = False # <<<<<<<<<<<<<<
@@ -9570,7 +9590,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":119
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":119
* self.use_sent_id = False
* else:
* self.use_sent_id = True # <<<<<<<<<<<<<<
@@ -9590,7 +9610,7 @@ static void __pyx_f_3_sa_9DataArray_read_handle(struct __pyx_obj_3_sa_DataArray
__Pyx_RefNannyFinishContext();
}
-/* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":121
+/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":121
* self.use_sent_id = True
*
* cdef void write_handle(self, FILE* f): # <<<<<<<<<<<<<<
@@ -9614,7 +9634,7 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_handle", 0);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":125
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":125
* cdef int num_words
*
* self.data.write_handle(f) # <<<<<<<<<<<<<<
@@ -9623,7 +9643,7 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->data->__pyx_vtab)->write_handle(__pyx_v_self->data, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":126
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":126
*
* self.data.write_handle(f)
* self.sent_index.write_handle(f) # <<<<<<<<<<<<<<
@@ -9632,7 +9652,7 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sent_index->__pyx_vtab)->write_handle(__pyx_v_self->sent_index, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":127
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":127
* self.data.write_handle(f)
* self.sent_index.write_handle(f)
* self.sent_id.write_handle(f) # <<<<<<<<<<<<<<
@@ -9641,7 +9661,7 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sent_id->__pyx_vtab)->write_handle(__pyx_v_self->sent_id, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":128
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":128
* self.sent_index.write_handle(f)
* self.sent_id.write_handle(f)
* num_words = len(self.id2word) - 2 # <<<<<<<<<<<<<<
@@ -9654,7 +9674,7 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_num_words = (__pyx_t_2 - 2);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":129
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":129
* self.sent_id.write_handle(f)
* num_words = len(self.id2word) - 2
* fwrite(&(num_words), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -9663,7 +9683,7 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray
*/
fwrite((&__pyx_v_num_words), (sizeof(int)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":130
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":130
* num_words = len(self.id2word) - 2
* fwrite(&(num_words), sizeof(int), 1, f)
* for word in self.id2word[2:]: # <<<<<<<<<<<<<<
@@ -9711,7 +9731,7 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray
__pyx_v_word = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":131
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":131
* fwrite(&(num_words), sizeof(int), 1, f)
* for word in self.id2word[2:]:
* word_len = len(word) + 1 # <<<<<<<<<<<<<<
@@ -9721,7 +9741,7 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray
__pyx_t_5 = PyObject_Length(__pyx_v_word); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_word_len = (__pyx_t_5 + 1);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":132
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":132
* for word in self.id2word[2:]:
* word_len = len(word) + 1
* fwrite(&(word_len), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -9730,7 +9750,7 @@ static void __pyx_f_3_sa_9DataArray_write_handle(struct __pyx_obj_3_sa_DataArray
*/
fwrite((&__pyx_v_word_len), (sizeof(int)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":133
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":133
* word_len = len(word) + 1
* fwrite(&(word_len), sizeof(int), 1, f)
* fwrite(<char *>word, sizeof(char), word_len, f) # <<<<<<<<<<<<<<
@@ -9773,7 +9793,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_25write_binary(PyObject *__pyx_v_self,
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":135
+/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":135
* fwrite(<char *>word, sizeof(char), word_len, f)
*
* def write_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -9787,7 +9807,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_24write_binary(struct __pyx_obj_3_sa_D
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write_binary", 0);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":137
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":137
* def write_binary(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "w") # <<<<<<<<<<<<<<
@@ -9796,7 +9816,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_24write_binary(struct __pyx_obj_3_sa_D
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":138
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":138
* cdef FILE* f
* f = fopen(filename, "w")
* self.write_handle(f) # <<<<<<<<<<<<<<
@@ -9805,7 +9825,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_24write_binary(struct __pyx_obj_3_sa_D
*/
((struct __pyx_vtabstruct_3_sa_DataArray *)__pyx_v_self->__pyx_vtab)->write_handle(__pyx_v_self, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":139
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":139
* f = fopen(filename, "w")
* self.write_handle(f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -9831,7 +9851,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_27write_enhanced_handle(PyObject *__py
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":141
+/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":141
* fclose(f)
*
* def write_enhanced_handle(self, f): # <<<<<<<<<<<<<<
@@ -9855,7 +9875,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_enhanced_handle", 0);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":142
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":142
*
* def write_enhanced_handle(self, f):
* for i in self.data: # <<<<<<<<<<<<<<
@@ -9900,7 +9920,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o
__pyx_v_i = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":143
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":143
* def write_enhanced_handle(self, f):
* for i in self.data:
* f.write("%d " %i) # <<<<<<<<<<<<<<
@@ -9924,7 +9944,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":144
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":144
* for i in self.data:
* f.write("%d " %i)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -9938,7 +9958,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":145
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":145
* f.write("%d " %i)
* f.write("\n")
* for i in self.sent_index: # <<<<<<<<<<<<<<
@@ -9983,7 +10003,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o
__pyx_v_i = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":146
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":146
* f.write("\n")
* for i in self.sent_index:
* f.write("%d " %i) # <<<<<<<<<<<<<<
@@ -10007,7 +10027,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":147
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":147
* for i in self.sent_index:
* f.write("%d " %i)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -10021,7 +10041,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":148
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":148
* f.write("%d " %i)
* f.write("\n")
* for i in self.sent_id: # <<<<<<<<<<<<<<
@@ -10066,7 +10086,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o
__pyx_v_i = __pyx_t_5;
__pyx_t_5 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":149
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":149
* f.write("\n")
* for i in self.sent_id:
* f.write("%d " %i) # <<<<<<<<<<<<<<
@@ -10090,7 +10110,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":150
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":150
* for i in self.sent_id:
* f.write("%d " %i)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -10104,7 +10124,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":151
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":151
* f.write("%d " %i)
* f.write("\n")
* for word in self.id2word: # <<<<<<<<<<<<<<
@@ -10149,7 +10169,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o
__pyx_v_word = __pyx_t_6;
__pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":152
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":152
* f.write("\n")
* for word in self.id2word:
* f.write("%s %d " % (word, self.word2id[word])) # <<<<<<<<<<<<<<
@@ -10184,7 +10204,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_26write_enhanced_handle(struct __pyx_o
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":153
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":153
* for word in self.id2word:
* f.write("%s %d " % (word, self.word2id[word]))
* f.write("\n") # <<<<<<<<<<<<<<
@@ -10236,7 +10256,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_29write_enhanced(PyObject *__pyx_v_sel
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":155
+/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":155
* f.write("\n")
*
* def write_enhanced(self, char* filename): # <<<<<<<<<<<<<<
@@ -10264,7 +10284,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced(struct __pyx_obj_3_sa
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_enhanced", 0);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":156
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":156
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -10303,7 +10323,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced(struct __pyx_obj_3_sa
__pyx_v_f = __pyx_t_4;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":157
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":157
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f:
* self.write_enhanced_handle(self, f) # <<<<<<<<<<<<<<
@@ -10333,7 +10353,7 @@ static PyObject *__pyx_pf_3_sa_9DataArray_28write_enhanced(struct __pyx_obj_3_sa
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":156
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":156
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -10439,7 +10459,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_7word2id_1__get__(PyObject *__pyx_v_se
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":10
+/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":10
*
* cdef class DataArray:
* cdef public word2id # <<<<<<<<<<<<<<
@@ -10526,7 +10546,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_7id2word_1__get__(PyObject *__pyx_v_se
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":11
+/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":11
* cdef class DataArray:
* cdef public word2id
* cdef public id2word # <<<<<<<<<<<<<<
@@ -10613,7 +10633,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_4data_1__get__(PyObject *__pyx_v_self)
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":12
+/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":12
* cdef public word2id
* cdef public id2word
* cdef public IntList data # <<<<<<<<<<<<<<
@@ -10709,7 +10729,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_7sent_id_1__get__(PyObject *__pyx_v_se
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":13
+/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":13
* cdef public id2word
* cdef public IntList data
* cdef public IntList sent_id # <<<<<<<<<<<<<<
@@ -10805,7 +10825,7 @@ static PyObject *__pyx_pw_3_sa_9DataArray_10sent_index_1__get__(PyObject *__pyx_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":14
+/* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":14
* cdef public IntList data
* cdef public IntList sent_id
* cdef public IntList sent_index # <<<<<<<<<<<<<<
@@ -10890,7 +10910,7 @@ static int __pyx_pf_3_sa_9DataArray_10sent_index_4__del__(struct __pyx_obj_3_sa_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":12
+/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":12
* cdef IntList sent_index
*
* cdef int link(self, int i, int j): # <<<<<<<<<<<<<<
@@ -10903,7 +10923,7 @@ static int __pyx_f_3_sa_9Alignment_link(CYTHON_UNUSED struct __pyx_obj_3_sa_Alig
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("link", 0);
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":14
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":14
* cdef int link(self, int i, int j):
* """Integerizes an alignment link pair"""
* return i*65536 + j # <<<<<<<<<<<<<<
@@ -10931,7 +10951,7 @@ static PyObject *__pyx_pw_3_sa_9Alignment_1unlink(PyObject *__pyx_v_self, PyObje
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":16
+/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":16
* return i*65536 + j
*
* def unlink(self, link): # <<<<<<<<<<<<<<
@@ -10950,7 +10970,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_unlink(CYTHON_UNUSED struct __pyx_obj_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("unlink", 0);
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":18
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":18
* def unlink(self, link):
* """De-integerizes an alignment link pair"""
* return (link/65536, link%65536) # <<<<<<<<<<<<<<
@@ -10988,7 +11008,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_unlink(CYTHON_UNUSED struct __pyx_obj_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":20
+/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":20
* return (link/65536, link%65536)
*
* cdef _unlink(self, int link, int* f, int* e): # <<<<<<<<<<<<<<
@@ -11001,7 +11021,7 @@ static PyObject *__pyx_f_3_sa_9Alignment__unlink(CYTHON_UNUSED struct __pyx_obj_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_unlink", 0);
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":21
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":21
*
* cdef _unlink(self, int link, int* f, int* e):
* f[0] = link/65536 # <<<<<<<<<<<<<<
@@ -11010,7 +11030,7 @@ static PyObject *__pyx_f_3_sa_9Alignment__unlink(CYTHON_UNUSED struct __pyx_obj_
*/
(__pyx_v_f[0]) = __Pyx_div_long(__pyx_v_link, 65536);
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":22
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":22
* cdef _unlink(self, int link, int* f, int* e):
* f[0] = link/65536
* e[0] = link%65536 # <<<<<<<<<<<<<<
@@ -11046,7 +11066,7 @@ static PyObject *__pyx_pw_3_sa_9Alignment_3get_sent_links(PyObject *__pyx_v_self
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":24
+/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":24
* e[0] = link%65536
*
* def get_sent_links(self, int sent_id): # <<<<<<<<<<<<<<
@@ -11066,7 +11086,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_2get_sent_links(struct __pyx_obj_3_sa_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_sent_links", 0);
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":28
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":28
* cdef int* arr
* cdef int arr_len
* sent_links = IntList() # <<<<<<<<<<<<<<
@@ -11078,7 +11098,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_2get_sent_links(struct __pyx_obj_3_sa_
__pyx_v_sent_links = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":29
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":29
* cdef int arr_len
* sent_links = IntList()
* arr = self._get_sent_links(sent_id, &arr_len) # <<<<<<<<<<<<<<
@@ -11087,7 +11107,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_2get_sent_links(struct __pyx_obj_3_sa_
*/
__pyx_v_arr = ((struct __pyx_vtabstruct_3_sa_Alignment *)__pyx_v_self->__pyx_vtab)->_get_sent_links(__pyx_v_self, __pyx_v_sent_id, (&__pyx_v_arr_len));
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":30
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":30
* sent_links = IntList()
* arr = self._get_sent_links(sent_id, &arr_len)
* sent_links._extend_arr(arr, arr_len*2) # <<<<<<<<<<<<<<
@@ -11096,7 +11116,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_2get_sent_links(struct __pyx_obj_3_sa_
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_sent_links->__pyx_vtab)->_extend_arr(__pyx_v_sent_links, __pyx_v_arr, (__pyx_v_arr_len * 2));
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":31
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":31
* arr = self._get_sent_links(sent_id, &arr_len)
* sent_links._extend_arr(arr, arr_len*2)
* free(arr) # <<<<<<<<<<<<<<
@@ -11105,7 +11125,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_2get_sent_links(struct __pyx_obj_3_sa_
*/
free(__pyx_v_arr);
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":32
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":32
* sent_links._extend_arr(arr, arr_len*2)
* free(arr)
* return sent_links # <<<<<<<<<<<<<<
@@ -11130,7 +11150,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_2get_sent_links(struct __pyx_obj_3_sa_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":34
+/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":34
* return sent_links
*
* cdef int* _get_sent_links(self, int sent_id, int* num_links): # <<<<<<<<<<<<<<
@@ -11152,7 +11172,7 @@ static int *__pyx_f_3_sa_9Alignment__get_sent_links(struct __pyx_obj_3_sa_Alignm
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_get_sent_links", 0);
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":37
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":37
* cdef int* sent_links
* cdef int i, start, end
* start = self.sent_index.arr[sent_id] # <<<<<<<<<<<<<<
@@ -11161,7 +11181,7 @@ static int *__pyx_f_3_sa_9Alignment__get_sent_links(struct __pyx_obj_3_sa_Alignm
*/
__pyx_v_start = (__pyx_v_self->sent_index->arr[__pyx_v_sent_id]);
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":38
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":38
* cdef int i, start, end
* start = self.sent_index.arr[sent_id]
* end = self.sent_index.arr[sent_id+1] # <<<<<<<<<<<<<<
@@ -11170,7 +11190,7 @@ static int *__pyx_f_3_sa_9Alignment__get_sent_links(struct __pyx_obj_3_sa_Alignm
*/
__pyx_v_end = (__pyx_v_self->sent_index->arr[(__pyx_v_sent_id + 1)]);
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":39
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":39
* start = self.sent_index.arr[sent_id]
* end = self.sent_index.arr[sent_id+1]
* num_links[0] = end - start # <<<<<<<<<<<<<<
@@ -11179,7 +11199,7 @@ static int *__pyx_f_3_sa_9Alignment__get_sent_links(struct __pyx_obj_3_sa_Alignm
*/
(__pyx_v_num_links[0]) = (__pyx_v_end - __pyx_v_start);
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":40
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":40
* end = self.sent_index.arr[sent_id+1]
* num_links[0] = end - start
* sent_links = <int*> malloc(2*num_links[0]*sizeof(int)) # <<<<<<<<<<<<<<
@@ -11188,7 +11208,7 @@ static int *__pyx_f_3_sa_9Alignment__get_sent_links(struct __pyx_obj_3_sa_Alignm
*/
__pyx_v_sent_links = ((int *)malloc(((2 * (__pyx_v_num_links[0])) * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":41
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":41
* num_links[0] = end - start
* sent_links = <int*> malloc(2*num_links[0]*sizeof(int))
* for i from 0 <= i < num_links[0]: # <<<<<<<<<<<<<<
@@ -11198,7 +11218,7 @@ static int *__pyx_f_3_sa_9Alignment__get_sent_links(struct __pyx_obj_3_sa_Alignm
__pyx_t_1 = (__pyx_v_num_links[0]);
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":42
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":42
* sent_links = <int*> malloc(2*num_links[0]*sizeof(int))
* for i from 0 <= i < num_links[0]:
* self._unlink(self.links.arr[start + i], sent_links + (2*i), sent_links + (2*i) + 1) # <<<<<<<<<<<<<<
@@ -11210,7 +11230,7 @@ static int *__pyx_f_3_sa_9Alignment__get_sent_links(struct __pyx_obj_3_sa_Alignm
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":43
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":43
* for i from 0 <= i < num_links[0]:
* self._unlink(self.links.arr[start + i], sent_links + (2*i), sent_links + (2*i) + 1)
* return sent_links # <<<<<<<<<<<<<<
@@ -11243,7 +11263,7 @@ static int __pyx_pw_3_sa_9Alignment_5__cinit__(PyObject *__pyx_v_self, PyObject
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_binary,&__pyx_n_s__from_text,0};
PyObject* values[2] = {0,0};
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":45
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":45
* return sent_links
*
* def __cinit__(self, from_binary=None, from_text=None): # <<<<<<<<<<<<<<
@@ -11313,7 +11333,7 @@ static int __pyx_pf_3_sa_9Alignment_4__cinit__(struct __pyx_obj_3_sa_Alignment *
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":46
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":46
*
* def __cinit__(self, from_binary=None, from_text=None):
* self.links = IntList(1000,1000) # <<<<<<<<<<<<<<
@@ -11328,7 +11348,7 @@ static int __pyx_pf_3_sa_9Alignment_4__cinit__(struct __pyx_obj_3_sa_Alignment *
__pyx_v_self->links = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":47
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":47
* def __cinit__(self, from_binary=None, from_text=None):
* self.links = IntList(1000,1000)
* self.sent_index = IntList(1000,1000) # <<<<<<<<<<<<<<
@@ -11343,7 +11363,7 @@ static int __pyx_pf_3_sa_9Alignment_4__cinit__(struct __pyx_obj_3_sa_Alignment *
__pyx_v_self->sent_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":48
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":48
* self.links = IntList(1000,1000)
* self.sent_index = IntList(1000,1000)
* if from_binary: # <<<<<<<<<<<<<<
@@ -11353,7 +11373,7 @@ static int __pyx_pf_3_sa_9Alignment_4__cinit__(struct __pyx_obj_3_sa_Alignment *
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_binary); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":49
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":49
* self.sent_index = IntList(1000,1000)
* if from_binary:
* self.read_binary(from_binary) # <<<<<<<<<<<<<<
@@ -11375,7 +11395,7 @@ static int __pyx_pf_3_sa_9Alignment_4__cinit__(struct __pyx_obj_3_sa_Alignment *
goto __pyx_L3;
}
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":50
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":50
* if from_binary:
* self.read_binary(from_binary)
* elif from_text: # <<<<<<<<<<<<<<
@@ -11385,7 +11405,7 @@ static int __pyx_pf_3_sa_9Alignment_4__cinit__(struct __pyx_obj_3_sa_Alignment *
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_text); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":51
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":51
* self.read_binary(from_binary)
* elif from_text:
* self.read_text(from_text) # <<<<<<<<<<<<<<
@@ -11442,7 +11462,7 @@ static PyObject *__pyx_pw_3_sa_9Alignment_7read_text(PyObject *__pyx_v_self, PyO
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":53
+/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":53
* self.read_text(from_text)
*
* def read_text(self, char* filename): # <<<<<<<<<<<<<<
@@ -11484,7 +11504,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_text", 0);
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":54
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":54
*
* def read_text(self, char* filename):
* with gzip_or_text(filename) as f: # <<<<<<<<<<<<<<
@@ -11524,7 +11544,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align
__pyx_v_f = __pyx_t_1;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":55
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":55
* def read_text(self, char* filename):
* with gzip_or_text(filename) as f:
* for line in f: # <<<<<<<<<<<<<<
@@ -11569,7 +11589,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align
__pyx_v_line = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":56
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":56
* with gzip_or_text(filename) as f:
* for line in f:
* self.sent_index.append(len(self.links)) # <<<<<<<<<<<<<<
@@ -11587,7 +11607,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":57
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":57
* for line in f:
* self.sent_index.append(len(self.links))
* pairs = line.split() # <<<<<<<<<<<<<<
@@ -11603,7 +11623,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align
__pyx_v_pairs = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":58
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":58
* self.sent_index.append(len(self.links))
* pairs = line.split()
* for pair in pairs: # <<<<<<<<<<<<<<
@@ -11648,7 +11668,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align
__pyx_v_pair = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":59
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":59
* pairs = line.split()
* for pair in pairs:
* (i, j) = map(int, pair.split('-')) # <<<<<<<<<<<<<<
@@ -11727,7 +11747,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align
__pyx_v_j = __pyx_t_13;
__pyx_t_13 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":60
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":60
* for pair in pairs:
* (i, j) = map(int, pair.split('-'))
* self.links.append(self.link(i, j)) # <<<<<<<<<<<<<<
@@ -11747,7 +11767,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":61
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":61
* (i, j) = map(int, pair.split('-'))
* self.links.append(self.link(i, j))
* self.sent_index.append(len(self.links)) # <<<<<<<<<<<<<<
@@ -11777,7 +11797,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_6read_text(struct __pyx_obj_3_sa_Align
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":54
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":54
*
* def read_text(self, char* filename):
* with gzip_or_text(filename) as f: # <<<<<<<<<<<<<<
@@ -11901,7 +11921,7 @@ static PyObject *__pyx_pw_3_sa_9Alignment_9read_binary(PyObject *__pyx_v_self, P
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":63
+/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":63
* self.sent_index.append(len(self.links))
*
* def read_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -11915,7 +11935,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_8read_binary(struct __pyx_obj_3_sa_Ali
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_binary", 0);
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":65
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":65
* def read_binary(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "r") # <<<<<<<<<<<<<<
@@ -11924,7 +11944,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_8read_binary(struct __pyx_obj_3_sa_Ali
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r);
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":66
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":66
* cdef FILE* f
* f = fopen(filename, "r")
* self.links.read_handle(f) # <<<<<<<<<<<<<<
@@ -11933,7 +11953,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_8read_binary(struct __pyx_obj_3_sa_Ali
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->links->__pyx_vtab)->read_handle(__pyx_v_self->links, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":67
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":67
* f = fopen(filename, "r")
* self.links.read_handle(f)
* self.sent_index.read_handle(f) # <<<<<<<<<<<<<<
@@ -11942,7 +11962,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_8read_binary(struct __pyx_obj_3_sa_Ali
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sent_index->__pyx_vtab)->read_handle(__pyx_v_self->sent_index, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":68
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":68
* self.links.read_handle(f)
* self.sent_index.read_handle(f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -11978,7 +11998,7 @@ static PyObject *__pyx_pw_3_sa_9Alignment_11write_text(PyObject *__pyx_v_self, P
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":70
+/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":70
* fclose(f)
*
* def write_text(self, char* filename): # <<<<<<<<<<<<<<
@@ -12013,7 +12033,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_text", 0);
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":71
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":71
*
* def write_text(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -12053,7 +12073,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali
__pyx_v_f = __pyx_t_4;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":72
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":72
* def write_text(self, char* filename):
* with open(filename, "w") as f:
* sent_num = 0 # <<<<<<<<<<<<<<
@@ -12063,7 +12083,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali
__Pyx_INCREF(__pyx_int_0);
__pyx_v_sent_num = __pyx_int_0;
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":73
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":73
* with open(filename, "w") as f:
* sent_num = 0
* for i, link in enumerate(self.links): # <<<<<<<<<<<<<<
@@ -12118,7 +12138,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali
__pyx_t_4 = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":74
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":74
* sent_num = 0
* for i, link in enumerate(self.links):
* while i >= self.sent_index[sent_num]: # <<<<<<<<<<<<<<
@@ -12134,7 +12154,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (!__pyx_t_11) break;
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":75
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":75
* for i, link in enumerate(self.links):
* while i >= self.sent_index[sent_num]:
* f.write("\n") # <<<<<<<<<<<<<<
@@ -12148,7 +12168,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":76
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":76
* while i >= self.sent_index[sent_num]:
* f.write("\n")
* sent_num = sent_num + 1 # <<<<<<<<<<<<<<
@@ -12162,7 +12182,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali
__pyx_t_2 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":77
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":77
* f.write("\n")
* sent_num = sent_num + 1
* f.write("%d-%d " % self.unlink(link)) # <<<<<<<<<<<<<<
@@ -12199,7 +12219,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":78
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":78
* sent_num = sent_num + 1
* f.write("%d-%d " % self.unlink(link))
* f.write("\n") # <<<<<<<<<<<<<<
@@ -12225,7 +12245,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_10write_text(struct __pyx_obj_3_sa_Ali
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":71
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":71
*
* def write_text(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -12347,7 +12367,7 @@ static PyObject *__pyx_pw_3_sa_9Alignment_13write_binary(PyObject *__pyx_v_self,
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":80
+/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":80
* f.write("\n")
*
* def write_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -12361,7 +12381,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_12write_binary(struct __pyx_obj_3_sa_A
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write_binary", 0);
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":82
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":82
* def write_binary(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "w") # <<<<<<<<<<<<<<
@@ -12370,7 +12390,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_12write_binary(struct __pyx_obj_3_sa_A
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w);
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":83
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":83
* cdef FILE* f
* f = fopen(filename, "w")
* self.links.write_handle(f) # <<<<<<<<<<<<<<
@@ -12379,7 +12399,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_12write_binary(struct __pyx_obj_3_sa_A
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->links->__pyx_vtab)->write_handle(__pyx_v_self->links, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":84
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":84
* f = fopen(filename, "w")
* self.links.write_handle(f)
* self.sent_index.write_handle(f) # <<<<<<<<<<<<<<
@@ -12388,7 +12408,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_12write_binary(struct __pyx_obj_3_sa_A
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sent_index->__pyx_vtab)->write_handle(__pyx_v_self->sent_index, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":85
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":85
* self.links.write_handle(f)
* self.sent_index.write_handle(f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -12424,7 +12444,7 @@ static PyObject *__pyx_pw_3_sa_9Alignment_15write_enhanced(PyObject *__pyx_v_sel
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":87
+/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":87
* fclose(f)
*
* def write_enhanced(self, char* filename): # <<<<<<<<<<<<<<
@@ -12457,7 +12477,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_enhanced", 0);
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":88
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":88
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -12497,7 +12517,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa
__pyx_v_f = __pyx_t_4;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":89
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":89
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f:
* sent_num = 1 # <<<<<<<<<<<<<<
@@ -12506,7 +12526,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa
*/
__pyx_v_sent_num = 1;
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":90
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":90
* with open(filename, "w") as f:
* sent_num = 1
* for link in self.links: # <<<<<<<<<<<<<<
@@ -12551,7 +12571,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa
__pyx_v_link = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":91
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":91
* sent_num = 1
* for link in self.links:
* f.write("%d " % link) # <<<<<<<<<<<<<<
@@ -12575,7 +12595,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":92
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":92
* for link in self.links:
* f.write("%d " % link)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -12589,7 +12609,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":93
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":93
* f.write("%d " % link)
* f.write("\n")
* for i in self.sent_index: # <<<<<<<<<<<<<<
@@ -12634,7 +12654,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa
__pyx_v_i = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":94
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":94
* f.write("\n")
* for i in self.sent_index:
* f.write("%d " % i) # <<<<<<<<<<<<<<
@@ -12658,7 +12678,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":95
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":95
* for i in self.sent_index:
* f.write("%d " % i)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -12682,7 +12702,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_14write_enhanced(struct __pyx_obj_3_sa
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":88
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":88
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -12792,7 +12812,7 @@ static PyObject *__pyx_pw_3_sa_9Alignment_17alignment(PyObject *__pyx_v_self, Py
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":97
+/* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":97
* f.write("\n")
*
* def alignment(self, i): # <<<<<<<<<<<<<<
@@ -12818,7 +12838,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_16alignment(struct __pyx_obj_3_sa_Alig
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("alignment", 0);
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":100
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":100
* """Return all (e,f) pairs for sentence i"""
* cdef int j, start, end
* result = [] # <<<<<<<<<<<<<<
@@ -12830,7 +12850,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_16alignment(struct __pyx_obj_3_sa_Alig
__pyx_v_result = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":101
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":101
* cdef int j, start, end
* result = []
* start = self.sent_index.arr[i] # <<<<<<<<<<<<<<
@@ -12840,7 +12860,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_16alignment(struct __pyx_obj_3_sa_Alig
__pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_start = (__pyx_v_self->sent_index->arr[__pyx_t_2]);
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":102
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":102
* result = []
* start = self.sent_index.arr[i]
* end = self.sent_index.arr[i+1] # <<<<<<<<<<<<<<
@@ -12853,7 +12873,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_16alignment(struct __pyx_obj_3_sa_Alig
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_end = (__pyx_v_self->sent_index->arr[__pyx_t_2]);
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":103
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":103
* start = self.sent_index.arr[i]
* end = self.sent_index.arr[i+1]
* for j from start <= j < end: # <<<<<<<<<<<<<<
@@ -12863,7 +12883,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_16alignment(struct __pyx_obj_3_sa_Alig
__pyx_t_3 = __pyx_v_end;
for (__pyx_v_j = __pyx_v_start; __pyx_v_j < __pyx_t_3; __pyx_v_j++) {
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":104
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":104
* end = self.sent_index.arr[i+1]
* for j from start <= j < end:
* result.append(self.unlink(self.links.arr[j])) # <<<<<<<<<<<<<<
@@ -12886,7 +12906,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_16alignment(struct __pyx_obj_3_sa_Alig
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":105
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":105
* for j from start <= j < end:
* result.append(self.unlink(self.links.arr[j]))
* return result # <<<<<<<<<<<<<<
@@ -12911,7 +12931,7 @@ static PyObject *__pyx_pf_3_sa_9Alignment_16alignment(struct __pyx_obj_3_sa_Alig
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":15
+/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":15
* int val
*
* cdef _node* new_node(int key): # <<<<<<<<<<<<<<
@@ -12925,7 +12945,7 @@ static struct __pyx_t_3_sa__node *__pyx_f_3_sa_new_node(int __pyx_v_key) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("new_node", 0);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":17
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":17
* cdef _node* new_node(int key):
* cdef _node* n
* n = <_node*> malloc(sizeof(_node)) # <<<<<<<<<<<<<<
@@ -12934,7 +12954,7 @@ static struct __pyx_t_3_sa__node *__pyx_f_3_sa_new_node(int __pyx_v_key) {
*/
__pyx_v_n = ((struct __pyx_t_3_sa__node *)malloc((sizeof(struct __pyx_t_3_sa__node))));
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":18
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":18
* cdef _node* n
* n = <_node*> malloc(sizeof(_node))
* n.smaller = NULL # <<<<<<<<<<<<<<
@@ -12943,7 +12963,7 @@ static struct __pyx_t_3_sa__node *__pyx_f_3_sa_new_node(int __pyx_v_key) {
*/
__pyx_v_n->smaller = NULL;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":19
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":19
* n = <_node*> malloc(sizeof(_node))
* n.smaller = NULL
* n.bigger = NULL # <<<<<<<<<<<<<<
@@ -12952,7 +12972,7 @@ static struct __pyx_t_3_sa__node *__pyx_f_3_sa_new_node(int __pyx_v_key) {
*/
__pyx_v_n->bigger = NULL;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":20
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":20
* n.smaller = NULL
* n.bigger = NULL
* n.key = key # <<<<<<<<<<<<<<
@@ -12961,7 +12981,7 @@ static struct __pyx_t_3_sa__node *__pyx_f_3_sa_new_node(int __pyx_v_key) {
*/
__pyx_v_n->key = __pyx_v_key;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":21
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":21
* n.bigger = NULL
* n.key = key
* n.val = 0 # <<<<<<<<<<<<<<
@@ -12970,7 +12990,7 @@ static struct __pyx_t_3_sa__node *__pyx_f_3_sa_new_node(int __pyx_v_key) {
*/
__pyx_v_n->val = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":22
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":22
* n.key = key
* n.val = 0
* return n # <<<<<<<<<<<<<<
@@ -12986,7 +13006,7 @@ static struct __pyx_t_3_sa__node *__pyx_f_3_sa_new_node(int __pyx_v_key) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":25
+/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":25
*
*
* cdef del_node(_node* n): # <<<<<<<<<<<<<<
@@ -13004,7 +13024,7 @@ static PyObject *__pyx_f_3_sa_del_node(struct __pyx_t_3_sa__node *__pyx_v_n) {
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("del_node", 0);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":26
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":26
*
* cdef del_node(_node* n):
* if n.smaller != NULL: # <<<<<<<<<<<<<<
@@ -13014,7 +13034,7 @@ static PyObject *__pyx_f_3_sa_del_node(struct __pyx_t_3_sa__node *__pyx_v_n) {
__pyx_t_1 = (__pyx_v_n->smaller != NULL);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":27
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":27
* cdef del_node(_node* n):
* if n.smaller != NULL:
* del_node(n.smaller) # <<<<<<<<<<<<<<
@@ -13028,7 +13048,7 @@ static PyObject *__pyx_f_3_sa_del_node(struct __pyx_t_3_sa__node *__pyx_v_n) {
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":28
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":28
* if n.smaller != NULL:
* del_node(n.smaller)
* if n.bigger != NULL: # <<<<<<<<<<<<<<
@@ -13038,7 +13058,7 @@ static PyObject *__pyx_f_3_sa_del_node(struct __pyx_t_3_sa__node *__pyx_v_n) {
__pyx_t_1 = (__pyx_v_n->bigger != NULL);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":29
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":29
* del_node(n.smaller)
* if n.bigger != NULL:
* del_node(n.bigger) # <<<<<<<<<<<<<<
@@ -13052,7 +13072,7 @@ static PyObject *__pyx_f_3_sa_del_node(struct __pyx_t_3_sa__node *__pyx_v_n) {
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":30
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":30
* if n.bigger != NULL:
* del_node(n.bigger)
* free(n) # <<<<<<<<<<<<<<
@@ -13073,7 +13093,7 @@ static PyObject *__pyx_f_3_sa_del_node(struct __pyx_t_3_sa__node *__pyx_v_n) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":32
+/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":32
* free(n)
*
* cdef int* get_val(_node* n, int key): # <<<<<<<<<<<<<<
@@ -13087,7 +13107,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx
int __pyx_t_1;
__Pyx_RefNannySetupContext("get_val", 0);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":33
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":33
*
* cdef int* get_val(_node* n, int key):
* if key == n.key: # <<<<<<<<<<<<<<
@@ -13097,7 +13117,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx
__pyx_t_1 = (__pyx_v_key == __pyx_v_n->key);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":34
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":34
* cdef int* get_val(_node* n, int key):
* if key == n.key:
* return &n.val # <<<<<<<<<<<<<<
@@ -13109,7 +13129,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx
goto __pyx_L3;
}
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":35
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":35
* if key == n.key:
* return &n.val
* elif key < n.key: # <<<<<<<<<<<<<<
@@ -13119,7 +13139,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx
__pyx_t_1 = (__pyx_v_key < __pyx_v_n->key);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":36
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":36
* return &n.val
* elif key < n.key:
* if n.smaller == NULL: # <<<<<<<<<<<<<<
@@ -13129,7 +13149,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx
__pyx_t_1 = (__pyx_v_n->smaller == NULL);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":37
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":37
* elif key < n.key:
* if n.smaller == NULL:
* n.smaller = new_node(key) # <<<<<<<<<<<<<<
@@ -13138,7 +13158,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx
*/
__pyx_v_n->smaller = __pyx_f_3_sa_new_node(__pyx_v_key);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":38
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":38
* if n.smaller == NULL:
* n.smaller = new_node(key)
* return &(n.smaller.val) # <<<<<<<<<<<<<<
@@ -13151,7 +13171,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":39
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":39
* n.smaller = new_node(key)
* return &(n.smaller.val)
* return get_val(n.smaller, key) # <<<<<<<<<<<<<<
@@ -13164,7 +13184,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":41
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":41
* return get_val(n.smaller, key)
* else:
* if n.bigger == NULL: # <<<<<<<<<<<<<<
@@ -13174,7 +13194,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx
__pyx_t_1 = (__pyx_v_n->bigger == NULL);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":42
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":42
* else:
* if n.bigger == NULL:
* n.bigger = new_node(key) # <<<<<<<<<<<<<<
@@ -13183,7 +13203,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx
*/
__pyx_v_n->bigger = __pyx_f_3_sa_new_node(__pyx_v_key);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":43
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":43
* if n.bigger == NULL:
* n.bigger = new_node(key)
* return &(n.bigger.val) # <<<<<<<<<<<<<<
@@ -13196,7 +13216,7 @@ static int *__pyx_f_3_sa_get_val(struct __pyx_t_3_sa__node *__pyx_v_n, int __pyx
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":44
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":44
* n.bigger = new_node(key)
* return &(n.bigger.val)
* return get_val(n.bigger, key) # <<<<<<<<<<<<<<
@@ -13230,7 +13250,7 @@ static int __pyx_pw_3_sa_5BiLex_1__cinit__(PyObject *__pyx_v_self, PyObject *__p
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_text,&__pyx_n_s__from_data,&__pyx_n_s__from_binary,&__pyx_n_s__earray,&__pyx_n_s__fsarray,&__pyx_n_s__alignment,0};
PyObject* values[6] = {0,0,0,0,0,0};
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":54
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":54
* cdef id2eword, id2fword, eword2id, fword2id
*
* def __cinit__(self, from_text=None, from_data=False, from_binary=None, # <<<<<<<<<<<<<<
@@ -13241,7 +13261,7 @@ static int __pyx_pw_3_sa_5BiLex_1__cinit__(PyObject *__pyx_v_self, PyObject *__p
values[1] = __pyx_k_41;
values[2] = ((PyObject *)Py_None);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":55
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":55
*
* def __cinit__(self, from_text=None, from_data=False, from_binary=None,
* earray=None, fsarray=None, alignment=None): # <<<<<<<<<<<<<<
@@ -13332,7 +13352,7 @@ static int __pyx_pw_3_sa_5BiLex_1__cinit__(PyObject *__pyx_v_self, PyObject *__p
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":54
+/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":54
* cdef id2eword, id2fword, eword2id, fword2id
*
* def __cinit__(self, from_text=None, from_data=False, from_binary=None, # <<<<<<<<<<<<<<
@@ -13353,7 +13373,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":56
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":56
* def __cinit__(self, from_text=None, from_data=False, from_binary=None,
* earray=None, fsarray=None, alignment=None):
* self.id2eword = [] # <<<<<<<<<<<<<<
@@ -13368,7 +13388,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s
__pyx_v_self->id2eword = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":57
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":57
* earray=None, fsarray=None, alignment=None):
* self.id2eword = []
* self.id2fword = [] # <<<<<<<<<<<<<<
@@ -13383,7 +13403,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s
__pyx_v_self->id2fword = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":58
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":58
* self.id2eword = []
* self.id2fword = []
* self.eword2id = {} # <<<<<<<<<<<<<<
@@ -13398,7 +13418,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s
__pyx_v_self->eword2id = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":59
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":59
* self.id2fword = []
* self.eword2id = {}
* self.fword2id = {} # <<<<<<<<<<<<<<
@@ -13413,7 +13433,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s
__pyx_v_self->fword2id = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":60
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":60
* self.eword2id = {}
* self.fword2id = {}
* self.e_index = IntList() # <<<<<<<<<<<<<<
@@ -13428,7 +13448,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s
__pyx_v_self->e_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":61
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":61
* self.fword2id = {}
* self.e_index = IntList()
* self.f_index = IntList() # <<<<<<<<<<<<<<
@@ -13443,7 +13463,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s
__pyx_v_self->f_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":62
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":62
* self.e_index = IntList()
* self.f_index = IntList()
* self.col1 = FloatList() # <<<<<<<<<<<<<<
@@ -13458,7 +13478,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s
__pyx_v_self->col1 = ((struct __pyx_obj_3_sa_FloatList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":63
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":63
* self.f_index = IntList()
* self.col1 = FloatList()
* self.col2 = FloatList() # <<<<<<<<<<<<<<
@@ -13473,7 +13493,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s
__pyx_v_self->col2 = ((struct __pyx_obj_3_sa_FloatList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":64
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":64
* self.col1 = FloatList()
* self.col2 = FloatList()
* if from_binary: # <<<<<<<<<<<<<<
@@ -13483,7 +13503,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_binary); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":65
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":65
* self.col2 = FloatList()
* if from_binary:
* self.read_binary(from_binary) # <<<<<<<<<<<<<<
@@ -13505,7 +13525,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s
goto __pyx_L3;
}
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":66
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":66
* if from_binary:
* self.read_binary(from_binary)
* elif from_data: # <<<<<<<<<<<<<<
@@ -13515,7 +13535,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_data); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":67
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":67
* self.read_binary(from_binary)
* elif from_data:
* self.compute_from_data(fsarray, earray, alignment) # <<<<<<<<<<<<<<
@@ -13541,7 +13561,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":69
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":69
* self.compute_from_data(fsarray, earray, alignment)
* else:
* self.read_text(from_text) # <<<<<<<<<<<<<<
@@ -13577,7 +13597,7 @@ static int __pyx_pf_3_sa_5BiLex___cinit__(struct __pyx_obj_3_sa_BiLex *__pyx_v_s
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":72
+/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":72
*
*
* cdef compute_from_data(self, SuffixArray fsa, DataArray eda, Alignment aa): # <<<<<<<<<<<<<<
@@ -13631,7 +13651,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("compute_from_data", 0);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":79
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":79
* cdef int null_word
*
* null_word = 0 # <<<<<<<<<<<<<<
@@ -13640,7 +13660,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
__pyx_v_null_word = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":80
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":80
*
* null_word = 0
* for word in fsa.darray.id2word: # I miss list comprehensions # <<<<<<<<<<<<<<
@@ -13685,7 +13705,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__pyx_v_word = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":81
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":81
* null_word = 0
* for word in fsa.darray.id2word: # I miss list comprehensions
* self.id2fword.append(word) # <<<<<<<<<<<<<<
@@ -13698,7 +13718,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":82
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":82
* for word in fsa.darray.id2word: # I miss list comprehensions
* self.id2fword.append(word)
* self.id2fword[null_word] = "NULL" # <<<<<<<<<<<<<<
@@ -13707,7 +13727,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
if (__Pyx_SetItemInt(__pyx_v_self->id2fword, __pyx_v_null_word, ((PyObject *)__pyx_n_s__NULL), sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":83
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":83
* self.id2fword.append(word)
* self.id2fword[null_word] = "NULL"
* for id, word in enumerate(self.id2fword): # <<<<<<<<<<<<<<
@@ -13762,7 +13782,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__pyx_t_1 = __pyx_t_5;
__pyx_t_5 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":84
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":84
* self.id2fword[null_word] = "NULL"
* for id, word in enumerate(self.id2fword):
* self.fword2id[word] = id # <<<<<<<<<<<<<<
@@ -13774,7 +13794,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":86
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":86
* self.fword2id[word] = id
*
* for word in eda.id2word: # <<<<<<<<<<<<<<
@@ -13819,7 +13839,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__pyx_v_word = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":87
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":87
*
* for word in eda.id2word:
* self.id2eword.append(word) # <<<<<<<<<<<<<<
@@ -13832,7 +13852,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":88
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":88
* for word in eda.id2word:
* self.id2eword.append(word)
* self.id2eword[null_word] = "NULL" # <<<<<<<<<<<<<<
@@ -13841,7 +13861,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
if (__Pyx_SetItemInt(__pyx_v_self->id2eword, __pyx_v_null_word, ((PyObject *)__pyx_n_s__NULL), sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":89
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":89
* self.id2eword.append(word)
* self.id2eword[null_word] = "NULL"
* for id, word in enumerate(self.id2eword): # <<<<<<<<<<<<<<
@@ -13896,7 +13916,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__pyx_t_1 = __pyx_t_5;
__pyx_t_5 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":90
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":90
* self.id2eword[null_word] = "NULL"
* for id, word in enumerate(self.id2eword):
* self.eword2id[word] = id # <<<<<<<<<<<<<<
@@ -13908,7 +13928,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":92
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":92
* self.eword2id[word] = id
*
* num_pairs = 0 # <<<<<<<<<<<<<<
@@ -13917,7 +13937,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
__pyx_v_num_pairs = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":94
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":94
* num_pairs = 0
*
* V_E = len(eda.id2word) # <<<<<<<<<<<<<<
@@ -13930,7 +13950,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_V_E = __pyx_t_2;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":95
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":95
*
* V_E = len(eda.id2word)
* V_F = len(fsa.darray.id2word) # <<<<<<<<<<<<<<
@@ -13943,7 +13963,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_V_F = __pyx_t_2;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":96
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":96
* V_E = len(eda.id2word)
* V_F = len(fsa.darray.id2word)
* fmargin = <int*> malloc(V_F*sizeof(int)) # <<<<<<<<<<<<<<
@@ -13952,7 +13972,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
__pyx_v_fmargin = ((int *)malloc((__pyx_v_V_F * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":97
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":97
* V_F = len(fsa.darray.id2word)
* fmargin = <int*> malloc(V_F*sizeof(int))
* emargin = <int*> malloc(V_E*sizeof(int)) # <<<<<<<<<<<<<<
@@ -13961,7 +13981,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
__pyx_v_emargin = ((int *)malloc((__pyx_v_V_E * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":98
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":98
* fmargin = <int*> malloc(V_F*sizeof(int))
* emargin = <int*> malloc(V_E*sizeof(int))
* memset(fmargin, 0, V_F*sizeof(int)) # <<<<<<<<<<<<<<
@@ -13970,7 +13990,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
memset(__pyx_v_fmargin, 0, (__pyx_v_V_F * (sizeof(int))));
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":99
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":99
* emargin = <int*> malloc(V_E*sizeof(int))
* memset(fmargin, 0, V_F*sizeof(int))
* memset(emargin, 0, V_E*sizeof(int)) # <<<<<<<<<<<<<<
@@ -13979,7 +13999,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
memset(__pyx_v_emargin, 0, (__pyx_v_V_E * (sizeof(int))));
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":101
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":101
* memset(emargin, 0, V_E*sizeof(int))
*
* dict = <_node**> malloc(V_F*sizeof(_node*)) # <<<<<<<<<<<<<<
@@ -13988,7 +14008,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
__pyx_v_dict = ((struct __pyx_t_3_sa__node **)malloc((__pyx_v_V_F * (sizeof(struct __pyx_t_3_sa__node *)))));
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":102
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":102
*
* dict = <_node**> malloc(V_F*sizeof(_node*))
* memset(dict, 0, V_F*sizeof(_node*)) # <<<<<<<<<<<<<<
@@ -13997,7 +14017,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
memset(__pyx_v_dict, 0, (__pyx_v_V_F * (sizeof(struct __pyx_t_3_sa__node *))));
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":104
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":104
* memset(dict, 0, V_F*sizeof(_node*))
*
* num_sents = len(fsa.darray.sent_index) # <<<<<<<<<<<<<<
@@ -14013,7 +14033,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__pyx_v_num_sents = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":105
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":105
*
* num_sents = len(fsa.darray.sent_index)
* for sent_id from 0 <= sent_id < num_sents-1: # <<<<<<<<<<<<<<
@@ -14026,7 +14046,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
for (__pyx_v_sent_id = 0; __pyx_v_sent_id < __pyx_t_6; __pyx_v_sent_id++) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":107
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":107
* for sent_id from 0 <= sent_id < num_sents-1:
*
* fsent = fsa.darray.data.arr + fsa.darray.sent_index.arr[sent_id] # <<<<<<<<<<<<<<
@@ -14035,7 +14055,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
__pyx_v_fsent = (__pyx_v_fsa->darray->data->arr + (__pyx_v_fsa->darray->sent_index->arr[__pyx_v_sent_id]));
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":108
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":108
*
* fsent = fsa.darray.data.arr + fsa.darray.sent_index.arr[sent_id]
* I = fsa.darray.sent_index.arr[sent_id+1] - fsa.darray.sent_index.arr[sent_id] - 1 # <<<<<<<<<<<<<<
@@ -14044,7 +14064,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
__pyx_v_I = (((__pyx_v_fsa->darray->sent_index->arr[(__pyx_v_sent_id + 1)]) - (__pyx_v_fsa->darray->sent_index->arr[__pyx_v_sent_id])) - 1);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":109
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":109
* fsent = fsa.darray.data.arr + fsa.darray.sent_index.arr[sent_id]
* I = fsa.darray.sent_index.arr[sent_id+1] - fsa.darray.sent_index.arr[sent_id] - 1
* faligned = <int*> malloc(I*sizeof(int)) # <<<<<<<<<<<<<<
@@ -14053,7 +14073,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
__pyx_v_faligned = ((int *)malloc((__pyx_v_I * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":110
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":110
* I = fsa.darray.sent_index.arr[sent_id+1] - fsa.darray.sent_index.arr[sent_id] - 1
* faligned = <int*> malloc(I*sizeof(int))
* memset(faligned, 0, I*sizeof(int)) # <<<<<<<<<<<<<<
@@ -14062,7 +14082,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
memset(__pyx_v_faligned, 0, (__pyx_v_I * (sizeof(int))));
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":112
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":112
* memset(faligned, 0, I*sizeof(int))
*
* esent = eda.data.arr + eda.sent_index.arr[sent_id] # <<<<<<<<<<<<<<
@@ -14071,7 +14091,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
__pyx_v_esent = (__pyx_v_eda->data->arr + (__pyx_v_eda->sent_index->arr[__pyx_v_sent_id]));
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":113
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":113
*
* esent = eda.data.arr + eda.sent_index.arr[sent_id]
* J = eda.sent_index.arr[sent_id+1] - eda.sent_index.arr[sent_id] - 1 # <<<<<<<<<<<<<<
@@ -14080,7 +14100,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
__pyx_v_J = (((__pyx_v_eda->sent_index->arr[(__pyx_v_sent_id + 1)]) - (__pyx_v_eda->sent_index->arr[__pyx_v_sent_id])) - 1);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":114
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":114
* esent = eda.data.arr + eda.sent_index.arr[sent_id]
* J = eda.sent_index.arr[sent_id+1] - eda.sent_index.arr[sent_id] - 1
* ealigned = <int*> malloc(J*sizeof(int)) # <<<<<<<<<<<<<<
@@ -14089,7 +14109,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
__pyx_v_ealigned = ((int *)malloc((__pyx_v_J * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":115
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":115
* J = eda.sent_index.arr[sent_id+1] - eda.sent_index.arr[sent_id] - 1
* ealigned = <int*> malloc(J*sizeof(int))
* memset(ealigned, 0, J*sizeof(int)) # <<<<<<<<<<<<<<
@@ -14098,7 +14118,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
memset(__pyx_v_ealigned, 0, (__pyx_v_J * (sizeof(int))));
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":117
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":117
* memset(ealigned, 0, J*sizeof(int))
*
* links = aa._get_sent_links(sent_id, &num_links) # <<<<<<<<<<<<<<
@@ -14107,7 +14127,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
__pyx_v_links = ((struct __pyx_vtabstruct_3_sa_Alignment *)__pyx_v_aa->__pyx_vtab)->_get_sent_links(__pyx_v_aa, __pyx_v_sent_id, (&__pyx_v_num_links));
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":119
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":119
* links = aa._get_sent_links(sent_id, &num_links)
*
* for l from 0 <= l < num_links: # <<<<<<<<<<<<<<
@@ -14117,7 +14137,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__pyx_t_7 = __pyx_v_num_links;
for (__pyx_v_l = 0; __pyx_v_l < __pyx_t_7; __pyx_v_l++) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":120
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":120
*
* for l from 0 <= l < num_links:
* i = links[l*2] # <<<<<<<<<<<<<<
@@ -14126,7 +14146,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
__pyx_v_i = (__pyx_v_links[(__pyx_v_l * 2)]);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":121
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":121
* for l from 0 <= l < num_links:
* i = links[l*2]
* j = links[l*2+1] # <<<<<<<<<<<<<<
@@ -14135,7 +14155,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
__pyx_v_j = (__pyx_v_links[((__pyx_v_l * 2) + 1)]);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":122
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":122
* i = links[l*2]
* j = links[l*2+1]
* if i >= I or j >= J: # <<<<<<<<<<<<<<
@@ -14151,7 +14171,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
}
if (__pyx_t_10) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":123
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":123
* j = links[l*2+1]
* if i >= I or j >= J:
* raise Exception("%d-%d out of bounds (I=%d,J=%d) in line %d\n" % (i,j,I,J,sent_id+1)) # <<<<<<<<<<<<<<
@@ -14203,7 +14223,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
}
__pyx_L15:;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":124
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":124
* if i >= I or j >= J:
* raise Exception("%d-%d out of bounds (I=%d,J=%d) in line %d\n" % (i,j,I,J,sent_id+1))
* f_i = fsent[i] # <<<<<<<<<<<<<<
@@ -14212,7 +14232,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
__pyx_v_f_i = (__pyx_v_fsent[__pyx_v_i]);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":125
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":125
* raise Exception("%d-%d out of bounds (I=%d,J=%d) in line %d\n" % (i,j,I,J,sent_id+1))
* f_i = fsent[i]
* e_j = esent[j] # <<<<<<<<<<<<<<
@@ -14221,7 +14241,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
__pyx_v_e_j = (__pyx_v_esent[__pyx_v_j]);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":126
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":126
* f_i = fsent[i]
* e_j = esent[j]
* fmargin[f_i] = fmargin[f_i]+1 # <<<<<<<<<<<<<<
@@ -14230,7 +14250,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
(__pyx_v_fmargin[__pyx_v_f_i]) = ((__pyx_v_fmargin[__pyx_v_f_i]) + 1);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":127
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":127
* e_j = esent[j]
* fmargin[f_i] = fmargin[f_i]+1
* emargin[e_j] = emargin[e_j]+1 # <<<<<<<<<<<<<<
@@ -14239,7 +14259,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
(__pyx_v_emargin[__pyx_v_e_j]) = ((__pyx_v_emargin[__pyx_v_e_j]) + 1);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":128
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":128
* fmargin[f_i] = fmargin[f_i]+1
* emargin[e_j] = emargin[e_j]+1
* if dict[f_i] == NULL: # <<<<<<<<<<<<<<
@@ -14249,7 +14269,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__pyx_t_10 = ((__pyx_v_dict[__pyx_v_f_i]) == NULL);
if (__pyx_t_10) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":129
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":129
* emargin[e_j] = emargin[e_j]+1
* if dict[f_i] == NULL:
* dict[f_i] = new_node(e_j) # <<<<<<<<<<<<<<
@@ -14258,7 +14278,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
(__pyx_v_dict[__pyx_v_f_i]) = __pyx_f_3_sa_new_node(__pyx_v_e_j);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":130
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":130
* if dict[f_i] == NULL:
* dict[f_i] = new_node(e_j)
* dict[f_i].val = 1 # <<<<<<<<<<<<<<
@@ -14267,7 +14287,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
(__pyx_v_dict[__pyx_v_f_i])->val = 1;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":131
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":131
* dict[f_i] = new_node(e_j)
* dict[f_i].val = 1
* num_pairs = num_pairs + 1 # <<<<<<<<<<<<<<
@@ -14279,7 +14299,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":133
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":133
* num_pairs = num_pairs + 1
* else:
* count = get_val(dict[f_i], e_j) # <<<<<<<<<<<<<<
@@ -14288,7 +14308,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
__pyx_v_count = __pyx_f_3_sa_get_val((__pyx_v_dict[__pyx_v_f_i]), __pyx_v_e_j);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":134
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":134
* else:
* count = get_val(dict[f_i], e_j)
* if count[0] == 0: # <<<<<<<<<<<<<<
@@ -14298,7 +14318,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__pyx_t_10 = ((__pyx_v_count[0]) == 0);
if (__pyx_t_10) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":135
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":135
* count = get_val(dict[f_i], e_j)
* if count[0] == 0:
* num_pairs = num_pairs + 1 # <<<<<<<<<<<<<<
@@ -14310,7 +14330,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
}
__pyx_L17:;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":136
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":136
* if count[0] == 0:
* num_pairs = num_pairs + 1
* count[0] = count[0] + 1 # <<<<<<<<<<<<<<
@@ -14321,7 +14341,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
}
__pyx_L16:;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":138
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":138
* count[0] = count[0] + 1
* # add count
* faligned[i] = 1 # <<<<<<<<<<<<<<
@@ -14330,7 +14350,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
(__pyx_v_faligned[__pyx_v_i]) = 1;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":139
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":139
* # add count
* faligned[i] = 1
* ealigned[j] = 1 # <<<<<<<<<<<<<<
@@ -14340,7 +14360,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
(__pyx_v_ealigned[__pyx_v_j]) = 1;
}
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":140
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":140
* faligned[i] = 1
* ealigned[j] = 1
* for i from 0 <= i < I: # <<<<<<<<<<<<<<
@@ -14350,7 +14370,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__pyx_t_7 = __pyx_v_I;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_7; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":141
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":141
* ealigned[j] = 1
* for i from 0 <= i < I:
* if faligned[i] == 0: # <<<<<<<<<<<<<<
@@ -14360,7 +14380,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__pyx_t_10 = ((__pyx_v_faligned[__pyx_v_i]) == 0);
if (__pyx_t_10) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":142
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":142
* for i from 0 <= i < I:
* if faligned[i] == 0:
* f_i = fsent[i] # <<<<<<<<<<<<<<
@@ -14369,7 +14389,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
__pyx_v_f_i = (__pyx_v_fsent[__pyx_v_i]);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":143
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":143
* if faligned[i] == 0:
* f_i = fsent[i]
* fmargin[f_i] = fmargin[f_i] + 1 # <<<<<<<<<<<<<<
@@ -14378,7 +14398,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
(__pyx_v_fmargin[__pyx_v_f_i]) = ((__pyx_v_fmargin[__pyx_v_f_i]) + 1);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":144
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":144
* f_i = fsent[i]
* fmargin[f_i] = fmargin[f_i] + 1
* emargin[null_word] = emargin[null_word] + 1 # <<<<<<<<<<<<<<
@@ -14387,7 +14407,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
(__pyx_v_emargin[__pyx_v_null_word]) = ((__pyx_v_emargin[__pyx_v_null_word]) + 1);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":145
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":145
* fmargin[f_i] = fmargin[f_i] + 1
* emargin[null_word] = emargin[null_word] + 1
* if dict[f_i] == NULL: # <<<<<<<<<<<<<<
@@ -14397,7 +14417,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__pyx_t_10 = ((__pyx_v_dict[__pyx_v_f_i]) == NULL);
if (__pyx_t_10) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":146
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":146
* emargin[null_word] = emargin[null_word] + 1
* if dict[f_i] == NULL:
* dict[f_i] = new_node(null_word) # <<<<<<<<<<<<<<
@@ -14406,7 +14426,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
(__pyx_v_dict[__pyx_v_f_i]) = __pyx_f_3_sa_new_node(__pyx_v_null_word);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":147
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":147
* if dict[f_i] == NULL:
* dict[f_i] = new_node(null_word)
* dict[f_i].val = 1 # <<<<<<<<<<<<<<
@@ -14415,7 +14435,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
(__pyx_v_dict[__pyx_v_f_i])->val = 1;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":148
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":148
* dict[f_i] = new_node(null_word)
* dict[f_i].val = 1
* num_pairs = num_pairs + 1 # <<<<<<<<<<<<<<
@@ -14427,7 +14447,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":150
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":150
* num_pairs = num_pairs + 1
* else:
* count = get_val(dict[f_i], null_word) # <<<<<<<<<<<<<<
@@ -14436,7 +14456,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
__pyx_v_count = __pyx_f_3_sa_get_val((__pyx_v_dict[__pyx_v_f_i]), __pyx_v_null_word);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":151
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":151
* else:
* count = get_val(dict[f_i], null_word)
* if count[0] == 0: # <<<<<<<<<<<<<<
@@ -14446,7 +14466,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__pyx_t_10 = ((__pyx_v_count[0]) == 0);
if (__pyx_t_10) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":152
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":152
* count = get_val(dict[f_i], null_word)
* if count[0] == 0:
* num_pairs = num_pairs + 1 # <<<<<<<<<<<<<<
@@ -14458,7 +14478,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
}
__pyx_L22:;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":153
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":153
* if count[0] == 0:
* num_pairs = num_pairs + 1
* count[0] = count[0] + 1 # <<<<<<<<<<<<<<
@@ -14473,7 +14493,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__pyx_L20:;
}
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":154
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":154
* num_pairs = num_pairs + 1
* count[0] = count[0] + 1
* for j from 0 <= j < J: # <<<<<<<<<<<<<<
@@ -14483,7 +14503,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__pyx_t_7 = __pyx_v_J;
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_7; __pyx_v_j++) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":155
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":155
* count[0] = count[0] + 1
* for j from 0 <= j < J:
* if ealigned[j] == 0: # <<<<<<<<<<<<<<
@@ -14493,7 +14513,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__pyx_t_10 = ((__pyx_v_ealigned[__pyx_v_j]) == 0);
if (__pyx_t_10) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":156
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":156
* for j from 0 <= j < J:
* if ealigned[j] == 0:
* e_j = esent[j] # <<<<<<<<<<<<<<
@@ -14502,7 +14522,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
__pyx_v_e_j = (__pyx_v_esent[__pyx_v_j]);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":157
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":157
* if ealigned[j] == 0:
* e_j = esent[j]
* fmargin[null_word] = fmargin[null_word] + 1 # <<<<<<<<<<<<<<
@@ -14511,7 +14531,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
(__pyx_v_fmargin[__pyx_v_null_word]) = ((__pyx_v_fmargin[__pyx_v_null_word]) + 1);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":158
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":158
* e_j = esent[j]
* fmargin[null_word] = fmargin[null_word] + 1
* emargin[e_j] = emargin[e_j] + 1 # <<<<<<<<<<<<<<
@@ -14520,7 +14540,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
(__pyx_v_emargin[__pyx_v_e_j]) = ((__pyx_v_emargin[__pyx_v_e_j]) + 1);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":159
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":159
* fmargin[null_word] = fmargin[null_word] + 1
* emargin[e_j] = emargin[e_j] + 1
* if dict[null_word] == NULL: # <<<<<<<<<<<<<<
@@ -14530,7 +14550,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__pyx_t_10 = ((__pyx_v_dict[__pyx_v_null_word]) == NULL);
if (__pyx_t_10) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":160
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":160
* emargin[e_j] = emargin[e_j] + 1
* if dict[null_word] == NULL:
* dict[null_word] = new_node(e_j) # <<<<<<<<<<<<<<
@@ -14539,7 +14559,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
(__pyx_v_dict[__pyx_v_null_word]) = __pyx_f_3_sa_new_node(__pyx_v_e_j);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":161
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":161
* if dict[null_word] == NULL:
* dict[null_word] = new_node(e_j)
* dict[null_word].val = 1 # <<<<<<<<<<<<<<
@@ -14548,7 +14568,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
(__pyx_v_dict[__pyx_v_null_word])->val = 1;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":162
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":162
* dict[null_word] = new_node(e_j)
* dict[null_word].val = 1
* num_pairs = num_pairs + 1 # <<<<<<<<<<<<<<
@@ -14560,7 +14580,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":164
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":164
* num_pairs = num_pairs + 1
* else:
* count = get_val(dict[null_word], e_j) # <<<<<<<<<<<<<<
@@ -14569,7 +14589,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
__pyx_v_count = __pyx_f_3_sa_get_val((__pyx_v_dict[__pyx_v_null_word]), __pyx_v_e_j);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":165
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":165
* else:
* count = get_val(dict[null_word], e_j)
* if count[0] == 0: # <<<<<<<<<<<<<<
@@ -14579,7 +14599,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__pyx_t_10 = ((__pyx_v_count[0]) == 0);
if (__pyx_t_10) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":166
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":166
* count = get_val(dict[null_word], e_j)
* if count[0] == 0:
* num_pairs = num_pairs + 1 # <<<<<<<<<<<<<<
@@ -14591,7 +14611,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
}
__pyx_L27:;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":167
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":167
* if count[0] == 0:
* num_pairs = num_pairs + 1
* count[0] = count[0] + 1 # <<<<<<<<<<<<<<
@@ -14606,7 +14626,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__pyx_L25:;
}
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":168
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":168
* num_pairs = num_pairs + 1
* count[0] = count[0] + 1
* free(links) # <<<<<<<<<<<<<<
@@ -14615,7 +14635,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
free(__pyx_v_links);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":169
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":169
* count[0] = count[0] + 1
* free(links)
* free(faligned) # <<<<<<<<<<<<<<
@@ -14624,7 +14644,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
free(__pyx_v_faligned);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":170
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":170
* free(links)
* free(faligned)
* free(ealigned) # <<<<<<<<<<<<<<
@@ -14634,7 +14654,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
free(__pyx_v_ealigned);
}
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":171
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":171
* free(faligned)
* free(ealigned)
* self.f_index = IntList(initial_len=V_F) # <<<<<<<<<<<<<<
@@ -14656,7 +14676,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__pyx_v_self->f_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_13);
__pyx_t_13 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":172
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":172
* free(ealigned)
* self.f_index = IntList(initial_len=V_F)
* self.e_index = IntList(initial_len=num_pairs) # <<<<<<<<<<<<<<
@@ -14678,7 +14698,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__pyx_v_self->e_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_12);
__pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":173
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":173
* self.f_index = IntList(initial_len=V_F)
* self.e_index = IntList(initial_len=num_pairs)
* self.col1 = FloatList(initial_len=num_pairs) # <<<<<<<<<<<<<<
@@ -14700,7 +14720,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__pyx_v_self->col1 = ((struct __pyx_obj_3_sa_FloatList *)__pyx_t_13);
__pyx_t_13 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":174
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":174
* self.e_index = IntList(initial_len=num_pairs)
* self.col1 = FloatList(initial_len=num_pairs)
* self.col2 = FloatList(initial_len=num_pairs) # <<<<<<<<<<<<<<
@@ -14722,7 +14742,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__pyx_v_self->col2 = ((struct __pyx_obj_3_sa_FloatList *)__pyx_t_12);
__pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":176
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":176
* self.col2 = FloatList(initial_len=num_pairs)
*
* num_pairs = 0 # <<<<<<<<<<<<<<
@@ -14731,7 +14751,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
__pyx_v_num_pairs = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":177
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":177
*
* num_pairs = 0
* for i from 0 <= i < V_F: # <<<<<<<<<<<<<<
@@ -14741,7 +14761,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__pyx_t_6 = __pyx_v_V_F;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":179
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":179
* for i from 0 <= i < V_F:
* #self.f_index[i] = num_pairs
* self.f_index.set(i, num_pairs) # <<<<<<<<<<<<<<
@@ -14750,7 +14770,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->f_index->__pyx_vtab)->set(__pyx_v_self->f_index, __pyx_v_i, __pyx_v_num_pairs);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":180
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":180
* #self.f_index[i] = num_pairs
* self.f_index.set(i, num_pairs)
* if dict[i] != NULL: # <<<<<<<<<<<<<<
@@ -14760,7 +14780,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__pyx_t_10 = ((__pyx_v_dict[__pyx_v_i]) != NULL);
if (__pyx_t_10) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":181
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":181
* self.f_index.set(i, num_pairs)
* if dict[i] != NULL:
* self._add_node(dict[i], &num_pairs, float(fmargin[i]), emargin) # <<<<<<<<<<<<<<
@@ -14771,7 +14791,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":182
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":182
* if dict[i] != NULL:
* self._add_node(dict[i], &num_pairs, float(fmargin[i]), emargin)
* del_node(dict[i]) # <<<<<<<<<<<<<<
@@ -14786,7 +14806,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
__pyx_L30:;
}
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":183
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":183
* self._add_node(dict[i], &num_pairs, float(fmargin[i]), emargin)
* del_node(dict[i])
* free(fmargin) # <<<<<<<<<<<<<<
@@ -14795,7 +14815,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
free(__pyx_v_fmargin);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":184
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":184
* del_node(dict[i])
* free(fmargin)
* free(emargin) # <<<<<<<<<<<<<<
@@ -14804,7 +14824,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
free(__pyx_v_emargin);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":185
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":185
* free(fmargin)
* free(emargin)
* free(dict) # <<<<<<<<<<<<<<
@@ -14813,7 +14833,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
*/
free(__pyx_v_dict);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":186
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":186
* free(emargin)
* free(dict)
* return # <<<<<<<<<<<<<<
@@ -14844,7 +14864,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_compute_from_data(struct __pyx_obj_3_sa_BiL
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":189
+/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":189
*
*
* cdef _add_node(self, _node* n, int* num_pairs, float fmargin, int* emargin): # <<<<<<<<<<<<<<
@@ -14863,7 +14883,7 @@ static PyObject *__pyx_f_3_sa_5BiLex__add_node(struct __pyx_obj_3_sa_BiLex *__py
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_add_node", 0);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":191
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":191
* cdef _add_node(self, _node* n, int* num_pairs, float fmargin, int* emargin):
* cdef int loc
* if n.smaller != NULL: # <<<<<<<<<<<<<<
@@ -14873,7 +14893,7 @@ static PyObject *__pyx_f_3_sa_5BiLex__add_node(struct __pyx_obj_3_sa_BiLex *__py
__pyx_t_1 = (__pyx_v_n->smaller != NULL);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":192
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":192
* cdef int loc
* if n.smaller != NULL:
* self._add_node(n.smaller, num_pairs, fmargin, emargin) # <<<<<<<<<<<<<<
@@ -14887,7 +14907,7 @@ static PyObject *__pyx_f_3_sa_5BiLex__add_node(struct __pyx_obj_3_sa_BiLex *__py
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":193
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":193
* if n.smaller != NULL:
* self._add_node(n.smaller, num_pairs, fmargin, emargin)
* loc = num_pairs[0] # <<<<<<<<<<<<<<
@@ -14896,7 +14916,7 @@ static PyObject *__pyx_f_3_sa_5BiLex__add_node(struct __pyx_obj_3_sa_BiLex *__py
*/
__pyx_v_loc = (__pyx_v_num_pairs[0]);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":194
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":194
* self._add_node(n.smaller, num_pairs, fmargin, emargin)
* loc = num_pairs[0]
* self.e_index.set(loc, n.key) # <<<<<<<<<<<<<<
@@ -14905,7 +14925,7 @@ static PyObject *__pyx_f_3_sa_5BiLex__add_node(struct __pyx_obj_3_sa_BiLex *__py
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->e_index->__pyx_vtab)->set(__pyx_v_self->e_index, __pyx_v_loc, __pyx_v_n->key);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":195
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":195
* loc = num_pairs[0]
* self.e_index.set(loc, n.key)
* self.col1.set(loc, float(n.val)/fmargin) # <<<<<<<<<<<<<<
@@ -14918,7 +14938,7 @@ static PyObject *__pyx_f_3_sa_5BiLex__add_node(struct __pyx_obj_3_sa_BiLex *__py
}
((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->col1->__pyx_vtab)->set(__pyx_v_self->col1, __pyx_v_loc, (((double)__pyx_v_n->val) / __pyx_v_fmargin));
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":196
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":196
* self.e_index.set(loc, n.key)
* self.col1.set(loc, float(n.val)/fmargin)
* self.col2.set(loc, float(n.val)/float(emargin[n.key])) # <<<<<<<<<<<<<<
@@ -14931,7 +14951,7 @@ static PyObject *__pyx_f_3_sa_5BiLex__add_node(struct __pyx_obj_3_sa_BiLex *__py
}
((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->col2->__pyx_vtab)->set(__pyx_v_self->col2, __pyx_v_loc, (((double)__pyx_v_n->val) / ((double)(__pyx_v_emargin[__pyx_v_n->key]))));
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":197
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":197
* self.col1.set(loc, float(n.val)/fmargin)
* self.col2.set(loc, float(n.val)/float(emargin[n.key]))
* num_pairs[0] = loc + 1 # <<<<<<<<<<<<<<
@@ -14940,7 +14960,7 @@ static PyObject *__pyx_f_3_sa_5BiLex__add_node(struct __pyx_obj_3_sa_BiLex *__py
*/
(__pyx_v_num_pairs[0]) = (__pyx_v_loc + 1);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":198
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":198
* self.col2.set(loc, float(n.val)/float(emargin[n.key]))
* num_pairs[0] = loc + 1
* if n.bigger != NULL: # <<<<<<<<<<<<<<
@@ -14950,7 +14970,7 @@ static PyObject *__pyx_f_3_sa_5BiLex__add_node(struct __pyx_obj_3_sa_BiLex *__py
__pyx_t_1 = (__pyx_v_n->bigger != NULL);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":199
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":199
* num_pairs[0] = loc + 1
* if n.bigger != NULL:
* self._add_node(n.bigger, num_pairs, fmargin, emargin) # <<<<<<<<<<<<<<
@@ -14997,7 +15017,7 @@ static PyObject *__pyx_pw_3_sa_5BiLex_3write_binary(PyObject *__pyx_v_self, PyOb
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":202
+/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":202
*
*
* def write_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -15016,7 +15036,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_binary", 0);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":204
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":204
* def write_binary(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "w") # <<<<<<<<<<<<<<
@@ -15025,7 +15045,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":205
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":205
* cdef FILE* f
* f = fopen(filename, "w")
* self.f_index.write_handle(f) # <<<<<<<<<<<<<<
@@ -15034,7 +15054,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->f_index->__pyx_vtab)->write_handle(__pyx_v_self->f_index, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":206
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":206
* f = fopen(filename, "w")
* self.f_index.write_handle(f)
* self.e_index.write_handle(f) # <<<<<<<<<<<<<<
@@ -15043,7 +15063,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->e_index->__pyx_vtab)->write_handle(__pyx_v_self->e_index, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":207
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":207
* self.f_index.write_handle(f)
* self.e_index.write_handle(f)
* self.col1.write_handle(f) # <<<<<<<<<<<<<<
@@ -15052,7 +15072,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex
*/
((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->col1->__pyx_vtab)->write_handle(__pyx_v_self->col1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":208
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":208
* self.e_index.write_handle(f)
* self.col1.write_handle(f)
* self.col2.write_handle(f) # <<<<<<<<<<<<<<
@@ -15061,7 +15081,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex
*/
((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->col2->__pyx_vtab)->write_handle(__pyx_v_self->col2, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":209
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":209
* self.col1.write_handle(f)
* self.col2.write_handle(f)
* self.write_wordlist(self.id2fword, f) # <<<<<<<<<<<<<<
@@ -15075,7 +15095,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":210
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":210
* self.col2.write_handle(f)
* self.write_wordlist(self.id2fword, f)
* self.write_wordlist(self.id2eword, f) # <<<<<<<<<<<<<<
@@ -15089,7 +15109,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":211
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":211
* self.write_wordlist(self.id2fword, f)
* self.write_wordlist(self.id2eword, f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -15111,7 +15131,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_2write_binary(struct __pyx_obj_3_sa_BiLex
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":214
+/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":214
*
*
* cdef write_wordlist(self, wordlist, FILE* f): # <<<<<<<<<<<<<<
@@ -15136,7 +15156,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED struct __pyx_o
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_wordlist", 0);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":218
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":218
* cdef int num_words
*
* num_words = len(wordlist) # <<<<<<<<<<<<<<
@@ -15146,7 +15166,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED struct __pyx_o
__pyx_t_1 = PyObject_Length(__pyx_v_wordlist); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_num_words = __pyx_t_1;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":219
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":219
*
* num_words = len(wordlist)
* fwrite(&(num_words), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -15155,7 +15175,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED struct __pyx_o
*/
fwrite((&__pyx_v_num_words), (sizeof(int)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":220
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":220
* num_words = len(wordlist)
* fwrite(&(num_words), sizeof(int), 1, f)
* for word in wordlist: # <<<<<<<<<<<<<<
@@ -15200,7 +15220,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED struct __pyx_o
__pyx_v_word = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":221
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":221
* fwrite(&(num_words), sizeof(int), 1, f)
* for word in wordlist:
* word_len = len(word) + 1 # <<<<<<<<<<<<<<
@@ -15210,7 +15230,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED struct __pyx_o
__pyx_t_5 = PyObject_Length(__pyx_v_word); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_word_len = (__pyx_t_5 + 1);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":222
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":222
* for word in wordlist:
* word_len = len(word) + 1
* fwrite(&(word_len), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -15219,7 +15239,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED struct __pyx_o
*/
fwrite((&__pyx_v_word_len), (sizeof(int)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":223
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":223
* word_len = len(word) + 1
* fwrite(&(word_len), sizeof(int), 1, f)
* fwrite(<char *>word, sizeof(char), word_len, f) # <<<<<<<<<<<<<<
@@ -15245,7 +15265,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_write_wordlist(CYTHON_UNUSED struct __pyx_o
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":226
+/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":226
*
*
* cdef read_wordlist(self, word2id, id2word, FILE* f): # <<<<<<<<<<<<<<
@@ -15269,7 +15289,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struct __pyx_ob
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_wordlist", 0);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":231
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":231
* cdef char* word
*
* fread(&(num_words), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -15278,7 +15298,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struct __pyx_ob
*/
fread((&__pyx_v_num_words), (sizeof(int)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":232
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":232
*
* fread(&(num_words), sizeof(int), 1, f)
* for i from 0 <= i < num_words: # <<<<<<<<<<<<<<
@@ -15288,7 +15308,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struct __pyx_ob
__pyx_t_1 = __pyx_v_num_words;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":233
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":233
* fread(&(num_words), sizeof(int), 1, f)
* for i from 0 <= i < num_words:
* fread(&(word_len), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -15297,7 +15317,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struct __pyx_ob
*/
fread((&__pyx_v_word_len), (sizeof(int)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":234
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":234
* for i from 0 <= i < num_words:
* fread(&(word_len), sizeof(int), 1, f)
* word = <char*> malloc (word_len * sizeof(char)) # <<<<<<<<<<<<<<
@@ -15306,7 +15326,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struct __pyx_ob
*/
__pyx_v_word = ((char *)malloc((__pyx_v_word_len * (sizeof(char)))));
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":235
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":235
* fread(&(word_len), sizeof(int), 1, f)
* word = <char*> malloc (word_len * sizeof(char))
* fread(word, sizeof(char), word_len, f) # <<<<<<<<<<<<<<
@@ -15315,7 +15335,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struct __pyx_ob
*/
fread(__pyx_v_word, (sizeof(char)), __pyx_v_word_len, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":236
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":236
* word = <char*> malloc (word_len * sizeof(char))
* fread(word, sizeof(char), word_len, f)
* word2id[word] = len(id2word) # <<<<<<<<<<<<<<
@@ -15331,7 +15351,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struct __pyx_ob
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":237
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":237
* fread(word, sizeof(char), word_len, f)
* word2id[word] = len(id2word)
* id2word.append(word) # <<<<<<<<<<<<<<
@@ -15345,7 +15365,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_read_wordlist(CYTHON_UNUSED struct __pyx_ob
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":238
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":238
* word2id[word] = len(id2word)
* id2word.append(word)
* free(word) # <<<<<<<<<<<<<<
@@ -15389,7 +15409,7 @@ static PyObject *__pyx_pw_3_sa_5BiLex_5read_binary(PyObject *__pyx_v_self, PyObj
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":240
+/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":240
* free(word)
*
* def read_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -15409,7 +15429,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_4read_binary(struct __pyx_obj_3_sa_BiLex *
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_binary", 0);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":242
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":242
* def read_binary(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "r") # <<<<<<<<<<<<<<
@@ -15418,7 +15438,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_4read_binary(struct __pyx_obj_3_sa_BiLex *
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":243
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":243
* cdef FILE* f
* f = fopen(filename, "r")
* self.f_index.read_handle(f) # <<<<<<<<<<<<<<
@@ -15427,7 +15447,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_4read_binary(struct __pyx_obj_3_sa_BiLex *
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->f_index->__pyx_vtab)->read_handle(__pyx_v_self->f_index, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":244
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":244
* f = fopen(filename, "r")
* self.f_index.read_handle(f)
* self.e_index.read_handle(f) # <<<<<<<<<<<<<<
@@ -15436,7 +15456,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_4read_binary(struct __pyx_obj_3_sa_BiLex *
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->e_index->__pyx_vtab)->read_handle(__pyx_v_self->e_index, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":245
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":245
* self.f_index.read_handle(f)
* self.e_index.read_handle(f)
* self.col1.read_handle(f) # <<<<<<<<<<<<<<
@@ -15445,7 +15465,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_4read_binary(struct __pyx_obj_3_sa_BiLex *
*/
((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->col1->__pyx_vtab)->read_handle(__pyx_v_self->col1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":246
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":246
* self.e_index.read_handle(f)
* self.col1.read_handle(f)
* self.col2.read_handle(f) # <<<<<<<<<<<<<<
@@ -15454,7 +15474,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_4read_binary(struct __pyx_obj_3_sa_BiLex *
*/
((struct __pyx_vtabstruct_3_sa_FloatList *)__pyx_v_self->col2->__pyx_vtab)->read_handle(__pyx_v_self->col2, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":247
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":247
* self.col1.read_handle(f)
* self.col2.read_handle(f)
* self.read_wordlist(self.fword2id, self.id2fword, f) # <<<<<<<<<<<<<<
@@ -15471,7 +15491,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_4read_binary(struct __pyx_obj_3_sa_BiLex *
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":248
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":248
* self.col2.read_handle(f)
* self.read_wordlist(self.fword2id, self.id2fword, f)
* self.read_wordlist(self.eword2id, self.id2eword, f) # <<<<<<<<<<<<<<
@@ -15488,7 +15508,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_4read_binary(struct __pyx_obj_3_sa_BiLex *
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":249
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":249
* self.read_wordlist(self.fword2id, self.id2fword, f)
* self.read_wordlist(self.eword2id, self.id2eword, f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -15522,7 +15542,7 @@ static PyObject *__pyx_pw_3_sa_5BiLex_7get_e_id(PyObject *__pyx_v_self, PyObject
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":252
+/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":252
*
*
* def get_e_id(self, eword): # <<<<<<<<<<<<<<
@@ -15542,7 +15562,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_6get_e_id(struct __pyx_obj_3_sa_BiLex *__p
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_e_id", 0);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":253
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":253
*
* def get_e_id(self, eword):
* if eword not in self.eword2id: # <<<<<<<<<<<<<<
@@ -15552,7 +15572,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_6get_e_id(struct __pyx_obj_3_sa_BiLex *__p
__pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_eword, __pyx_v_self->eword2id, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":254
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":254
* def get_e_id(self, eword):
* if eword not in self.eword2id:
* e_id = len(self.id2eword) # <<<<<<<<<<<<<<
@@ -15568,7 +15588,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_6get_e_id(struct __pyx_obj_3_sa_BiLex *__p
__pyx_v_e_id = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":255
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":255
* if eword not in self.eword2id:
* e_id = len(self.id2eword)
* self.id2eword.append(eword) # <<<<<<<<<<<<<<
@@ -15579,7 +15599,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_6get_e_id(struct __pyx_obj_3_sa_BiLex *__p
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":256
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":256
* e_id = len(self.id2eword)
* self.id2eword.append(eword)
* self.eword2id[eword] = e_id # <<<<<<<<<<<<<<
@@ -15591,7 +15611,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_6get_e_id(struct __pyx_obj_3_sa_BiLex *__p
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":257
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":257
* self.id2eword.append(eword)
* self.eword2id[eword] = e_id
* return self.eword2id[eword] # <<<<<<<<<<<<<<
@@ -15629,7 +15649,7 @@ static PyObject *__pyx_pw_3_sa_5BiLex_9get_f_id(PyObject *__pyx_v_self, PyObject
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":260
+/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":260
*
*
* def get_f_id(self, fword): # <<<<<<<<<<<<<<
@@ -15649,7 +15669,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_8get_f_id(struct __pyx_obj_3_sa_BiLex *__p
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_f_id", 0);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":261
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":261
*
* def get_f_id(self, fword):
* if fword not in self.fword2id: # <<<<<<<<<<<<<<
@@ -15659,7 +15679,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_8get_f_id(struct __pyx_obj_3_sa_BiLex *__p
__pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_fword, __pyx_v_self->fword2id, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":262
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":262
* def get_f_id(self, fword):
* if fword not in self.fword2id:
* f_id = len(self.id2fword) # <<<<<<<<<<<<<<
@@ -15675,7 +15695,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_8get_f_id(struct __pyx_obj_3_sa_BiLex *__p
__pyx_v_f_id = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":263
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":263
* if fword not in self.fword2id:
* f_id = len(self.id2fword)
* self.id2fword.append(fword) # <<<<<<<<<<<<<<
@@ -15686,7 +15706,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_8get_f_id(struct __pyx_obj_3_sa_BiLex *__p
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":264
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":264
* f_id = len(self.id2fword)
* self.id2fword.append(fword)
* self.fword2id[fword] = f_id # <<<<<<<<<<<<<<
@@ -15698,7 +15718,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_8get_f_id(struct __pyx_obj_3_sa_BiLex *__p
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":265
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":265
* self.id2fword.append(fword)
* self.fword2id[fword] = f_id
* return self.fword2id[fword] # <<<<<<<<<<<<<<
@@ -15746,7 +15766,7 @@ static PyObject *__pyx_pw_3_sa_5BiLex_11read_text(PyObject *__pyx_v_self, PyObje
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":268
+/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":268
*
*
* def read_text(self, char* filename): # <<<<<<<<<<<<<<
@@ -15801,7 +15821,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_text", 0);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":272
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":272
* cdef IntList fcount
*
* fcount = IntList() # <<<<<<<<<<<<<<
@@ -15813,7 +15833,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_v_fcount = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":273
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":273
*
* fcount = IntList()
* with gzip_or_text(filename) as f: # <<<<<<<<<<<<<<
@@ -15853,7 +15873,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_v_f = __pyx_t_1;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":275
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":275
* with gzip_or_text(filename) as f:
* # first loop merely establishes size of array objects
* for line in f: # <<<<<<<<<<<<<<
@@ -15898,7 +15918,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_v_line = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":276
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":276
* # first loop merely establishes size of array objects
* for line in f:
* (fword, eword, score1, score2) = line.split() # <<<<<<<<<<<<<<
@@ -15984,7 +16004,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_v_score2 = __pyx_t_12;
__pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":277
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":277
* for line in f:
* (fword, eword, score1, score2) = line.split()
* f_id = self.get_f_id(fword) # <<<<<<<<<<<<<<
@@ -16006,7 +16026,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_v_f_id = __pyx_t_11;
__pyx_t_11 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":278
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":278
* (fword, eword, score1, score2) = line.split()
* f_id = self.get_f_id(fword)
* e_id = self.get_e_id(eword) # <<<<<<<<<<<<<<
@@ -16028,7 +16048,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_v_e_id = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":279
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":279
* f_id = self.get_f_id(fword)
* e_id = self.get_e_id(eword)
* while f_id >= len(fcount): # <<<<<<<<<<<<<<
@@ -16045,7 +16065,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
if (!__pyx_t_16) break;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":280
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":280
* e_id = self.get_e_id(eword)
* while f_id >= len(fcount):
* fcount.append(0) # <<<<<<<<<<<<<<
@@ -16057,7 +16077,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":281
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":281
* while f_id >= len(fcount):
* fcount.append(0)
* fcount.arr[f_id] = fcount.arr[f_id] + 1 # <<<<<<<<<<<<<<
@@ -16070,7 +16090,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":284
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":284
*
* # Allocate space for dictionary in arrays
* N = 0 # <<<<<<<<<<<<<<
@@ -16080,7 +16100,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__Pyx_INCREF(__pyx_int_0);
__pyx_v_N = __pyx_int_0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":285
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":285
* # Allocate space for dictionary in arrays
* N = 0
* n_f = len(fcount) # <<<<<<<<<<<<<<
@@ -16093,7 +16113,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_v_n_f = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":286
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":286
* N = 0
* n_f = len(fcount)
* self.f_index = IntList(initial_len=n_f+1) # <<<<<<<<<<<<<<
@@ -16115,7 +16135,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_v_self->f_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_12);
__pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":287
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":287
* n_f = len(fcount)
* self.f_index = IntList(initial_len=n_f+1)
* for i from 0 <= i < n_f: # <<<<<<<<<<<<<<
@@ -16130,7 +16150,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_v_i = __pyx_t_12;
__pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":288
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":288
* self.f_index = IntList(initial_len=n_f+1)
* for i from 0 <= i < n_f:
* self.f_index.arr[i] = N # <<<<<<<<<<<<<<
@@ -16141,7 +16161,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
(__pyx_v_self->f_index->arr[__pyx_t_8]) = __pyx_t_20;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":289
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":289
* for i from 0 <= i < n_f:
* self.f_index.arr[i] = N
* N = N + fcount.arr[i] # <<<<<<<<<<<<<<
@@ -16158,7 +16178,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_v_N = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":290
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":290
* self.f_index.arr[i] = N
* N = N + fcount.arr[i]
* fcount.arr[i] = 0 # <<<<<<<<<<<<<<
@@ -16170,7 +16190,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_t_19 = __Pyx_PyInt_AsLong(__pyx_v_i); if (unlikely((__pyx_t_19 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
}
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":287
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":287
* n_f = len(fcount)
* self.f_index = IntList(initial_len=n_f+1)
* for i from 0 <= i < n_f: # <<<<<<<<<<<<<<
@@ -16183,7 +16203,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_v_i = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":291
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":291
* N = N + fcount.arr[i]
* fcount.arr[i] = 0
* self.f_index.arr[n_f] = N # <<<<<<<<<<<<<<
@@ -16194,7 +16214,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n_f); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
(__pyx_v_self->f_index->arr[__pyx_t_8]) = __pyx_t_20;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":292
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":292
* fcount.arr[i] = 0
* self.f_index.arr[n_f] = N
* self.e_index = IntList(initial_len=N) # <<<<<<<<<<<<<<
@@ -16213,7 +16233,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_v_self->e_index = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_12);
__pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":293
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":293
* self.f_index.arr[n_f] = N
* self.e_index = IntList(initial_len=N)
* self.col1 = FloatList(initial_len=N) # <<<<<<<<<<<<<<
@@ -16232,7 +16252,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_v_self->col1 = ((struct __pyx_obj_3_sa_FloatList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":294
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":294
* self.e_index = IntList(initial_len=N)
* self.col1 = FloatList(initial_len=N)
* self.col2 = FloatList(initial_len=N) # <<<<<<<<<<<<<<
@@ -16251,7 +16271,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_v_self->col2 = ((struct __pyx_obj_3_sa_FloatList *)__pyx_t_12);
__pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":297
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":297
*
* # Re-read file, placing words into buckets
* f.seek(0) # <<<<<<<<<<<<<<
@@ -16265,7 +16285,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":298
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":298
* # Re-read file, placing words into buckets
* f.seek(0)
* for line in f: # <<<<<<<<<<<<<<
@@ -16310,7 +16330,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_v_line = __pyx_t_12;
__pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":299
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":299
* f.seek(0)
* for line in f:
* (fword, eword, score1, score2) = line.split() # <<<<<<<<<<<<<<
@@ -16396,7 +16416,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_v_score2 = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":300
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":300
* for line in f:
* (fword, eword, score1, score2) = line.split()
* f_id = self.get_f_id(fword) # <<<<<<<<<<<<<<
@@ -16418,7 +16438,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_v_f_id = __pyx_t_10;
__pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":301
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":301
* (fword, eword, score1, score2) = line.split()
* f_id = self.get_f_id(fword)
* e_id = self.get_e_id(eword) # <<<<<<<<<<<<<<
@@ -16440,7 +16460,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_v_e_id = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":302
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":302
* f_id = self.get_f_id(fword)
* e_id = self.get_e_id(eword)
* index = self.f_index.arr[f_id] + fcount.arr[f_id] # <<<<<<<<<<<<<<
@@ -16455,7 +16475,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_v_index = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":303
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":303
* e_id = self.get_e_id(eword)
* index = self.f_index.arr[f_id] + fcount.arr[f_id]
* fcount.arr[f_id] = fcount.arr[f_id] + 1 # <<<<<<<<<<<<<<
@@ -16466,7 +16486,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_id); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
(__pyx_v_fcount->arr[__pyx_t_15]) = ((__pyx_v_fcount->arr[__pyx_t_17]) + 1);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":304
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":304
* index = self.f_index.arr[f_id] + fcount.arr[f_id]
* fcount.arr[f_id] = fcount.arr[f_id] + 1
* self.e_index.arr[index] = int(e_id) # <<<<<<<<<<<<<<
@@ -16486,7 +16506,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
(__pyx_v_self->e_index->arr[__pyx_t_17]) = __pyx_t_20;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":305
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":305
* fcount.arr[f_id] = fcount.arr[f_id] + 1
* self.e_index.arr[index] = int(e_id)
* self.col1[index] = float(score1) # <<<<<<<<<<<<<<
@@ -16499,7 +16519,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
if (PyObject_SetItem(((PyObject *)__pyx_v_self->col1), __pyx_v_index, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":306
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":306
* self.e_index.arr[index] = int(e_id)
* self.col1[index] = float(score1)
* self.col2[index] = float(score2) # <<<<<<<<<<<<<<
@@ -16527,7 +16547,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":273
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":273
*
* fcount = IntList()
* with gzip_or_text(filename) as f: # <<<<<<<<<<<<<<
@@ -16607,7 +16627,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_L31:;
}
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":309
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":309
*
* # Sort buckets by eword
* for b from 0 <= b < n_f: # <<<<<<<<<<<<<<
@@ -16623,7 +16643,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_v_b = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":310
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":310
* # Sort buckets by eword
* for b from 0 <= b < n_f:
* i = self.f_index.arr[b] # <<<<<<<<<<<<<<
@@ -16637,7 +16657,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_v_i = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":311
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":311
* for b from 0 <= b < n_f:
* i = self.f_index.arr[b]
* j = self.f_index.arr[b+1] # <<<<<<<<<<<<<<
@@ -16654,7 +16674,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_v_j = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":312
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":312
* i = self.f_index.arr[b]
* j = self.f_index.arr[b+1]
* self.qsort(i,j, "") # <<<<<<<<<<<<<<
@@ -16672,7 +16692,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
__pyx_t_18 = __Pyx_PyInt_AsLong(__pyx_v_b); if (unlikely((__pyx_t_18 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":309
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":309
*
* # Sort buckets by eword
* for b from 0 <= b < n_f: # <<<<<<<<<<<<<<
@@ -16718,7 +16738,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_10read_text(struct __pyx_obj_3_sa_BiLex *_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":315
+/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":315
*
*
* cdef swap(self, int i, int j): # <<<<<<<<<<<<<<
@@ -16734,7 +16754,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s
int __pyx_t_1;
__Pyx_RefNannySetupContext("swap", 0);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":319
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":319
* cdef float ftmp
*
* if i == j: # <<<<<<<<<<<<<<
@@ -16744,7 +16764,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s
__pyx_t_1 = (__pyx_v_i == __pyx_v_j);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":320
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":320
*
* if i == j:
* return # <<<<<<<<<<<<<<
@@ -16758,7 +16778,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":322
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":322
* return
*
* itmp = self.e_index.arr[i] # <<<<<<<<<<<<<<
@@ -16767,7 +16787,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s
*/
__pyx_v_itmp = (__pyx_v_self->e_index->arr[__pyx_v_i]);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":323
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":323
*
* itmp = self.e_index.arr[i]
* self.e_index.arr[i] = self.e_index.arr[j] # <<<<<<<<<<<<<<
@@ -16776,7 +16796,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s
*/
(__pyx_v_self->e_index->arr[__pyx_v_i]) = (__pyx_v_self->e_index->arr[__pyx_v_j]);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":324
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":324
* itmp = self.e_index.arr[i]
* self.e_index.arr[i] = self.e_index.arr[j]
* self.e_index.arr[j] = itmp # <<<<<<<<<<<<<<
@@ -16785,7 +16805,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s
*/
(__pyx_v_self->e_index->arr[__pyx_v_j]) = __pyx_v_itmp;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":326
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":326
* self.e_index.arr[j] = itmp
*
* ftmp = self.col1.arr[i] # <<<<<<<<<<<<<<
@@ -16794,7 +16814,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s
*/
__pyx_v_ftmp = (__pyx_v_self->col1->arr[__pyx_v_i]);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":327
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":327
*
* ftmp = self.col1.arr[i]
* self.col1.arr[i] = self.col1.arr[j] # <<<<<<<<<<<<<<
@@ -16803,7 +16823,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s
*/
(__pyx_v_self->col1->arr[__pyx_v_i]) = (__pyx_v_self->col1->arr[__pyx_v_j]);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":328
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":328
* ftmp = self.col1.arr[i]
* self.col1.arr[i] = self.col1.arr[j]
* self.col1.arr[j] = ftmp # <<<<<<<<<<<<<<
@@ -16812,7 +16832,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s
*/
(__pyx_v_self->col1->arr[__pyx_v_j]) = __pyx_v_ftmp;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":330
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":330
* self.col1.arr[j] = ftmp
*
* ftmp = self.col2.arr[i] # <<<<<<<<<<<<<<
@@ -16821,7 +16841,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s
*/
__pyx_v_ftmp = (__pyx_v_self->col2->arr[__pyx_v_i]);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":331
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":331
*
* ftmp = self.col2.arr[i]
* self.col2.arr[i] = self.col2.arr[j] # <<<<<<<<<<<<<<
@@ -16830,7 +16850,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s
*/
(__pyx_v_self->col2->arr[__pyx_v_i]) = (__pyx_v_self->col2->arr[__pyx_v_j]);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":332
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":332
* ftmp = self.col2.arr[i]
* self.col2.arr[i] = self.col2.arr[j]
* self.col2.arr[j] = ftmp # <<<<<<<<<<<<<<
@@ -16846,7 +16866,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_swap(struct __pyx_obj_3_sa_BiLex *__pyx_v_s
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":335
+/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":335
*
*
* cdef qsort(self, int i, int j, pad): # <<<<<<<<<<<<<<
@@ -16869,7 +16889,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("qsort", 0);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":338
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":338
* cdef int pval, p
*
* if i > j: # <<<<<<<<<<<<<<
@@ -16879,7 +16899,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_
__pyx_t_1 = (__pyx_v_i > __pyx_v_j);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":339
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":339
*
* if i > j:
* raise Exception("Sort error in CLex") # <<<<<<<<<<<<<<
@@ -16895,7 +16915,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":340
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":340
* if i > j:
* raise Exception("Sort error in CLex")
* if i == j: #empty interval # <<<<<<<<<<<<<<
@@ -16905,7 +16925,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_
__pyx_t_1 = (__pyx_v_i == __pyx_v_j);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":341
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":341
* raise Exception("Sort error in CLex")
* if i == j: #empty interval
* return # <<<<<<<<<<<<<<
@@ -16919,7 +16939,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":342
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":342
* if i == j: #empty interval
* return
* if i == j-1: # singleton interval # <<<<<<<<<<<<<<
@@ -16929,7 +16949,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_
__pyx_t_1 = (__pyx_v_i == (__pyx_v_j - 1));
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":343
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":343
* return
* if i == j-1: # singleton interval
* return # <<<<<<<<<<<<<<
@@ -16943,7 +16963,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":345
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":345
* return
*
* p = (i+j)/2 # <<<<<<<<<<<<<<
@@ -16952,7 +16972,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_
*/
__pyx_v_p = __Pyx_div_long((__pyx_v_i + __pyx_v_j), 2);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":346
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":346
*
* p = (i+j)/2
* pval = self.e_index.arr[p] # <<<<<<<<<<<<<<
@@ -16961,7 +16981,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_
*/
__pyx_v_pval = (__pyx_v_self->e_index->arr[__pyx_v_p]);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":347
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":347
* p = (i+j)/2
* pval = self.e_index.arr[p]
* self.swap(i, p) # <<<<<<<<<<<<<<
@@ -16972,7 +16992,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":348
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":348
* pval = self.e_index.arr[p]
* self.swap(i, p)
* p = i # <<<<<<<<<<<<<<
@@ -16981,7 +17001,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_
*/
__pyx_v_p = __pyx_v_i;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":349
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":349
* self.swap(i, p)
* p = i
* for k from i+1 <= k < j: # <<<<<<<<<<<<<<
@@ -16991,7 +17011,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_
__pyx_t_3 = __pyx_v_j;
for (__pyx_v_k = (__pyx_v_i + 1); __pyx_v_k < __pyx_t_3; __pyx_v_k++) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":350
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":350
* p = i
* for k from i+1 <= k < j:
* if pval >= self.e_index.arr[k]: # <<<<<<<<<<<<<<
@@ -17001,7 +17021,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_
__pyx_t_1 = (__pyx_v_pval >= (__pyx_v_self->e_index->arr[__pyx_v_k]));
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":351
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":351
* for k from i+1 <= k < j:
* if pval >= self.e_index.arr[k]:
* self.swap(p+1, k) # <<<<<<<<<<<<<<
@@ -17012,7 +17032,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":352
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":352
* if pval >= self.e_index.arr[k]:
* self.swap(p+1, k)
* self.swap(p, p+1) # <<<<<<<<<<<<<<
@@ -17023,7 +17043,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":353
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":353
* self.swap(p+1, k)
* self.swap(p, p+1)
* p = p + 1 # <<<<<<<<<<<<<<
@@ -17036,7 +17056,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_
__pyx_L8:;
}
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":354
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":354
* self.swap(p, p+1)
* p = p + 1
* self.qsort(i,p, pad+" ") # <<<<<<<<<<<<<<
@@ -17050,7 +17070,7 @@ static PyObject *__pyx_f_3_sa_5BiLex_qsort(struct __pyx_obj_3_sa_BiLex *__pyx_v_
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":355
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":355
* p = p + 1
* self.qsort(i,p, pad+" ")
* self.qsort(p+1,j, pad+" ") # <<<<<<<<<<<<<<
@@ -17098,7 +17118,7 @@ static PyObject *__pyx_pw_3_sa_5BiLex_13write_enhanced(PyObject *__pyx_v_self, P
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":358
+/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":358
*
*
* def write_enhanced(self, char* filename): # <<<<<<<<<<<<<<
@@ -17135,7 +17155,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_enhanced", 0);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":359
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":359
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -17175,7 +17195,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL
__pyx_v_f = __pyx_t_4;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":360
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":360
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f:
* for i in self.f_index: # <<<<<<<<<<<<<<
@@ -17220,7 +17240,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL
__pyx_v_i = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":361
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":361
* with open(filename, "w") as f:
* for i in self.f_index:
* f.write("%d " % i) # <<<<<<<<<<<<<<
@@ -17244,7 +17264,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":362
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":362
* for i in self.f_index:
* f.write("%d " % i)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -17258,7 +17278,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":363
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":363
* f.write("%d " % i)
* f.write("\n")
* for i, s1, s2 in zip(self.e_index, self.col1, self.col2): # <<<<<<<<<<<<<<
@@ -17379,7 +17399,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL
__pyx_v_s2 = __pyx_t_11;
__pyx_t_11 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":364
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":364
* f.write("\n")
* for i, s1, s2 in zip(self.e_index, self.col1, self.col2):
* f.write("%d %f %f " % (i, s1, s2)) # <<<<<<<<<<<<<<
@@ -17415,7 +17435,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":365
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":365
* for i, s1, s2 in zip(self.e_index, self.col1, self.col2):
* f.write("%d %f %f " % (i, s1, s2))
* f.write("\n") # <<<<<<<<<<<<<<
@@ -17429,7 +17449,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":366
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":366
* f.write("%d %f %f " % (i, s1, s2))
* f.write("\n")
* for i, w in enumerate(self.id2fword): # <<<<<<<<<<<<<<
@@ -17484,7 +17504,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL
__pyx_t_1 = __pyx_t_11;
__pyx_t_11 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":367
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":367
* f.write("\n")
* for i, w in enumerate(self.id2fword):
* f.write("%d %s " % (i, w)) # <<<<<<<<<<<<<<
@@ -17518,7 +17538,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":368
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":368
* for i, w in enumerate(self.id2fword):
* f.write("%d %s " % (i, w))
* f.write("\n") # <<<<<<<<<<<<<<
@@ -17532,7 +17552,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":369
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":369
* f.write("%d %s " % (i, w))
* f.write("\n")
* for i, w in enumerate(self.id2eword): # <<<<<<<<<<<<<<
@@ -17587,7 +17607,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL
__pyx_t_2 = __pyx_t_10;
__pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":370
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":370
* f.write("\n")
* for i, w in enumerate(self.id2eword):
* f.write("%d %s " % (i, w)) # <<<<<<<<<<<<<<
@@ -17621,7 +17641,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":371
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":371
* for i, w in enumerate(self.id2eword):
* f.write("%d %s " % (i, w))
* f.write("\n") # <<<<<<<<<<<<<<
@@ -17647,7 +17667,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_12write_enhanced(struct __pyx_obj_3_sa_BiL
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":359
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":359
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -17814,7 +17834,7 @@ static PyObject *__pyx_pw_3_sa_5BiLex_15get_score(PyObject *__pyx_v_self, PyObje
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":374
+/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":374
*
*
* def get_score(self, fword, eword, col): # <<<<<<<<<<<<<<
@@ -17840,7 +17860,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_score", 0);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":377
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":377
* cdef e_id, f_id, low, high, midpoint, val
*
* if eword not in self.eword2id: # <<<<<<<<<<<<<<
@@ -17850,7 +17870,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_
__pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_eword, __pyx_v_self->eword2id, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":378
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":378
*
* if eword not in self.eword2id:
* return None # <<<<<<<<<<<<<<
@@ -17865,7 +17885,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":379
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":379
* if eword not in self.eword2id:
* return None
* if fword not in self.fword2id: # <<<<<<<<<<<<<<
@@ -17875,7 +17895,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_
__pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_fword, __pyx_v_self->fword2id, Py_NE)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":380
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":380
* return None
* if fword not in self.fword2id:
* return None # <<<<<<<<<<<<<<
@@ -17890,7 +17910,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":381
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":381
* if fword not in self.fword2id:
* return None
* f_id = self.fword2id[fword] # <<<<<<<<<<<<<<
@@ -17902,7 +17922,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_
__pyx_v_f_id = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":382
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":382
* return None
* f_id = self.fword2id[fword]
* e_id = self.eword2id[eword] # <<<<<<<<<<<<<<
@@ -17914,7 +17934,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_
__pyx_v_e_id = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":383
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":383
* f_id = self.fword2id[fword]
* e_id = self.eword2id[eword]
* low = self.f_index.arr[f_id] # <<<<<<<<<<<<<<
@@ -17927,7 +17947,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_
__pyx_v_low = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":384
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":384
* e_id = self.eword2id[eword]
* low = self.f_index.arr[f_id]
* high = self.f_index.arr[f_id+1] # <<<<<<<<<<<<<<
@@ -17943,7 +17963,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_
__pyx_v_high = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":385
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":385
* low = self.f_index.arr[f_id]
* high = self.f_index.arr[f_id+1]
* while high - low > 0: # <<<<<<<<<<<<<<
@@ -17959,7 +17979,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!__pyx_t_1) break;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":386
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":386
* high = self.f_index.arr[f_id+1]
* while high - low > 0:
* midpoint = (low+high)/2 # <<<<<<<<<<<<<<
@@ -17975,7 +17995,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_
__pyx_v_midpoint = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":387
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":387
* while high - low > 0:
* midpoint = (low+high)/2
* val = self.e_index.arr[midpoint] # <<<<<<<<<<<<<<
@@ -17989,7 +18009,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_
__pyx_v_val = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":388
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":388
* midpoint = (low+high)/2
* val = self.e_index.arr[midpoint]
* if val == e_id: # <<<<<<<<<<<<<<
@@ -18001,7 +18021,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":389
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":389
* val = self.e_index.arr[midpoint]
* if val == e_id:
* if col == 0: # <<<<<<<<<<<<<<
@@ -18013,7 +18033,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":390
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":390
* if val == e_id:
* if col == 0:
* return self.col1.arr[midpoint] # <<<<<<<<<<<<<<
@@ -18031,7 +18051,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_
}
__pyx_L8:;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":391
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":391
* if col == 0:
* return self.col1.arr[midpoint]
* if col == 1: # <<<<<<<<<<<<<<
@@ -18043,7 +18063,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":392
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":392
* return self.col1.arr[midpoint]
* if col == 1:
* return self.col2.arr[midpoint] # <<<<<<<<<<<<<<
@@ -18064,7 +18084,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_
}
__pyx_L7:;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":393
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":393
* if col == 1:
* return self.col2.arr[midpoint]
* if val > e_id: # <<<<<<<<<<<<<<
@@ -18076,7 +18096,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":394
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":394
* return self.col2.arr[midpoint]
* if val > e_id:
* high = midpoint # <<<<<<<<<<<<<<
@@ -18090,7 +18110,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_
}
__pyx_L10:;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":395
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":395
* if val > e_id:
* high = midpoint
* if val < e_id: # <<<<<<<<<<<<<<
@@ -18102,7 +18122,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":396
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":396
* high = midpoint
* if val < e_id:
* low = midpoint + 1 # <<<<<<<<<<<<<<
@@ -18119,7 +18139,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_14get_score(struct __pyx_obj_3_sa_BiLex *_
__pyx_L11:;
}
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":397
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":397
* if val < e_id:
* low = midpoint + 1
* return None # <<<<<<<<<<<<<<
@@ -18172,7 +18192,7 @@ static PyObject *__pyx_pw_3_sa_5BiLex_17write_text(PyObject *__pyx_v_self, PyObj
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":400
+/* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":400
*
*
* def write_text(self, char* filename): # <<<<<<<<<<<<<<
@@ -18209,7 +18229,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex *
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_text", 0);
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":404
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":404
* cdef i, N, e_id, f_id
*
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -18249,7 +18269,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex *
__pyx_v_f = __pyx_t_4;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":405
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":405
*
* with open(filename, "w") as f:
* N = len(self.e_index) # <<<<<<<<<<<<<<
@@ -18265,7 +18285,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex *
__pyx_v_N = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":406
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":406
* with open(filename, "w") as f:
* N = len(self.e_index)
* f_id = 0 # <<<<<<<<<<<<<<
@@ -18275,7 +18295,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex *
__Pyx_INCREF(__pyx_int_0);
__pyx_v_f_id = __pyx_int_0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":407
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":407
* N = len(self.e_index)
* f_id = 0
* for i from 0 <= i < N: # <<<<<<<<<<<<<<
@@ -18290,7 +18310,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex *
__pyx_v_i = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":408
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":408
* f_id = 0
* for i from 0 <= i < N:
* while self.f_index.arr[f_id+1] == i: # <<<<<<<<<<<<<<
@@ -18310,7 +18330,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex *
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!__pyx_t_11) break;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":409
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":409
* for i from 0 <= i < N:
* while self.f_index.arr[f_id+1] == i:
* f_id = f_id + 1 # <<<<<<<<<<<<<<
@@ -18324,7 +18344,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex *
__pyx_t_1 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":410
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":410
* while self.f_index.arr[f_id+1] == i:
* f_id = f_id + 1
* e_id = self.e_index.arr[i] # <<<<<<<<<<<<<<
@@ -18338,7 +18358,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex *
__pyx_v_e_id = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":411
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":411
* f_id = f_id + 1
* e_id = self.e_index.arr[i]
* score1 = self.col1.arr[i] # <<<<<<<<<<<<<<
@@ -18352,7 +18372,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex *
__pyx_v_score1 = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":412
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":412
* e_id = self.e_index.arr[i]
* score1 = self.col1.arr[i]
* score2 = self.col2.arr[i] # <<<<<<<<<<<<<<
@@ -18365,7 +18385,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex *
__pyx_v_score2 = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":413
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":413
* score1 = self.col1.arr[i]
* score2 = self.col2.arr[i]
* f.write("%s %s %.6f %.6f\n" % (self.id2fword[f_id], self.id2eword[e_id], score1, score2)) # <<<<<<<<<<<<<<
@@ -18406,7 +18426,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex *
__pyx_t_10 = __Pyx_PyInt_AsLong(__pyx_v_i); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
}
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":407
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":407
* N = len(self.e_index)
* f_id = 0
* for i from 0 <= i < N: # <<<<<<<<<<<<<<
@@ -18429,7 +18449,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex *
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":404
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":404
* cdef i, N, e_id, f_id
*
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -18531,7 +18551,7 @@ static PyObject *__pyx_pf_3_sa_5BiLex_16write_text(struct __pyx_obj_3_sa_BiLex *
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":21
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":21
* cdef int LOWER_MASK[32]
*
* cdef void _init_lower_mask(): # <<<<<<<<<<<<<<
@@ -18547,7 +18567,7 @@ static void __pyx_f_3_sa__init_lower_mask(void) {
unsigned int __pyx_t_2;
__Pyx_RefNannySetupContext("_init_lower_mask", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":23
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":23
* cdef void _init_lower_mask():
* cdef unsigned i
* cdef int mask = 0 # <<<<<<<<<<<<<<
@@ -18556,7 +18576,7 @@ static void __pyx_f_3_sa__init_lower_mask(void) {
*/
__pyx_v_mask = 0;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":24
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":24
* cdef unsigned i
* cdef int mask = 0
* for i in range(MIN_BOTTOM_SIZE): # <<<<<<<<<<<<<<
@@ -18567,7 +18587,7 @@ static void __pyx_f_3_sa__init_lower_mask(void) {
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":25
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":25
* cdef int mask = 0
* for i in range(MIN_BOTTOM_SIZE):
* mask = (mask << 1) + 1 # <<<<<<<<<<<<<<
@@ -18576,7 +18596,7 @@ static void __pyx_f_3_sa__init_lower_mask(void) {
*/
__pyx_v_mask = ((__pyx_v_mask << 1) + 1);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":26
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":26
* for i in range(MIN_BOTTOM_SIZE):
* mask = (mask << 1) + 1
* LOWER_MASK[i] = mask # <<<<<<<<<<<<<<
@@ -18589,7 +18609,7 @@ static void __pyx_f_3_sa__init_lower_mask(void) {
__Pyx_RefNannyFinishContext();
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":37
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":37
*
*
* cdef _BitSet* new_BitSet(): # <<<<<<<<<<<<<<
@@ -18603,7 +18623,7 @@ static struct __pyx_t_3_sa__BitSet *__pyx_f_3_sa_new_BitSet(void) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("new_BitSet", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":40
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":40
* cdef _BitSet* b
*
* b = <_BitSet*> malloc(sizeof(_BitSet)) # <<<<<<<<<<<<<<
@@ -18612,7 +18632,7 @@ static struct __pyx_t_3_sa__BitSet *__pyx_f_3_sa_new_BitSet(void) {
*/
__pyx_v_b = ((struct __pyx_t_3_sa__BitSet *)malloc((sizeof(struct __pyx_t_3_sa__BitSet))));
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":41
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":41
*
* b = <_BitSet*> malloc(sizeof(_BitSet))
* b.bitset = 0 # <<<<<<<<<<<<<<
@@ -18621,7 +18641,7 @@ static struct __pyx_t_3_sa__BitSet *__pyx_f_3_sa_new_BitSet(void) {
*/
__pyx_v_b->bitset = 0;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":42
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":42
* b = <_BitSet*> malloc(sizeof(_BitSet))
* b.bitset = 0
* b.min_val = -1 # <<<<<<<<<<<<<<
@@ -18630,7 +18650,7 @@ static struct __pyx_t_3_sa__BitSet *__pyx_f_3_sa_new_BitSet(void) {
*/
__pyx_v_b->min_val = -1;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":43
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":43
* b.bitset = 0
* b.min_val = -1
* b.max_val = -1 # <<<<<<<<<<<<<<
@@ -18639,7 +18659,7 @@ static struct __pyx_t_3_sa__BitSet *__pyx_f_3_sa_new_BitSet(void) {
*/
__pyx_v_b->max_val = -1;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":44
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":44
* b.min_val = -1
* b.max_val = -1
* b.size = 0 # <<<<<<<<<<<<<<
@@ -18648,7 +18668,7 @@ static struct __pyx_t_3_sa__BitSet *__pyx_f_3_sa_new_BitSet(void) {
*/
__pyx_v_b->size = 0;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":45
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":45
* b.max_val = -1
* b.size = 0
* return b # <<<<<<<<<<<<<<
@@ -18664,7 +18684,7 @@ static struct __pyx_t_3_sa__BitSet *__pyx_f_3_sa_new_BitSet(void) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":48
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":48
*
*
* cdef int bitset_findsucc(_BitSet* b, int i): # <<<<<<<<<<<<<<
@@ -18685,7 +18705,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b,
int __pyx_t_3;
__Pyx_RefNannySetupContext("bitset_findsucc", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":52
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":52
* cdef int low, high, mid
*
* if b.max_val == -1 or i >= b.max_val: # <<<<<<<<<<<<<<
@@ -18701,7 +18721,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b,
}
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":53
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":53
*
* if b.max_val == -1 or i >= b.max_val:
* return -1 # <<<<<<<<<<<<<<
@@ -18714,7 +18734,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b,
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":54
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":54
* if b.max_val == -1 or i >= b.max_val:
* return -1
* if i < b.min_val: # <<<<<<<<<<<<<<
@@ -18724,7 +18744,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b,
__pyx_t_3 = (__pyx_v_i < __pyx_v_b->min_val);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":55
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":55
* return -1
* if i < b.min_val:
* return b.min_val # <<<<<<<<<<<<<<
@@ -18737,7 +18757,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b,
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":57
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":57
* return b.min_val
*
* bitset = b.bitset & ~LOWER_MASK[i] # <<<<<<<<<<<<<<
@@ -18746,7 +18766,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b,
*/
__pyx_v_bitset = (__pyx_v_b->bitset & (~(__pyx_v_3_sa_LOWER_MASK[__pyx_v_i])));
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":58
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":58
*
* bitset = b.bitset & ~LOWER_MASK[i]
* low = i+1 # <<<<<<<<<<<<<<
@@ -18755,7 +18775,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b,
*/
__pyx_v_low = (__pyx_v_i + 1);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":59
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":59
* bitset = b.bitset & ~LOWER_MASK[i]
* low = i+1
* high = b.max_val+1 # <<<<<<<<<<<<<<
@@ -18764,7 +18784,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b,
*/
__pyx_v_high = (__pyx_v_b->max_val + 1);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":60
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":60
* low = i+1
* high = b.max_val+1
* while low < high-1: # <<<<<<<<<<<<<<
@@ -18775,7 +18795,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b,
__pyx_t_3 = (__pyx_v_low < (__pyx_v_high - 1));
if (!__pyx_t_3) break;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":61
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":61
* high = b.max_val+1
* while low < high-1:
* mid = (high + low)/2 # <<<<<<<<<<<<<<
@@ -18784,7 +18804,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b,
*/
__pyx_v_mid = __Pyx_div_long((__pyx_v_high + __pyx_v_low), 2);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":62
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":62
* while low < high-1:
* mid = (high + low)/2
* mask = ~(LOWER_MASK[high-1] ^ LOWER_MASK[mid-1]) # <<<<<<<<<<<<<<
@@ -18793,7 +18813,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b,
*/
__pyx_v_mask = (~((__pyx_v_3_sa_LOWER_MASK[(__pyx_v_high - 1)]) ^ (__pyx_v_3_sa_LOWER_MASK[(__pyx_v_mid - 1)])));
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":63
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":63
* mid = (high + low)/2
* mask = ~(LOWER_MASK[high-1] ^ LOWER_MASK[mid-1])
* if bitset & mask == 0: # <<<<<<<<<<<<<<
@@ -18803,7 +18823,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b,
__pyx_t_3 = ((__pyx_v_bitset & __pyx_v_mask) == 0);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":64
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":64
* mask = ~(LOWER_MASK[high-1] ^ LOWER_MASK[mid-1])
* if bitset & mask == 0:
* low = mid # <<<<<<<<<<<<<<
@@ -18815,7 +18835,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b,
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":66
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":66
* low = mid
* else:
* bitset = bitset & mask # <<<<<<<<<<<<<<
@@ -18824,7 +18844,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b,
*/
__pyx_v_bitset = (__pyx_v_bitset & __pyx_v_mask);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":67
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":67
* else:
* bitset = bitset & mask
* high = mid # <<<<<<<<<<<<<<
@@ -18836,7 +18856,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b,
__pyx_L7:;
}
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":68
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":68
* bitset = bitset & mask
* high = mid
* return low # <<<<<<<<<<<<<<
@@ -18852,7 +18872,7 @@ static int __pyx_f_3_sa_bitset_findsucc(struct __pyx_t_3_sa__BitSet *__pyx_v_b,
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":71
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":71
*
*
* cdef int bitset_insert(_BitSet* b, int i): # <<<<<<<<<<<<<<
@@ -18867,7 +18887,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in
int __pyx_t_1;
__Pyx_RefNannySetupContext("bitset_insert", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":74
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":74
* cdef int val
*
* val = 1 << i # <<<<<<<<<<<<<<
@@ -18876,7 +18896,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in
*/
__pyx_v_val = (1 << __pyx_v_i);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":75
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":75
*
* val = 1 << i
* if b.bitset & val == 0: # <<<<<<<<<<<<<<
@@ -18886,7 +18906,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in
__pyx_t_1 = ((__pyx_v_b->bitset & __pyx_v_val) == 0);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":76
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":76
* val = 1 << i
* if b.bitset & val == 0:
* b.bitset = b.bitset | val # <<<<<<<<<<<<<<
@@ -18895,7 +18915,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in
*/
__pyx_v_b->bitset = (__pyx_v_b->bitset | __pyx_v_val);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":77
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":77
* if b.bitset & val == 0:
* b.bitset = b.bitset | val
* if b.size == 0: # <<<<<<<<<<<<<<
@@ -18905,7 +18925,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in
__pyx_t_1 = (__pyx_v_b->size == 0);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":78
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":78
* b.bitset = b.bitset | val
* if b.size == 0:
* b.min_val = i # <<<<<<<<<<<<<<
@@ -18914,7 +18934,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in
*/
__pyx_v_b->min_val = __pyx_v_i;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":79
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":79
* if b.size == 0:
* b.min_val = i
* b.max_val = i # <<<<<<<<<<<<<<
@@ -18926,7 +18946,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":81
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":81
* b.max_val = i
* else:
* if i < b.min_val: # <<<<<<<<<<<<<<
@@ -18936,7 +18956,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in
__pyx_t_1 = (__pyx_v_i < __pyx_v_b->min_val);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":82
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":82
* else:
* if i < b.min_val:
* b.min_val = i # <<<<<<<<<<<<<<
@@ -18948,7 +18968,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":83
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":83
* if i < b.min_val:
* b.min_val = i
* if i > b.max_val: # <<<<<<<<<<<<<<
@@ -18958,7 +18978,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in
__pyx_t_1 = (__pyx_v_i > __pyx_v_b->max_val);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":84
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":84
* b.min_val = i
* if i > b.max_val:
* b.max_val = i # <<<<<<<<<<<<<<
@@ -18972,7 +18992,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":85
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":85
* if i > b.max_val:
* b.max_val = i
* b.size = b.size + 1 # <<<<<<<<<<<<<<
@@ -18981,7 +19001,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in
*/
__pyx_v_b->size = (__pyx_v_b->size + 1);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":86
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":86
* b.max_val = i
* b.size = b.size + 1
* return 1 # <<<<<<<<<<<<<<
@@ -18994,7 +19014,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":87
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":87
* b.size = b.size + 1
* return 1
* return 0 # <<<<<<<<<<<<<<
@@ -19010,7 +19030,7 @@ static int __pyx_f_3_sa_bitset_insert(struct __pyx_t_3_sa__BitSet *__pyx_v_b, in
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":90
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":90
*
*
* cdef int bitset_contains(_BitSet* b, int i): # <<<<<<<<<<<<<<
@@ -19025,7 +19045,7 @@ static int __pyx_f_3_sa_bitset_contains(struct __pyx_t_3_sa__BitSet *__pyx_v_b,
int __pyx_t_1;
__Pyx_RefNannySetupContext("bitset_contains", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":93
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":93
* cdef int val
*
* val = 1 << i # <<<<<<<<<<<<<<
@@ -19034,7 +19054,7 @@ static int __pyx_f_3_sa_bitset_contains(struct __pyx_t_3_sa__BitSet *__pyx_v_b,
*/
__pyx_v_val = (1 << __pyx_v_i);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":94
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":94
*
* val = 1 << i
* if b.bitset & val == 0: # <<<<<<<<<<<<<<
@@ -19044,7 +19064,7 @@ static int __pyx_f_3_sa_bitset_contains(struct __pyx_t_3_sa__BitSet *__pyx_v_b,
__pyx_t_1 = ((__pyx_v_b->bitset & __pyx_v_val) == 0);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":95
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":95
* val = 1 << i
* if b.bitset & val == 0:
* return 0 # <<<<<<<<<<<<<<
@@ -19057,7 +19077,7 @@ static int __pyx_f_3_sa_bitset_contains(struct __pyx_t_3_sa__BitSet *__pyx_v_b,
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":97
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":97
* return 0
* else:
* return 1 # <<<<<<<<<<<<<<
@@ -19086,7 +19106,7 @@ static PyObject *__pyx_pw_3_sa_14BitSetIterator_1__next__(PyObject *__pyx_v_self
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":104
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":104
* cdef int next_val
*
* def __next__(self): # <<<<<<<<<<<<<<
@@ -19105,7 +19125,7 @@ static PyObject *__pyx_pf_3_sa_14BitSetIterator___next__(struct __pyx_obj_3_sa_B
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__next__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":107
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":107
* cdef int ret_val
*
* if self.next_val == -1: # <<<<<<<<<<<<<<
@@ -19115,7 +19135,7 @@ static PyObject *__pyx_pf_3_sa_14BitSetIterator___next__(struct __pyx_obj_3_sa_B
__pyx_t_1 = (__pyx_v_self->next_val == -1);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":108
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":108
*
* if self.next_val == -1:
* raise StopIteration() # <<<<<<<<<<<<<<
@@ -19131,7 +19151,7 @@ static PyObject *__pyx_pf_3_sa_14BitSetIterator___next__(struct __pyx_obj_3_sa_B
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":109
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":109
* if self.next_val == -1:
* raise StopIteration()
* ret_val = self.next_val # <<<<<<<<<<<<<<
@@ -19140,7 +19160,7 @@ static PyObject *__pyx_pf_3_sa_14BitSetIterator___next__(struct __pyx_obj_3_sa_B
*/
__pyx_v_ret_val = __pyx_v_self->next_val;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":110
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":110
* raise StopIteration()
* ret_val = self.next_val
* self.next_val = bitset_findsucc(self.b, ret_val) # <<<<<<<<<<<<<<
@@ -19149,7 +19169,7 @@ static PyObject *__pyx_pf_3_sa_14BitSetIterator___next__(struct __pyx_obj_3_sa_B
*/
__pyx_v_self->next_val = __pyx_f_3_sa_bitset_findsucc(__pyx_v_self->b, __pyx_v_ret_val);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":111
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":111
* ret_val = self.next_val
* self.next_val = bitset_findsucc(self.b, ret_val)
* return ret_val # <<<<<<<<<<<<<<
@@ -19189,7 +19209,7 @@ static int __pyx_pw_3_sa_6BitSet_1__cinit__(PyObject *__pyx_v_self, PyObject *__
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":122
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":122
* cdef _BitSet* b
*
* def __cinit__(self): # <<<<<<<<<<<<<<
@@ -19202,7 +19222,7 @@ static int __pyx_pf_3_sa_6BitSet___cinit__(struct __pyx_obj_3_sa_BitSet *__pyx_v
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":123
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":123
*
* def __cinit__(self):
* self.b = new_BitSet() # <<<<<<<<<<<<<<
@@ -19225,7 +19245,7 @@ static void __pyx_pw_3_sa_6BitSet_3__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyFinishContext();
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":125
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":125
* self.b = new_BitSet()
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -19237,7 +19257,7 @@ static void __pyx_pf_3_sa_6BitSet_2__dealloc__(struct __pyx_obj_3_sa_BitSet *__p
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":126
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":126
*
* def __dealloc__(self):
* free(self.b) # <<<<<<<<<<<<<<
@@ -19260,7 +19280,7 @@ static PyObject *__pyx_pw_3_sa_6BitSet_5__iter__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":128
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":128
* free(self.b)
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -19278,7 +19298,7 @@ static PyObject *__pyx_pf_3_sa_6BitSet_4__iter__(struct __pyx_obj_3_sa_BitSet *_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__iter__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":130
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":130
* def __iter__(self):
* cdef BitSetIterator it
* it = BitSetIterator() # <<<<<<<<<<<<<<
@@ -19290,7 +19310,7 @@ static PyObject *__pyx_pf_3_sa_6BitSet_4__iter__(struct __pyx_obj_3_sa_BitSet *_
__pyx_v_it = ((struct __pyx_obj_3_sa_BitSetIterator *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":131
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":131
* cdef BitSetIterator it
* it = BitSetIterator()
* it.b = self.b # <<<<<<<<<<<<<<
@@ -19299,7 +19319,7 @@ static PyObject *__pyx_pf_3_sa_6BitSet_4__iter__(struct __pyx_obj_3_sa_BitSet *_
*/
__pyx_v_it->b = __pyx_v_self->b;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":132
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":132
* it = BitSetIterator()
* it.b = self.b
* it.next_val = self.b.min_val # <<<<<<<<<<<<<<
@@ -19308,7 +19328,7 @@ static PyObject *__pyx_pf_3_sa_6BitSet_4__iter__(struct __pyx_obj_3_sa_BitSet *_
*/
__pyx_v_it->next_val = __pyx_v_self->b->min_val;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":133
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":133
* it.b = self.b
* it.next_val = self.b.min_val
* return it # <<<<<<<<<<<<<<
@@ -19344,7 +19364,7 @@ static PyObject *__pyx_pw_3_sa_6BitSet_7insert(PyObject *__pyx_v_self, PyObject
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":135
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":135
* return it
*
* def insert(self, i): # <<<<<<<<<<<<<<
@@ -19362,7 +19382,7 @@ static PyObject *__pyx_pf_3_sa_6BitSet_6insert(struct __pyx_obj_3_sa_BitSet *__p
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("insert", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":136
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":136
*
* def insert(self, i):
* return bitset_insert(self.b, i) # <<<<<<<<<<<<<<
@@ -19400,7 +19420,7 @@ static PyObject *__pyx_pw_3_sa_6BitSet_9findsucc(PyObject *__pyx_v_self, PyObjec
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":138
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":138
* return bitset_insert(self.b, i)
*
* def findsucc(self, i): # <<<<<<<<<<<<<<
@@ -19418,7 +19438,7 @@ static PyObject *__pyx_pf_3_sa_6BitSet_8findsucc(struct __pyx_obj_3_sa_BitSet *_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("findsucc", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":139
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":139
*
* def findsucc(self, i):
* return bitset_findsucc(self.b, i) # <<<<<<<<<<<<<<
@@ -19456,7 +19476,7 @@ static PyObject *__pyx_pw_3_sa_6BitSet_11__str__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":141
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":141
* return bitset_findsucc(self.b, i)
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -19475,7 +19495,7 @@ static PyObject *__pyx_pf_3_sa_6BitSet_10__str__(struct __pyx_obj_3_sa_BitSet *_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__str__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":142
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":142
*
* def __str__(self):
* return dec2bin(self.b.bitset)+" ("+str(self.b.size)+","+str(self.b.min_val)+","+str(self.b.max_val)+")" # <<<<<<<<<<<<<<
@@ -19568,7 +19588,7 @@ static PyObject *__pyx_pw_3_sa_6BitSet_13min(PyObject *__pyx_v_self, CYTHON_UNUS
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":144
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":144
* return dec2bin(self.b.bitset)+" ("+str(self.b.size)+","+str(self.b.min_val)+","+str(self.b.max_val)+")"
*
* def min(self): # <<<<<<<<<<<<<<
@@ -19585,7 +19605,7 @@ static PyObject *__pyx_pf_3_sa_6BitSet_12min(struct __pyx_obj_3_sa_BitSet *__pyx
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("min", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":145
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":145
*
* def min(self):
* return self.b.min_val # <<<<<<<<<<<<<<
@@ -19622,7 +19642,7 @@ static PyObject *__pyx_pw_3_sa_6BitSet_15max(PyObject *__pyx_v_self, CYTHON_UNUS
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":147
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":147
* return self.b.min_val
*
* def max(self): # <<<<<<<<<<<<<<
@@ -19639,7 +19659,7 @@ static PyObject *__pyx_pf_3_sa_6BitSet_14max(struct __pyx_obj_3_sa_BitSet *__pyx
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("max", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":148
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":148
*
* def max(self):
* return self.b.max_val # <<<<<<<<<<<<<<
@@ -19676,7 +19696,7 @@ static Py_ssize_t __pyx_pw_3_sa_6BitSet_17__len__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":150
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":150
* return self.b.max_val
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -19689,7 +19709,7 @@ static Py_ssize_t __pyx_pf_3_sa_6BitSet_16__len__(struct __pyx_obj_3_sa_BitSet *
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":151
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":151
*
* def __len__(self):
* return self.b.size # <<<<<<<<<<<<<<
@@ -19716,7 +19736,7 @@ static int __pyx_pw_3_sa_6BitSet_19__contains__(PyObject *__pyx_v_self, PyObject
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":153
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":153
* return self.b.size
*
* def __contains__(self, i): # <<<<<<<<<<<<<<
@@ -19735,7 +19755,7 @@ static int __pyx_pf_3_sa_6BitSet_18__contains__(struct __pyx_obj_3_sa_BitSet *__
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__contains__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":154
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":154
*
* def __contains__(self, i):
* return bool(bitset_contains(self.b, i)) # <<<<<<<<<<<<<<
@@ -19761,7 +19781,7 @@ static int __pyx_pf_3_sa_6BitSet_18__contains__(struct __pyx_obj_3_sa_BitSet *__
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":157
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":157
*
*
* cdef str dec2bin(long i): # <<<<<<<<<<<<<<
@@ -19783,7 +19803,7 @@ static PyObject *__pyx_f_3_sa_dec2bin(long __pyx_v_i) {
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("dec2bin", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":158
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":158
*
* cdef str dec2bin(long i):
* cdef str result = "" # <<<<<<<<<<<<<<
@@ -19793,7 +19813,7 @@ static PyObject *__pyx_f_3_sa_dec2bin(long __pyx_v_i) {
__Pyx_INCREF(((PyObject *)__pyx_kp_s_45));
__pyx_v_result = __pyx_kp_s_45;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":160
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":160
* cdef str result = ""
* cdef unsigned d
* for d in range(MIN_BOTTOM_SIZE): # <<<<<<<<<<<<<<
@@ -19804,7 +19824,7 @@ static PyObject *__pyx_f_3_sa_dec2bin(long __pyx_v_i) {
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_d = __pyx_t_2;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":161
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":161
* cdef unsigned d
* for d in range(MIN_BOTTOM_SIZE):
* if i & LOWER_MASK[0] == 0: # <<<<<<<<<<<<<<
@@ -19814,7 +19834,7 @@ static PyObject *__pyx_f_3_sa_dec2bin(long __pyx_v_i) {
__pyx_t_3 = ((__pyx_v_i & (__pyx_v_3_sa_LOWER_MASK[0])) == 0);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":162
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":162
* for d in range(MIN_BOTTOM_SIZE):
* if i & LOWER_MASK[0] == 0:
* result = "0"+result # <<<<<<<<<<<<<<
@@ -19830,7 +19850,7 @@ static PyObject *__pyx_f_3_sa_dec2bin(long __pyx_v_i) {
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":164
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":164
* result = "0"+result
* else:
* result = "1"+result # <<<<<<<<<<<<<<
@@ -19845,7 +19865,7 @@ static PyObject *__pyx_f_3_sa_dec2bin(long __pyx_v_i) {
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":165
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":165
* else:
* result = "1"+result
* i = i >> 1 # <<<<<<<<<<<<<<
@@ -19855,7 +19875,7 @@ static PyObject *__pyx_f_3_sa_dec2bin(long __pyx_v_i) {
__pyx_v_i = (__pyx_v_i >> 1);
}
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":166
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":166
* result = "1"+result
* i = i >> 1
* return result # <<<<<<<<<<<<<<
@@ -19880,7 +19900,7 @@ static PyObject *__pyx_f_3_sa_dec2bin(long __pyx_v_i) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":177
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":177
* void** bottom
*
* cdef _VEB* new_VEB(int n): # <<<<<<<<<<<<<<
@@ -19901,7 +19921,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) {
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("new_VEB", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":181
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":181
* cdef int num_bits, num_top_bits, i
*
* veb = <_VEB*> malloc(sizeof(_VEB)) # <<<<<<<<<<<<<<
@@ -19910,7 +19930,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) {
*/
__pyx_v_veb = ((struct __pyx_t_3_sa__VEB *)malloc((sizeof(struct __pyx_t_3_sa__VEB))));
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":183
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":183
* veb = <_VEB*> malloc(sizeof(_VEB))
*
* num_bits = int(ceil(log(n) / log(2))) # <<<<<<<<<<<<<<
@@ -19925,7 +19945,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) {
}
__pyx_v_num_bits = ((int)ceil((__pyx_t_1 / __pyx_t_2)));
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":184
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":184
*
* num_bits = int(ceil(log(n) / log(2)))
* veb.num_bottom_bits = num_bits/2 # <<<<<<<<<<<<<<
@@ -19934,7 +19954,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) {
*/
__pyx_v_veb->num_bottom_bits = __Pyx_div_long(__pyx_v_num_bits, 2);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":185
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":185
* num_bits = int(ceil(log(n) / log(2)))
* veb.num_bottom_bits = num_bits/2
* if veb.num_bottom_bits < MIN_BOTTOM_BITS: # <<<<<<<<<<<<<<
@@ -19944,7 +19964,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) {
__pyx_t_3 = (__pyx_v_veb->num_bottom_bits < __pyx_v_3_sa_MIN_BOTTOM_BITS);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":186
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":186
* veb.num_bottom_bits = num_bits/2
* if veb.num_bottom_bits < MIN_BOTTOM_BITS:
* veb.num_bottom_bits = MIN_BOTTOM_BITS # <<<<<<<<<<<<<<
@@ -19956,7 +19976,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) {
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":187
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":187
* if veb.num_bottom_bits < MIN_BOTTOM_BITS:
* veb.num_bottom_bits = MIN_BOTTOM_BITS
* veb.top_universe_size = (n >> veb.num_bottom_bits) + 1 # <<<<<<<<<<<<<<
@@ -19965,7 +19985,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) {
*/
__pyx_v_veb->top_universe_size = ((__pyx_v_n >> __pyx_v_veb->num_bottom_bits) + 1);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":189
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":189
* veb.top_universe_size = (n >> veb.num_bottom_bits) + 1
*
* veb.bottom = <void**> malloc(veb.top_universe_size * sizeof(void*)) # <<<<<<<<<<<<<<
@@ -19974,7 +19994,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) {
*/
__pyx_v_veb->bottom = ((void **)malloc((__pyx_v_veb->top_universe_size * (sizeof(void *)))));
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":190
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":190
*
* veb.bottom = <void**> malloc(veb.top_universe_size * sizeof(void*))
* memset(veb.bottom, 0, veb.top_universe_size * sizeof(void*)) # <<<<<<<<<<<<<<
@@ -19983,7 +20003,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) {
*/
memset(__pyx_v_veb->bottom, 0, (__pyx_v_veb->top_universe_size * (sizeof(void *))));
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":192
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":192
* memset(veb.bottom, 0, veb.top_universe_size * sizeof(void*))
*
* if veb.top_universe_size > MIN_BOTTOM_SIZE: # <<<<<<<<<<<<<<
@@ -19993,7 +20013,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) {
__pyx_t_3 = (__pyx_v_veb->top_universe_size > __pyx_v_3_sa_MIN_BOTTOM_SIZE);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":193
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":193
*
* if veb.top_universe_size > MIN_BOTTOM_SIZE:
* veb.top = new_VEB(veb.top_universe_size) # <<<<<<<<<<<<<<
@@ -20005,7 +20025,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) {
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":195
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":195
* veb.top = new_VEB(veb.top_universe_size)
* else:
* veb.top = new_BitSet() # <<<<<<<<<<<<<<
@@ -20016,7 +20036,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) {
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":197
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":197
* veb.top = new_BitSet()
*
* veb.max_val = -1 # <<<<<<<<<<<<<<
@@ -20025,7 +20045,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) {
*/
__pyx_v_veb->max_val = -1;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":198
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":198
*
* veb.max_val = -1
* veb.min_val = -1 # <<<<<<<<<<<<<<
@@ -20034,7 +20054,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) {
*/
__pyx_v_veb->min_val = -1;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":199
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":199
* veb.max_val = -1
* veb.min_val = -1
* veb.size = 0 # <<<<<<<<<<<<<<
@@ -20043,7 +20063,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) {
*/
__pyx_v_veb->size = 0;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":200
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":200
* veb.min_val = -1
* veb.size = 0
* return veb # <<<<<<<<<<<<<<
@@ -20063,7 +20083,7 @@ static struct __pyx_t_3_sa__VEB *__pyx_f_3_sa_new_VEB(int __pyx_v_n) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":203
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":203
*
*
* cdef int VEB_insert(_VEB* veb, int i): # <<<<<<<<<<<<<<
@@ -20084,7 +20104,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
int __pyx_t_3;
__Pyx_RefNannySetupContext("VEB_insert", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":208
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":208
* cdef int a, b, tmp
*
* if veb.size == 0: # <<<<<<<<<<<<<<
@@ -20094,7 +20114,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
__pyx_t_1 = (__pyx_v_veb->size == 0);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":209
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":209
*
* if veb.size == 0:
* veb.min_val = i # <<<<<<<<<<<<<<
@@ -20103,7 +20123,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
*/
__pyx_v_veb->min_val = __pyx_v_i;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":210
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":210
* if veb.size == 0:
* veb.min_val = i
* veb.max_val = i # <<<<<<<<<<<<<<
@@ -20114,7 +20134,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
goto __pyx_L3;
}
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":211
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":211
* veb.min_val = i
* veb.max_val = i
* elif i == veb.min_val or i == veb.max_val: # <<<<<<<<<<<<<<
@@ -20130,7 +20150,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
}
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":212
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":212
* veb.max_val = i
* elif i == veb.min_val or i == veb.max_val:
* return 0 # <<<<<<<<<<<<<<
@@ -20143,7 +20163,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":214
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":214
* return 0
* else:
* if i < veb.min_val: # <<<<<<<<<<<<<<
@@ -20153,7 +20173,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
__pyx_t_3 = (__pyx_v_i < __pyx_v_veb->min_val);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":215
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":215
* else:
* if i < veb.min_val:
* tmp = i # <<<<<<<<<<<<<<
@@ -20162,7 +20182,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
*/
__pyx_v_tmp = __pyx_v_i;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":216
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":216
* if i < veb.min_val:
* tmp = i
* i = veb.min_val # <<<<<<<<<<<<<<
@@ -20171,7 +20191,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
*/
__pyx_v_i = __pyx_v_veb->min_val;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":217
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":217
* tmp = i
* i = veb.min_val
* veb.min_val = tmp # <<<<<<<<<<<<<<
@@ -20183,7 +20203,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":218
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":218
* i = veb.min_val
* veb.min_val = tmp
* a = i >> veb.num_bottom_bits # <<<<<<<<<<<<<<
@@ -20192,7 +20212,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
*/
__pyx_v_a = (__pyx_v_i >> __pyx_v_veb->num_bottom_bits);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":219
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":219
* veb.min_val = tmp
* a = i >> veb.num_bottom_bits
* b = i & LOWER_MASK[veb.num_bottom_bits-1] # <<<<<<<<<<<<<<
@@ -20201,7 +20221,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
*/
__pyx_v_b = (__pyx_v_i & (__pyx_v_3_sa_LOWER_MASK[(__pyx_v_veb->num_bottom_bits - 1)]));
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":220
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":220
* a = i >> veb.num_bottom_bits
* b = i & LOWER_MASK[veb.num_bottom_bits-1]
* if veb.bottom[a] == NULL: # <<<<<<<<<<<<<<
@@ -20211,7 +20231,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
__pyx_t_3 = ((__pyx_v_veb->bottom[__pyx_v_a]) == NULL);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":221
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":221
* b = i & LOWER_MASK[veb.num_bottom_bits-1]
* if veb.bottom[a] == NULL:
* if veb.top_universe_size > MIN_BOTTOM_SIZE: # <<<<<<<<<<<<<<
@@ -20221,7 +20241,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
__pyx_t_3 = (__pyx_v_veb->top_universe_size > __pyx_v_3_sa_MIN_BOTTOM_SIZE);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":222
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":222
* if veb.bottom[a] == NULL:
* if veb.top_universe_size > MIN_BOTTOM_SIZE:
* subv = <_VEB*> veb.top # <<<<<<<<<<<<<<
@@ -20230,7 +20250,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
*/
__pyx_v_subv = ((struct __pyx_t_3_sa__VEB *)__pyx_v_veb->top);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":223
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":223
* if veb.top_universe_size > MIN_BOTTOM_SIZE:
* subv = <_VEB*> veb.top
* VEB_insert(subv, a) # <<<<<<<<<<<<<<
@@ -20242,7 +20262,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":225
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":225
* VEB_insert(subv, a)
* else:
* subb = <_BitSet*> veb.top # <<<<<<<<<<<<<<
@@ -20251,7 +20271,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
*/
__pyx_v_subb = ((struct __pyx_t_3_sa__BitSet *)__pyx_v_veb->top);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":226
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":226
* else:
* subb = <_BitSet*> veb.top
* bitset_insert(subb, a) # <<<<<<<<<<<<<<
@@ -20262,7 +20282,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
}
__pyx_L6:;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":227
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":227
* subb = <_BitSet*> veb.top
* bitset_insert(subb, a)
* if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<<
@@ -20272,7 +20292,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
__pyx_t_3 = (__pyx_v_veb->num_bottom_bits > __pyx_v_3_sa_MIN_BOTTOM_BITS);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":228
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":228
* bitset_insert(subb, a)
* if veb.num_bottom_bits > MIN_BOTTOM_BITS:
* veb.bottom[a] = new_VEB(1 << veb.num_bottom_bits) # <<<<<<<<<<<<<<
@@ -20284,7 +20304,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":230
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":230
* veb.bottom[a] = new_VEB(1 << veb.num_bottom_bits)
* else:
* veb.bottom[a] = new_BitSet() # <<<<<<<<<<<<<<
@@ -20298,7 +20318,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":231
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":231
* else:
* veb.bottom[a] = new_BitSet()
* if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<<
@@ -20308,7 +20328,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
__pyx_t_3 = (__pyx_v_veb->num_bottom_bits > __pyx_v_3_sa_MIN_BOTTOM_BITS);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":232
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":232
* veb.bottom[a] = new_BitSet()
* if veb.num_bottom_bits > MIN_BOTTOM_BITS:
* subv = <_VEB*> veb.bottom[a] # <<<<<<<<<<<<<<
@@ -20317,7 +20337,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
*/
__pyx_v_subv = ((struct __pyx_t_3_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_a]));
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":233
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":233
* if veb.num_bottom_bits > MIN_BOTTOM_BITS:
* subv = <_VEB*> veb.bottom[a]
* if VEB_insert(subv, b) == 0: # <<<<<<<<<<<<<<
@@ -20327,7 +20347,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
__pyx_t_3 = (__pyx_f_3_sa_VEB_insert(__pyx_v_subv, __pyx_v_b) == 0);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":234
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":234
* subv = <_VEB*> veb.bottom[a]
* if VEB_insert(subv, b) == 0:
* return 0 # <<<<<<<<<<<<<<
@@ -20343,7 +20363,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":236
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":236
* return 0
* else:
* subb = <_BitSet*> veb.bottom[a] # <<<<<<<<<<<<<<
@@ -20352,7 +20372,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
*/
__pyx_v_subb = ((struct __pyx_t_3_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_a]));
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":237
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":237
* else:
* subb = <_BitSet*> veb.bottom[a]
* if bitset_insert(subb, b) == 0: # <<<<<<<<<<<<<<
@@ -20362,7 +20382,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
__pyx_t_3 = (__pyx_f_3_sa_bitset_insert(__pyx_v_subb, __pyx_v_b) == 0);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":238
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":238
* subb = <_BitSet*> veb.bottom[a]
* if bitset_insert(subb, b) == 0:
* return 0 # <<<<<<<<<<<<<<
@@ -20377,7 +20397,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
}
__pyx_L8:;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":240
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":240
* return 0
*
* if i > veb.max_val: # <<<<<<<<<<<<<<
@@ -20387,7 +20407,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
__pyx_t_3 = (__pyx_v_i > __pyx_v_veb->max_val);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":241
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":241
*
* if i > veb.max_val:
* veb.max_val = i # <<<<<<<<<<<<<<
@@ -20401,7 +20421,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":242
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":242
* if i > veb.max_val:
* veb.max_val = i
* veb.size = veb.size + 1 # <<<<<<<<<<<<<<
@@ -20410,7 +20430,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
*/
__pyx_v_veb->size = (__pyx_v_veb->size + 1);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":243
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":243
* veb.max_val = i
* veb.size = veb.size + 1
* return 1 # <<<<<<<<<<<<<<
@@ -20426,7 +20446,7 @@ static int __pyx_f_3_sa_VEB_insert(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int __
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":246
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":246
*
*
* cdef del_VEB(_VEB* veb): # <<<<<<<<<<<<<<
@@ -20445,7 +20465,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) {
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("del_VEB", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":249
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":249
* cdef int i
*
* if veb.top_universe_size > MIN_BOTTOM_SIZE: # <<<<<<<<<<<<<<
@@ -20455,7 +20475,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) {
__pyx_t_1 = (__pyx_v_veb->top_universe_size > __pyx_v_3_sa_MIN_BOTTOM_SIZE);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":250
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":250
*
* if veb.top_universe_size > MIN_BOTTOM_SIZE:
* i = (<_VEB*> veb.top).min_val # <<<<<<<<<<<<<<
@@ -20467,7 +20487,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) {
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":252
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":252
* i = (<_VEB*> veb.top).min_val
* else:
* i = (<_BitSet*> veb.top).min_val # <<<<<<<<<<<<<<
@@ -20478,7 +20498,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) {
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":254
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":254
* i = (<_BitSet*> veb.top).min_val
*
* while i != -1: # <<<<<<<<<<<<<<
@@ -20489,7 +20509,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) {
__pyx_t_1 = (__pyx_v_i != -1);
if (!__pyx_t_1) break;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":255
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":255
*
* while i != -1:
* if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<<
@@ -20499,7 +20519,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) {
__pyx_t_1 = (__pyx_v_veb->num_bottom_bits > __pyx_v_3_sa_MIN_BOTTOM_BITS);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":256
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":256
* while i != -1:
* if veb.num_bottom_bits > MIN_BOTTOM_BITS:
* del_VEB(<_VEB*> veb.bottom[i]) # <<<<<<<<<<<<<<
@@ -20513,7 +20533,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) {
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":258
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":258
* del_VEB(<_VEB*> veb.bottom[i])
* else:
* free(<_BitSet*> veb.bottom[i]) # <<<<<<<<<<<<<<
@@ -20524,7 +20544,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) {
}
__pyx_L6:;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":260
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":260
* free(<_BitSet*> veb.bottom[i])
*
* if veb.top_universe_size > MIN_BOTTOM_SIZE: # <<<<<<<<<<<<<<
@@ -20534,7 +20554,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) {
__pyx_t_1 = (__pyx_v_veb->top_universe_size > __pyx_v_3_sa_MIN_BOTTOM_SIZE);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":261
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":261
*
* if veb.top_universe_size > MIN_BOTTOM_SIZE:
* i = VEB_findsucc(<_VEB*> veb.top, i) # <<<<<<<<<<<<<<
@@ -20546,7 +20566,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) {
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":263
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":263
* i = VEB_findsucc(<_VEB*> veb.top, i)
* else:
* i = bitset_findsucc(<_BitSet*> veb.top, i) # <<<<<<<<<<<<<<
@@ -20558,7 +20578,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) {
__pyx_L7:;
}
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":265
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":265
* i = bitset_findsucc(<_BitSet*> veb.top, i)
*
* if veb.top_universe_size > MIN_BOTTOM_SIZE: # <<<<<<<<<<<<<<
@@ -20568,7 +20588,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) {
__pyx_t_1 = (__pyx_v_veb->top_universe_size > __pyx_v_3_sa_MIN_BOTTOM_SIZE);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":266
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":266
*
* if veb.top_universe_size > MIN_BOTTOM_SIZE:
* del_VEB(<_VEB*> veb.top) # <<<<<<<<<<<<<<
@@ -20582,7 +20602,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) {
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":268
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":268
* del_VEB(<_VEB*> veb.top)
* else:
* free(<_BitSet*> veb.top) # <<<<<<<<<<<<<<
@@ -20593,7 +20613,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) {
}
__pyx_L8:;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":269
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":269
* else:
* free(<_BitSet*> veb.top)
* free(veb.bottom) # <<<<<<<<<<<<<<
@@ -20602,7 +20622,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) {
*/
free(__pyx_v_veb->bottom);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":270
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":270
* free(<_BitSet*> veb.top)
* free(veb.bottom)
* free(veb) # <<<<<<<<<<<<<<
@@ -20623,7 +20643,7 @@ static PyObject *__pyx_f_3_sa_del_VEB(struct __pyx_t_3_sa__VEB *__pyx_v_veb) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":273
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":273
*
*
* cdef int VEB_findsucc(_VEB* veb, int i): # <<<<<<<<<<<<<<
@@ -20646,7 +20666,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
int __pyx_t_3;
__Pyx_RefNannySetupContext("VEB_findsucc", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":278
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":278
* cdef int a, b, j, c, found
*
* if veb.max_val == -1 or i>=veb.max_val: # <<<<<<<<<<<<<<
@@ -20662,7 +20682,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
}
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":279
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":279
*
* if veb.max_val == -1 or i>=veb.max_val:
* return -1 # <<<<<<<<<<<<<<
@@ -20675,7 +20695,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":280
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":280
* if veb.max_val == -1 or i>=veb.max_val:
* return -1
* if i < veb.min_val: # <<<<<<<<<<<<<<
@@ -20685,7 +20705,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
__pyx_t_3 = (__pyx_v_i < __pyx_v_veb->min_val);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":281
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":281
* return -1
* if i < veb.min_val:
* return veb.min_val # <<<<<<<<<<<<<<
@@ -20698,7 +20718,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":283
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":283
* return veb.min_val
*
* a = i >> veb.num_bottom_bits # <<<<<<<<<<<<<<
@@ -20707,7 +20727,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
*/
__pyx_v_a = (__pyx_v_i >> __pyx_v_veb->num_bottom_bits);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":284
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":284
*
* a = i >> veb.num_bottom_bits
* b = i & LOWER_MASK[veb.num_bottom_bits-1] # <<<<<<<<<<<<<<
@@ -20716,7 +20736,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
*/
__pyx_v_b = (__pyx_v_i & (__pyx_v_3_sa_LOWER_MASK[(__pyx_v_veb->num_bottom_bits - 1)]));
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":285
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":285
* a = i >> veb.num_bottom_bits
* b = i & LOWER_MASK[veb.num_bottom_bits-1]
* found = 0 # <<<<<<<<<<<<<<
@@ -20725,7 +20745,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
*/
__pyx_v_found = 0;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":286
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":286
* b = i & LOWER_MASK[veb.num_bottom_bits-1]
* found = 0
* if veb.bottom[a] != NULL: # <<<<<<<<<<<<<<
@@ -20735,7 +20755,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
__pyx_t_3 = ((__pyx_v_veb->bottom[__pyx_v_a]) != NULL);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":287
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":287
* found = 0
* if veb.bottom[a] != NULL:
* if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<<
@@ -20745,7 +20765,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
__pyx_t_3 = (__pyx_v_veb->num_bottom_bits > __pyx_v_3_sa_MIN_BOTTOM_BITS);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":288
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":288
* if veb.bottom[a] != NULL:
* if veb.num_bottom_bits > MIN_BOTTOM_BITS:
* subv = <_VEB*> veb.bottom[a] # <<<<<<<<<<<<<<
@@ -20754,7 +20774,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
*/
__pyx_v_subv = ((struct __pyx_t_3_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_a]));
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":289
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":289
* if veb.num_bottom_bits > MIN_BOTTOM_BITS:
* subv = <_VEB*> veb.bottom[a]
* if subv.max_val > b: # <<<<<<<<<<<<<<
@@ -20764,7 +20784,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
__pyx_t_3 = (__pyx_v_subv->max_val > __pyx_v_b);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":290
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":290
* subv = <_VEB*> veb.bottom[a]
* if subv.max_val > b:
* j = (a << veb.num_bottom_bits) + VEB_findsucc(subv, b) # <<<<<<<<<<<<<<
@@ -20773,7 +20793,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
*/
__pyx_v_j = ((__pyx_v_a << __pyx_v_veb->num_bottom_bits) + __pyx_f_3_sa_VEB_findsucc(__pyx_v_subv, __pyx_v_b));
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":291
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":291
* if subv.max_val > b:
* j = (a << veb.num_bottom_bits) + VEB_findsucc(subv, b)
* found = 1 # <<<<<<<<<<<<<<
@@ -20788,7 +20808,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":293
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":293
* found = 1
* else:
* subb = <_BitSet*> veb.bottom[a] # <<<<<<<<<<<<<<
@@ -20797,7 +20817,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
*/
__pyx_v_subb = ((struct __pyx_t_3_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_a]));
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":294
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":294
* else:
* subb = <_BitSet*> veb.bottom[a]
* if subb.max_val > b: # <<<<<<<<<<<<<<
@@ -20807,7 +20827,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
__pyx_t_3 = (__pyx_v_subb->max_val > __pyx_v_b);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":295
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":295
* subb = <_BitSet*> veb.bottom[a]
* if subb.max_val > b:
* j = (a << veb.num_bottom_bits) + bitset_findsucc(subb, b) # <<<<<<<<<<<<<<
@@ -20816,7 +20836,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
*/
__pyx_v_j = ((__pyx_v_a << __pyx_v_veb->num_bottom_bits) + __pyx_f_3_sa_bitset_findsucc(__pyx_v_subb, __pyx_v_b));
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":296
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":296
* if subb.max_val > b:
* j = (a << veb.num_bottom_bits) + bitset_findsucc(subb, b)
* found = 1 # <<<<<<<<<<<<<<
@@ -20833,7 +20853,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":297
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":297
* j = (a << veb.num_bottom_bits) + bitset_findsucc(subb, b)
* found = 1
* if found==0: # <<<<<<<<<<<<<<
@@ -20843,7 +20863,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
__pyx_t_3 = (__pyx_v_found == 0);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":298
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":298
* found = 1
* if found==0:
* if veb.top_universe_size > MIN_BOTTOM_SIZE: # <<<<<<<<<<<<<<
@@ -20853,7 +20873,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
__pyx_t_3 = (__pyx_v_veb->top_universe_size > __pyx_v_3_sa_MIN_BOTTOM_SIZE);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":299
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":299
* if found==0:
* if veb.top_universe_size > MIN_BOTTOM_SIZE:
* subv = <_VEB*> veb.top # <<<<<<<<<<<<<<
@@ -20862,7 +20882,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
*/
__pyx_v_subv = ((struct __pyx_t_3_sa__VEB *)__pyx_v_veb->top);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":300
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":300
* if veb.top_universe_size > MIN_BOTTOM_SIZE:
* subv = <_VEB*> veb.top
* c = VEB_findsucc(subv, a) # <<<<<<<<<<<<<<
@@ -20874,7 +20894,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":302
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":302
* c = VEB_findsucc(subv, a)
* else:
* subb = <_BitSet*> veb.top # <<<<<<<<<<<<<<
@@ -20883,7 +20903,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
*/
__pyx_v_subb = ((struct __pyx_t_3_sa__BitSet *)__pyx_v_veb->top);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":303
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":303
* else:
* subb = <_BitSet*> veb.top
* c = bitset_findsucc(subb, a) # <<<<<<<<<<<<<<
@@ -20894,7 +20914,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
}
__pyx_L10:;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":304
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":304
* subb = <_BitSet*> veb.top
* c = bitset_findsucc(subb, a)
* if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<<
@@ -20904,7 +20924,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
__pyx_t_3 = (__pyx_v_veb->num_bottom_bits > __pyx_v_3_sa_MIN_BOTTOM_BITS);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":305
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":305
* c = bitset_findsucc(subb, a)
* if veb.num_bottom_bits > MIN_BOTTOM_BITS:
* subv = <_VEB*> veb.bottom[c] # <<<<<<<<<<<<<<
@@ -20913,7 +20933,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
*/
__pyx_v_subv = ((struct __pyx_t_3_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_c]));
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":306
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":306
* if veb.num_bottom_bits > MIN_BOTTOM_BITS:
* subv = <_VEB*> veb.bottom[c]
* j = (c << veb.num_bottom_bits) + subv.min_val # <<<<<<<<<<<<<<
@@ -20925,7 +20945,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":308
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":308
* j = (c << veb.num_bottom_bits) + subv.min_val
* else:
* subb = <_BitSet*> veb.bottom[c] # <<<<<<<<<<<<<<
@@ -20934,7 +20954,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
*/
__pyx_v_subb = ((struct __pyx_t_3_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_c]));
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":309
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":309
* else:
* subb = <_BitSet*> veb.bottom[c]
* j = (c << veb.num_bottom_bits) + subb.min_val # <<<<<<<<<<<<<<
@@ -20948,7 +20968,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
}
__pyx_L9:;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":310
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":310
* subb = <_BitSet*> veb.bottom[c]
* j = (c << veb.num_bottom_bits) + subb.min_val
* return j # <<<<<<<<<<<<<<
@@ -20964,7 +20984,7 @@ static int __pyx_f_3_sa_VEB_findsucc(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":313
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":313
*
*
* cdef int VEB_contains(_VEB* veb, int i): # <<<<<<<<<<<<<<
@@ -20985,7 +21005,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
int __pyx_t_4;
__Pyx_RefNannySetupContext("VEB_contains", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":318
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":318
* cdef int a, b
*
* if veb.size == 0 or i < veb.min_val or i > veb.max_val: # <<<<<<<<<<<<<<
@@ -21007,7 +21027,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
}
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":319
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":319
*
* if veb.size == 0 or i < veb.min_val or i > veb.max_val:
* return 0 # <<<<<<<<<<<<<<
@@ -21020,7 +21040,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":321
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":321
* return 0
*
* if veb.min_val == i: # <<<<<<<<<<<<<<
@@ -21030,7 +21050,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
__pyx_t_2 = (__pyx_v_veb->min_val == __pyx_v_i);
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":322
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":322
*
* if veb.min_val == i:
* return 1 # <<<<<<<<<<<<<<
@@ -21043,7 +21063,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":324
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":324
* return 1
* else:
* if veb.size == 1: # <<<<<<<<<<<<<<
@@ -21053,7 +21073,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
__pyx_t_2 = (__pyx_v_veb->size == 1);
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":325
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":325
* else:
* if veb.size == 1:
* return 0 # <<<<<<<<<<<<<<
@@ -21068,7 +21088,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":327
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":327
* return 0
*
* a = i >> veb.num_bottom_bits # <<<<<<<<<<<<<<
@@ -21077,7 +21097,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
*/
__pyx_v_a = (__pyx_v_i >> __pyx_v_veb->num_bottom_bits);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":328
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":328
*
* a = i >> veb.num_bottom_bits
* b = i & LOWER_MASK[veb.num_bottom_bits-1] # <<<<<<<<<<<<<<
@@ -21086,7 +21106,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
*/
__pyx_v_b = (__pyx_v_i & (__pyx_v_3_sa_LOWER_MASK[(__pyx_v_veb->num_bottom_bits - 1)]));
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":329
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":329
* a = i >> veb.num_bottom_bits
* b = i & LOWER_MASK[veb.num_bottom_bits-1]
* if veb.bottom[a] == NULL: # <<<<<<<<<<<<<<
@@ -21096,7 +21116,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
__pyx_t_2 = ((__pyx_v_veb->bottom[__pyx_v_a]) == NULL);
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":330
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":330
* b = i & LOWER_MASK[veb.num_bottom_bits-1]
* if veb.bottom[a] == NULL:
* return 0 # <<<<<<<<<<<<<<
@@ -21109,7 +21129,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":332
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":332
* return 0
* else:
* if veb.num_bottom_bits > MIN_BOTTOM_BITS: # <<<<<<<<<<<<<<
@@ -21119,7 +21139,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
__pyx_t_2 = (__pyx_v_veb->num_bottom_bits > __pyx_v_3_sa_MIN_BOTTOM_BITS);
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":333
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":333
* else:
* if veb.num_bottom_bits > MIN_BOTTOM_BITS:
* subv = <_VEB*> veb.bottom[a] # <<<<<<<<<<<<<<
@@ -21128,7 +21148,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
*/
__pyx_v_subv = ((struct __pyx_t_3_sa__VEB *)(__pyx_v_veb->bottom[__pyx_v_a]));
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":334
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":334
* if veb.num_bottom_bits > MIN_BOTTOM_BITS:
* subv = <_VEB*> veb.bottom[a]
* return VEB_contains(subv, b) # <<<<<<<<<<<<<<
@@ -21141,7 +21161,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":336
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":336
* return VEB_contains(subv, b)
* else:
* subb = <_BitSet*> veb.bottom[a] # <<<<<<<<<<<<<<
@@ -21150,7 +21170,7 @@ static int __pyx_f_3_sa_VEB_contains(struct __pyx_t_3_sa__VEB *__pyx_v_veb, int
*/
__pyx_v_subb = ((struct __pyx_t_3_sa__BitSet *)(__pyx_v_veb->bottom[__pyx_v_a]));
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":337
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":337
* else:
* subb = <_BitSet*> veb.bottom[a]
* return bitset_contains(subb, b) # <<<<<<<<<<<<<<
@@ -21181,7 +21201,7 @@ static PyObject *__pyx_pw_3_sa_11VEBIterator_1__next__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":344
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":344
* cdef int next_val
*
* def __next__(self): # <<<<<<<<<<<<<<
@@ -21200,7 +21220,7 @@ static PyObject *__pyx_pf_3_sa_11VEBIterator___next__(struct __pyx_obj_3_sa_VEBI
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__next__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":347
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":347
* cdef int ret_val
*
* if self.next_val == -1: # <<<<<<<<<<<<<<
@@ -21210,7 +21230,7 @@ static PyObject *__pyx_pf_3_sa_11VEBIterator___next__(struct __pyx_obj_3_sa_VEBI
__pyx_t_1 = (__pyx_v_self->next_val == -1);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":348
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":348
*
* if self.next_val == -1:
* raise StopIteration() # <<<<<<<<<<<<<<
@@ -21226,7 +21246,7 @@ static PyObject *__pyx_pf_3_sa_11VEBIterator___next__(struct __pyx_obj_3_sa_VEBI
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":349
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":349
* if self.next_val == -1:
* raise StopIteration()
* ret_val = self.next_val # <<<<<<<<<<<<<<
@@ -21235,7 +21255,7 @@ static PyObject *__pyx_pf_3_sa_11VEBIterator___next__(struct __pyx_obj_3_sa_VEBI
*/
__pyx_v_ret_val = __pyx_v_self->next_val;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":350
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":350
* raise StopIteration()
* ret_val = self.next_val
* self.next_val = VEB_findsucc(self.v, ret_val) # <<<<<<<<<<<<<<
@@ -21244,7 +21264,7 @@ static PyObject *__pyx_pf_3_sa_11VEBIterator___next__(struct __pyx_obj_3_sa_VEBI
*/
__pyx_v_self->next_val = __pyx_f_3_sa_VEB_findsucc(__pyx_v_self->v, __pyx_v_ret_val);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":351
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":351
* ret_val = self.next_val
* self.next_val = VEB_findsucc(self.v, ret_val)
* return ret_val # <<<<<<<<<<<<<<
@@ -21317,7 +21337,7 @@ static int __pyx_pw_3_sa_3VEB_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":360
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":360
* cdef int _first(self)
*
* def __cinit__(self, int size): # <<<<<<<<<<<<<<
@@ -21330,7 +21350,7 @@ static int __pyx_pf_3_sa_3VEB___cinit__(struct __pyx_obj_3_sa_VEB *__pyx_v_self,
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":361
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":361
*
* def __cinit__(self, int size):
* self.veb = new_VEB(size) # <<<<<<<<<<<<<<
@@ -21353,7 +21373,7 @@ static void __pyx_pw_3_sa_3VEB_3__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyFinishContext();
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":363
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":363
* self.veb = new_VEB(size)
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -21369,7 +21389,7 @@ static void __pyx_pf_3_sa_3VEB_2__dealloc__(struct __pyx_obj_3_sa_VEB *__pyx_v_s
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":364
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":364
*
* def __dealloc__(self):
* del_VEB(self.veb) # <<<<<<<<<<<<<<
@@ -21399,7 +21419,7 @@ static PyObject *__pyx_pw_3_sa_3VEB_5__iter__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":366
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":366
* del_VEB(self.veb)
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -21417,7 +21437,7 @@ static PyObject *__pyx_pf_3_sa_3VEB_4__iter__(struct __pyx_obj_3_sa_VEB *__pyx_v
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__iter__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":368
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":368
* def __iter__(self):
* cdef VEBIterator it
* it = VEBIterator() # <<<<<<<<<<<<<<
@@ -21429,7 +21449,7 @@ static PyObject *__pyx_pf_3_sa_3VEB_4__iter__(struct __pyx_obj_3_sa_VEB *__pyx_v
__pyx_v_it = ((struct __pyx_obj_3_sa_VEBIterator *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":369
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":369
* cdef VEBIterator it
* it = VEBIterator()
* it.v = self.veb # <<<<<<<<<<<<<<
@@ -21438,7 +21458,7 @@ static PyObject *__pyx_pf_3_sa_3VEB_4__iter__(struct __pyx_obj_3_sa_VEB *__pyx_v
*/
__pyx_v_it->v = __pyx_v_self->veb;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":370
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":370
* it = VEBIterator()
* it.v = self.veb
* it.next_val = self.veb.min_val # <<<<<<<<<<<<<<
@@ -21447,7 +21467,7 @@ static PyObject *__pyx_pf_3_sa_3VEB_4__iter__(struct __pyx_obj_3_sa_VEB *__pyx_v
*/
__pyx_v_it->next_val = __pyx_v_self->veb->min_val;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":371
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":371
* it.v = self.veb
* it.next_val = self.veb.min_val
* return it # <<<<<<<<<<<<<<
@@ -21483,7 +21503,7 @@ static PyObject *__pyx_pw_3_sa_3VEB_7insert(PyObject *__pyx_v_self, PyObject *__
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":373
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":373
* return it
*
* def insert(self, i): # <<<<<<<<<<<<<<
@@ -21501,7 +21521,7 @@ static PyObject *__pyx_pf_3_sa_3VEB_6insert(struct __pyx_obj_3_sa_VEB *__pyx_v_s
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("insert", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":374
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":374
*
* def insert(self, i):
* return VEB_insert(self.veb, i) # <<<<<<<<<<<<<<
@@ -21528,7 +21548,7 @@ static PyObject *__pyx_pf_3_sa_3VEB_6insert(struct __pyx_obj_3_sa_VEB *__pyx_v_s
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":376
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":376
* return VEB_insert(self.veb, i)
*
* cdef int _insert(self, int i): # <<<<<<<<<<<<<<
@@ -21541,7 +21561,7 @@ static int __pyx_f_3_sa_3VEB__insert(struct __pyx_obj_3_sa_VEB *__pyx_v_self, in
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_insert", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":377
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":377
*
* cdef int _insert(self, int i):
* return VEB_insert(self.veb, i) # <<<<<<<<<<<<<<
@@ -21568,7 +21588,7 @@ static PyObject *__pyx_pw_3_sa_3VEB_9findsucc(PyObject *__pyx_v_self, PyObject *
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":379
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":379
* return VEB_insert(self.veb, i)
*
* def findsucc(self, i): # <<<<<<<<<<<<<<
@@ -21586,7 +21606,7 @@ static PyObject *__pyx_pf_3_sa_3VEB_8findsucc(struct __pyx_obj_3_sa_VEB *__pyx_v
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("findsucc", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":380
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":380
*
* def findsucc(self, i):
* return VEB_findsucc(self.veb, i) # <<<<<<<<<<<<<<
@@ -21613,7 +21633,7 @@ static PyObject *__pyx_pf_3_sa_3VEB_8findsucc(struct __pyx_obj_3_sa_VEB *__pyx_v
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":382
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":382
* return VEB_findsucc(self.veb, i)
*
* cdef int _first(self): # <<<<<<<<<<<<<<
@@ -21626,7 +21646,7 @@ static int __pyx_f_3_sa_3VEB__first(struct __pyx_obj_3_sa_VEB *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_first", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":383
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":383
*
* cdef int _first(self):
* return self.veb.min_val # <<<<<<<<<<<<<<
@@ -21642,7 +21662,7 @@ static int __pyx_f_3_sa_3VEB__first(struct __pyx_obj_3_sa_VEB *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":385
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":385
* return self.veb.min_val
*
* cdef int _findsucc(self, int i): # <<<<<<<<<<<<<<
@@ -21655,7 +21675,7 @@ static int __pyx_f_3_sa_3VEB__findsucc(struct __pyx_obj_3_sa_VEB *__pyx_v_self,
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_findsucc", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":386
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":386
*
* cdef int _findsucc(self, int i):
* return VEB_findsucc(self.veb, i) # <<<<<<<<<<<<<<
@@ -21682,7 +21702,7 @@ static Py_ssize_t __pyx_pw_3_sa_3VEB_11__len__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":388
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":388
* return VEB_findsucc(self.veb, i)
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -21695,7 +21715,7 @@ static Py_ssize_t __pyx_pf_3_sa_3VEB_10__len__(struct __pyx_obj_3_sa_VEB *__pyx_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":389
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":389
*
* def __len__(self):
* return self.veb.size # <<<<<<<<<<<<<<
@@ -21722,7 +21742,7 @@ static int __pyx_pw_3_sa_3VEB_13__contains__(PyObject *__pyx_v_self, PyObject *_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/veb.pxi":391
+/* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":391
* return self.veb.size
*
* def __contains__(self, i): # <<<<<<<<<<<<<<
@@ -21738,7 +21758,7 @@ static int __pyx_pf_3_sa_3VEB_12__contains__(struct __pyx_obj_3_sa_VEB *__pyx_v_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__contains__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":392
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":392
*
* def __contains__(self, i):
* return VEB_contains(self.veb, i) # <<<<<<<<<<<<<<
@@ -21809,7 +21829,7 @@ static int __pyx_pw_3_sa_3LCP_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":9
+/* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":9
* cdef IntList lcp
*
* def __cinit__(self, SuffixArray sa): # <<<<<<<<<<<<<<
@@ -21838,7 +21858,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self,
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":13
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":13
* cdef IntList rank
*
* logger.info("Constructing LCP array") # <<<<<<<<<<<<<<
@@ -21855,7 +21875,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self,
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":14
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":14
*
* logger.info("Constructing LCP array")
* self.sa = sa # <<<<<<<<<<<<<<
@@ -21868,7 +21888,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self,
__Pyx_DECREF(((PyObject *)__pyx_v_self->sa));
__pyx_v_self->sa = __pyx_v_sa;
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":15
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":15
* logger.info("Constructing LCP array")
* self.sa = sa
* n = self.sa.sa.len # <<<<<<<<<<<<<<
@@ -21877,7 +21897,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self,
*/
__pyx_v_n = __pyx_v_self->sa->sa->len;
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":16
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":16
* self.sa = sa
* n = self.sa.sa.len
* self.lcp = IntList(initial_len=n) # <<<<<<<<<<<<<<
@@ -21899,7 +21919,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self,
__pyx_v_self->lcp = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":18
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":18
* self.lcp = IntList(initial_len=n)
*
* rank = IntList(initial_len=n) # <<<<<<<<<<<<<<
@@ -21918,7 +21938,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self,
__pyx_v_rank = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":19
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":19
*
* rank = IntList(initial_len=n)
* for i from 0 <= i < n: # <<<<<<<<<<<<<<
@@ -21928,7 +21948,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self,
__pyx_t_3 = __pyx_v_n;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":20
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":20
* rank = IntList(initial_len=n)
* for i from 0 <= i < n:
* rank.arr[sa.sa.arr[i]] = i # <<<<<<<<<<<<<<
@@ -21938,7 +21958,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self,
(__pyx_v_rank->arr[(__pyx_v_sa->sa->arr[__pyx_v_i])]) = __pyx_v_i;
}
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":22
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":22
* rank.arr[sa.sa.arr[i]] = i
*
* h = 0 # <<<<<<<<<<<<<<
@@ -21947,7 +21967,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self,
*/
__pyx_v_h = 0;
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":23
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":23
*
* h = 0
* for i from 0 <= i < n: # <<<<<<<<<<<<<<
@@ -21957,7 +21977,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self,
__pyx_t_3 = __pyx_v_n;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":24
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":24
* h = 0
* for i from 0 <= i < n:
* k = rank.arr[i] # <<<<<<<<<<<<<<
@@ -21966,7 +21986,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self,
*/
__pyx_v_k = (__pyx_v_rank->arr[__pyx_v_i]);
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":25
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":25
* for i from 0 <= i < n:
* k = rank.arr[i]
* if k == 0: # <<<<<<<<<<<<<<
@@ -21976,7 +21996,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self,
__pyx_t_4 = (__pyx_v_k == 0);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":26
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":26
* k = rank.arr[i]
* if k == 0:
* self.lcp.arr[k] = -1 # <<<<<<<<<<<<<<
@@ -21988,7 +22008,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self,
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":28
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":28
* self.lcp.arr[k] = -1
* else:
* j = sa.sa.arr[k-1] # <<<<<<<<<<<<<<
@@ -21997,7 +22017,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self,
*/
__pyx_v_j = (__pyx_v_sa->sa->arr[(__pyx_v_k - 1)]);
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":29
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":29
* else:
* j = sa.sa.arr[k-1]
* while i+h < n and j+h < n and sa.darray.data.arr[i+h] == sa.darray.data.arr[j+h]: # <<<<<<<<<<<<<<
@@ -22020,7 +22040,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self,
}
if (!__pyx_t_5) break;
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":30
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":30
* j = sa.sa.arr[k-1]
* while i+h < n and j+h < n and sa.darray.data.arr[i+h] == sa.darray.data.arr[j+h]:
* h = h+1 # <<<<<<<<<<<<<<
@@ -22030,7 +22050,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self,
__pyx_v_h = (__pyx_v_h + 1);
}
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":31
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":31
* while i+h < n and j+h < n and sa.darray.data.arr[i+h] == sa.darray.data.arr[j+h]:
* h = h+1
* self.lcp.arr[k] = h # <<<<<<<<<<<<<<
@@ -22041,7 +22061,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self,
}
__pyx_L7:;
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":32
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":32
* h = h+1
* self.lcp.arr[k] = h
* if h > 0: # <<<<<<<<<<<<<<
@@ -22051,7 +22071,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self,
__pyx_t_5 = (__pyx_v_h > 0);
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":33
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":33
* self.lcp.arr[k] = h
* if h > 0:
* h = h-1 # <<<<<<<<<<<<<<
@@ -22064,7 +22084,7 @@ static int __pyx_pf_3_sa_3LCP___cinit__(struct __pyx_obj_3_sa_LCP *__pyx_v_self,
__pyx_L10:;
}
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":34
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":34
* if h > 0:
* h = h-1
* logger.info("LCP array completed") # <<<<<<<<<<<<<<
@@ -22117,7 +22137,7 @@ static PyObject *__pyx_pw_3_sa_3LCP_3compute_stats(PyObject *__pyx_v_self, PyObj
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":36
+/* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":36
* logger.info("LCP array completed")
*
* def compute_stats(self, int max_n): # <<<<<<<<<<<<<<
@@ -22188,7 +22208,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":48
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":48
* cdef VEB veb
*
* N = self.sa.sa.len # <<<<<<<<<<<<<<
@@ -22197,7 +22217,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
*/
__pyx_cur_scope->__pyx_v_N = __pyx_cur_scope->__pyx_v_self->sa->sa->len;
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":50
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":50
* N = self.sa.sa.len
*
* ngram_starts = [] # <<<<<<<<<<<<<<
@@ -22210,7 +22230,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
__pyx_cur_scope->__pyx_v_ngram_starts = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":51
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":51
*
* ngram_starts = []
* for n from 0 <= n < max_n: # <<<<<<<<<<<<<<
@@ -22220,7 +22240,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
__pyx_t_2 = __pyx_cur_scope->__pyx_v_max_n;
for (__pyx_cur_scope->__pyx_v_n = 0; __pyx_cur_scope->__pyx_v_n < __pyx_t_2; __pyx_cur_scope->__pyx_v_n++) {
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":52
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":52
* ngram_starts = []
* for n from 0 <= n < max_n:
* ngram_starts.append(IntList(initial_len=N)) # <<<<<<<<<<<<<<
@@ -22240,7 +22260,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":54
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":54
* ngram_starts.append(IntList(initial_len=N))
*
* run_start = IntList(initial_len=max_n) # <<<<<<<<<<<<<<
@@ -22260,7 +22280,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
__pyx_cur_scope->__pyx_v_run_start = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":55
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":55
*
* run_start = IntList(initial_len=max_n)
* veb = VEB(N) # <<<<<<<<<<<<<<
@@ -22281,7 +22301,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
__pyx_cur_scope->__pyx_v_veb = ((struct __pyx_obj_3_sa_VEB *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":57
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":57
* veb = VEB(N)
*
* for i from 0 <= i < N: # <<<<<<<<<<<<<<
@@ -22291,7 +22311,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
__pyx_t_2 = __pyx_cur_scope->__pyx_v_N;
for (__pyx_cur_scope->__pyx_v_i = 0; __pyx_cur_scope->__pyx_v_i < __pyx_t_2; __pyx_cur_scope->__pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":58
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":58
*
* for i from 0 <= i < N:
* h = self.lcp.arr[i] # <<<<<<<<<<<<<<
@@ -22300,7 +22320,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
*/
__pyx_cur_scope->__pyx_v_h = (__pyx_cur_scope->__pyx_v_self->lcp->arr[__pyx_cur_scope->__pyx_v_i]);
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":59
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":59
* for i from 0 <= i < N:
* h = self.lcp.arr[i]
* if h < 0: # <<<<<<<<<<<<<<
@@ -22310,7 +22330,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
__pyx_t_5 = (__pyx_cur_scope->__pyx_v_h < 0);
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":60
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":60
* h = self.lcp.arr[i]
* if h < 0:
* h = 0 # <<<<<<<<<<<<<<
@@ -22322,7 +22342,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
}
__pyx_L8:;
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":61
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":61
* if h < 0:
* h = 0
* for n from h <= n < max_n: # <<<<<<<<<<<<<<
@@ -22332,7 +22352,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
__pyx_t_6 = __pyx_cur_scope->__pyx_v_max_n;
for (__pyx_cur_scope->__pyx_v_n = __pyx_cur_scope->__pyx_v_h; __pyx_cur_scope->__pyx_v_n < __pyx_t_6; __pyx_cur_scope->__pyx_v_n++) {
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":62
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":62
* h = 0
* for n from h <= n < max_n:
* rs = run_start.arr[n] # <<<<<<<<<<<<<<
@@ -22341,7 +22361,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
*/
__pyx_cur_scope->__pyx_v_rs = (__pyx_cur_scope->__pyx_v_run_start->arr[__pyx_cur_scope->__pyx_v_n]);
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":63
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":63
* for n from h <= n < max_n:
* rs = run_start.arr[n]
* run_start.arr[n] = i # <<<<<<<<<<<<<<
@@ -22350,7 +22370,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
*/
(__pyx_cur_scope->__pyx_v_run_start->arr[__pyx_cur_scope->__pyx_v_n]) = __pyx_cur_scope->__pyx_v_i;
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":64
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":64
* rs = run_start.arr[n]
* run_start.arr[n] = i
* freq = i - rs # <<<<<<<<<<<<<<
@@ -22359,7 +22379,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
*/
__pyx_cur_scope->__pyx_v_freq = (__pyx_cur_scope->__pyx_v_i - __pyx_cur_scope->__pyx_v_rs);
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":65
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":65
* run_start.arr[n] = i
* freq = i - rs
* if freq > 1000: # arbitrary, but see note below # <<<<<<<<<<<<<<
@@ -22369,7 +22389,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
__pyx_t_5 = (__pyx_cur_scope->__pyx_v_freq > 1000);
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":66
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":66
* freq = i - rs
* if freq > 1000: # arbitrary, but see note below
* veb._insert(freq) # <<<<<<<<<<<<<<
@@ -22378,7 +22398,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
*/
((struct __pyx_vtabstruct_3_sa_VEB *)__pyx_cur_scope->__pyx_v_veb->__pyx_vtab)->_insert(__pyx_cur_scope->__pyx_v_veb, __pyx_cur_scope->__pyx_v_freq);
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":67
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":67
* if freq > 1000: # arbitrary, but see note below
* veb._insert(freq)
* ngram_start = ngram_starts[n] # <<<<<<<<<<<<<<
@@ -22394,7 +22414,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
__pyx_cur_scope->__pyx_v_ngram_start = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":68
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":68
* veb._insert(freq)
* ngram_start = ngram_starts[n]
* while ngram_start.arr[freq] > 0: # <<<<<<<<<<<<<<
@@ -22405,7 +22425,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
__pyx_t_5 = ((__pyx_cur_scope->__pyx_v_ngram_start->arr[__pyx_cur_scope->__pyx_v_freq]) > 0);
if (!__pyx_t_5) break;
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":69
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":69
* ngram_start = ngram_starts[n]
* while ngram_start.arr[freq] > 0:
* freq = freq + 1 # cheating a bit, should be ok for sparse histogram # <<<<<<<<<<<<<<
@@ -22415,7 +22435,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
__pyx_cur_scope->__pyx_v_freq = (__pyx_cur_scope->__pyx_v_freq + 1);
}
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":70
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":70
* while ngram_start.arr[freq] > 0:
* freq = freq + 1 # cheating a bit, should be ok for sparse histogram
* ngram_start.arr[freq] = rs # <<<<<<<<<<<<<<
@@ -22429,7 +22449,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
}
}
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":71
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":71
* freq = freq + 1 # cheating a bit, should be ok for sparse histogram
* ngram_start.arr[freq] = rs
* i = veb.veb.min_val # <<<<<<<<<<<<<<
@@ -22438,7 +22458,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
*/
__pyx_cur_scope->__pyx_v_i = __pyx_cur_scope->__pyx_v_veb->veb->min_val;
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":72
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":72
* ngram_start.arr[freq] = rs
* i = veb.veb.min_val
* while i != -1: # <<<<<<<<<<<<<<
@@ -22449,7 +22469,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
__pyx_t_5 = (__pyx_cur_scope->__pyx_v_i != -1);
if (!__pyx_t_5) break;
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":73
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":73
* i = veb.veb.min_val
* while i != -1:
* ii = veb._findsucc(i) # <<<<<<<<<<<<<<
@@ -22458,7 +22478,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
*/
__pyx_cur_scope->__pyx_v_ii = ((struct __pyx_vtabstruct_3_sa_VEB *)__pyx_cur_scope->__pyx_v_veb->__pyx_vtab)->_findsucc(__pyx_cur_scope->__pyx_v_veb, __pyx_cur_scope->__pyx_v_i);
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":74
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":74
* while i != -1:
* ii = veb._findsucc(i)
* for n from 0 <= n < max_n: # <<<<<<<<<<<<<<
@@ -22468,7 +22488,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
__pyx_t_2 = __pyx_cur_scope->__pyx_v_max_n;
for (__pyx_cur_scope->__pyx_v_n = 0; __pyx_cur_scope->__pyx_v_n < __pyx_t_2; __pyx_cur_scope->__pyx_v_n++) {
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":75
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":75
* ii = veb._findsucc(i)
* for n from 0 <= n < max_n:
* ngram_start = ngram_starts[n] # <<<<<<<<<<<<<<
@@ -22484,7 +22504,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
__pyx_cur_scope->__pyx_v_ngram_start = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":76
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":76
* for n from 0 <= n < max_n:
* ngram_start = ngram_starts[n]
* iii = i # <<<<<<<<<<<<<<
@@ -22493,7 +22513,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
*/
__pyx_cur_scope->__pyx_v_iii = __pyx_cur_scope->__pyx_v_i;
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":77
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":77
* ngram_start = ngram_starts[n]
* iii = i
* rs = ngram_start.arr[iii] # <<<<<<<<<<<<<<
@@ -22502,7 +22522,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
*/
__pyx_cur_scope->__pyx_v_rs = (__pyx_cur_scope->__pyx_v_ngram_start->arr[__pyx_cur_scope->__pyx_v_iii]);
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":78
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":78
* iii = i
* rs = ngram_start.arr[iii]
* while (ii==-1 or iii < ii) and rs != 0: # <<<<<<<<<<<<<<
@@ -22525,7 +22545,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
}
if (!__pyx_t_7) break;
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":79
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":79
* rs = ngram_start.arr[iii]
* while (ii==-1 or iii < ii) and rs != 0:
* j = self.sa.sa.arr[rs] # <<<<<<<<<<<<<<
@@ -22534,7 +22554,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
*/
__pyx_cur_scope->__pyx_v_j = (__pyx_cur_scope->__pyx_v_self->sa->sa->arr[__pyx_cur_scope->__pyx_v_rs]);
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":80
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":80
* while (ii==-1 or iii < ii) and rs != 0:
* j = self.sa.sa.arr[rs]
* valid = 1 # <<<<<<<<<<<<<<
@@ -22543,7 +22563,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
*/
__pyx_cur_scope->__pyx_v_valid = 1;
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":81
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":81
* j = self.sa.sa.arr[rs]
* valid = 1
* for k from 0 <= k < n+1: # <<<<<<<<<<<<<<
@@ -22553,7 +22573,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
__pyx_t_9 = (__pyx_cur_scope->__pyx_v_n + 1);
for (__pyx_cur_scope->__pyx_v_k = 0; __pyx_cur_scope->__pyx_v_k < __pyx_t_9; __pyx_cur_scope->__pyx_v_k++) {
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":82
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":82
* valid = 1
* for k from 0 <= k < n+1:
* if self.sa.darray.data.arr[j+k] < 2: # <<<<<<<<<<<<<<
@@ -22563,7 +22583,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
__pyx_t_7 = ((__pyx_cur_scope->__pyx_v_self->sa->darray->data->arr[(__pyx_cur_scope->__pyx_v_j + __pyx_cur_scope->__pyx_v_k)]) < 2);
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":83
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":83
* for k from 0 <= k < n+1:
* if self.sa.darray.data.arr[j+k] < 2:
* valid = 0 # <<<<<<<<<<<<<<
@@ -22576,7 +22596,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
__pyx_L22:;
}
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":84
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":84
* if self.sa.darray.data.arr[j+k] < 2:
* valid = 0
* if valid: # <<<<<<<<<<<<<<
@@ -22585,7 +22605,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
*/
if (__pyx_cur_scope->__pyx_v_valid) {
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":85
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":85
* valid = 0
* if valid:
* ngram = tuple([self.sa.darray.data.arr[j+k] for k in range(n+1)]) # <<<<<<<<<<<<<<
@@ -22611,7 +22631,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
__pyx_cur_scope->__pyx_v_ngram = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":86
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":86
* if valid:
* ngram = tuple([self.sa.darray.data.arr[j+k] for k in range(n+1)])
* yield i, n+1, ngram # <<<<<<<<<<<<<<
@@ -22648,7 +22668,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
}
__pyx_L23:;
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":87
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":87
* ngram = tuple([self.sa.darray.data.arr[j+k] for k in range(n+1)])
* yield i, n+1, ngram
* iii = iii + 1 # <<<<<<<<<<<<<<
@@ -22657,7 +22677,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
*/
__pyx_cur_scope->__pyx_v_iii = (__pyx_cur_scope->__pyx_v_iii + 1);
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":88
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":88
* yield i, n+1, ngram
* iii = iii + 1
* rs = ngram_start.arr[iii] # <<<<<<<<<<<<<<
@@ -22667,7 +22687,7 @@ static PyObject *__pyx_gb_3_sa_3LCP_4generator1(__pyx_GeneratorObject *__pyx_gen
}
}
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":89
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":89
* iii = iii + 1
* rs = ngram_start.arr[iii]
* i = ii # <<<<<<<<<<<<<<
@@ -22703,7 +22723,7 @@ static int __pyx_pw_3_sa_8Alphabet_1__cinit__(PyObject *__pyx_v_self, PyObject *
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":12
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":12
* cdef dict id2sym
*
* def __cinit__(self): # <<<<<<<<<<<<<<
@@ -22720,7 +22740,7 @@ static int __pyx_pf_3_sa_8Alphabet___cinit__(struct __pyx_obj_3_sa_Alphabet *__p
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":13
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":13
*
* def __cinit__(self):
* self.terminals = StringMap() # <<<<<<<<<<<<<<
@@ -22735,7 +22755,7 @@ static int __pyx_pf_3_sa_8Alphabet___cinit__(struct __pyx_obj_3_sa_Alphabet *__p
__pyx_v_self->terminals = ((struct __pyx_obj_3_sa_StringMap *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":14
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":14
* def __cinit__(self):
* self.terminals = StringMap()
* self.nonterminals = StringMap() # <<<<<<<<<<<<<<
@@ -22750,7 +22770,7 @@ static int __pyx_pf_3_sa_8Alphabet___cinit__(struct __pyx_obj_3_sa_Alphabet *__p
__pyx_v_self->nonterminals = ((struct __pyx_obj_3_sa_StringMap *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":15
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":15
* self.terminals = StringMap()
* self.nonterminals = StringMap()
* self.id2sym = {} # <<<<<<<<<<<<<<
@@ -22765,7 +22785,7 @@ static int __pyx_pf_3_sa_8Alphabet___cinit__(struct __pyx_obj_3_sa_Alphabet *__p
__pyx_v_self->id2sym = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":16
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":16
* self.nonterminals = StringMap()
* self.id2sym = {}
* self.first_nonterminal = -1 # <<<<<<<<<<<<<<
@@ -22794,7 +22814,7 @@ static void __pyx_pw_3_sa_8Alphabet_3__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyFinishContext();
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":18
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":18
* self.first_nonterminal = -1
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -22809,7 +22829,7 @@ static void __pyx_pf_3_sa_8Alphabet_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_
__Pyx_RefNannyFinishContext();
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":21
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":21
* pass
*
* cdef int isvar(self, int sym): # <<<<<<<<<<<<<<
@@ -22822,7 +22842,7 @@ static int __pyx_f_3_sa_8Alphabet_isvar(CYTHON_UNUSED struct __pyx_obj_3_sa_Alph
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("isvar", 0);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":22
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":22
*
* cdef int isvar(self, int sym):
* return sym < 0 # <<<<<<<<<<<<<<
@@ -22838,7 +22858,7 @@ static int __pyx_f_3_sa_8Alphabet_isvar(CYTHON_UNUSED struct __pyx_obj_3_sa_Alph
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":24
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":24
* return sym < 0
*
* cdef int isword(self, int sym): # <<<<<<<<<<<<<<
@@ -22851,7 +22871,7 @@ static int __pyx_f_3_sa_8Alphabet_isword(CYTHON_UNUSED struct __pyx_obj_3_sa_Alp
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("isword", 0);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":25
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":25
*
* cdef int isword(self, int sym):
* return sym >= 0 # <<<<<<<<<<<<<<
@@ -22867,7 +22887,7 @@ static int __pyx_f_3_sa_8Alphabet_isword(CYTHON_UNUSED struct __pyx_obj_3_sa_Alp
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":27
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":27
* return sym >= 0
*
* cdef int getindex(self, int sym): # <<<<<<<<<<<<<<
@@ -22880,7 +22900,7 @@ static int __pyx_f_3_sa_8Alphabet_getindex(CYTHON_UNUSED struct __pyx_obj_3_sa_A
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("getindex", 0);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":28
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":28
*
* cdef int getindex(self, int sym):
* return -sym & INDEX_MASK # <<<<<<<<<<<<<<
@@ -22896,7 +22916,7 @@ static int __pyx_f_3_sa_8Alphabet_getindex(CYTHON_UNUSED struct __pyx_obj_3_sa_A
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":30
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":30
* return -sym & INDEX_MASK
*
* cdef int setindex(self, int sym, int ind): # <<<<<<<<<<<<<<
@@ -22909,7 +22929,7 @@ static int __pyx_f_3_sa_8Alphabet_setindex(CYTHON_UNUSED struct __pyx_obj_3_sa_A
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("setindex", 0);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":31
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":31
*
* cdef int setindex(self, int sym, int ind):
* return -(-sym & ~INDEX_MASK | ind) # <<<<<<<<<<<<<<
@@ -22925,7 +22945,7 @@ static int __pyx_f_3_sa_8Alphabet_setindex(CYTHON_UNUSED struct __pyx_obj_3_sa_A
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":33
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":33
* return -(-sym & ~INDEX_MASK | ind)
*
* cdef int clearindex(self, int sym): # <<<<<<<<<<<<<<
@@ -22938,7 +22958,7 @@ static int __pyx_f_3_sa_8Alphabet_clearindex(CYTHON_UNUSED struct __pyx_obj_3_sa
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("clearindex", 0);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":34
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":34
*
* cdef int clearindex(self, int sym):
* return -(-sym& ~INDEX_MASK) # <<<<<<<<<<<<<<
@@ -22954,7 +22974,7 @@ static int __pyx_f_3_sa_8Alphabet_clearindex(CYTHON_UNUSED struct __pyx_obj_3_sa
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":36
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":36
* return -(-sym& ~INDEX_MASK)
*
* cdef int match(self, int sym1, int sym2): # <<<<<<<<<<<<<<
@@ -22967,7 +22987,7 @@ static int __pyx_f_3_sa_8Alphabet_match(struct __pyx_obj_3_sa_Alphabet *__pyx_v_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("match", 0);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":37
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":37
*
* cdef int match(self, int sym1, int sym2):
* return self.clearindex(sym1) == self.clearindex(sym2); # <<<<<<<<<<<<<<
@@ -22983,7 +23003,7 @@ static int __pyx_f_3_sa_8Alphabet_match(struct __pyx_obj_3_sa_Alphabet *__pyx_v_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":39
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":39
* return self.clearindex(sym1) == self.clearindex(sym2);
*
* cdef char* tocat(self, int sym): # <<<<<<<<<<<<<<
@@ -22996,7 +23016,7 @@ static char *__pyx_f_3_sa_8Alphabet_tocat(struct __pyx_obj_3_sa_Alphabet *__pyx_
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("tocat", 0);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":40
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":40
*
* cdef char* tocat(self, int sym):
* return self.nonterminals.word((-sym >> INDEX_SHIFT)-1) # <<<<<<<<<<<<<<
@@ -23012,7 +23032,7 @@ static char *__pyx_f_3_sa_8Alphabet_tocat(struct __pyx_obj_3_sa_Alphabet *__pyx_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":42
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":42
* return self.nonterminals.word((-sym >> INDEX_SHIFT)-1)
*
* cdef int fromcat(self, char *s): # <<<<<<<<<<<<<<
@@ -23027,7 +23047,7 @@ static int __pyx_f_3_sa_8Alphabet_fromcat(struct __pyx_obj_3_sa_Alphabet *__pyx_
int __pyx_t_1;
__Pyx_RefNannySetupContext("fromcat", 0);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":44
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":44
* cdef int fromcat(self, char *s):
* cdef int i
* i = self.nonterminals.index(s) # <<<<<<<<<<<<<<
@@ -23036,7 +23056,7 @@ static int __pyx_f_3_sa_8Alphabet_fromcat(struct __pyx_obj_3_sa_Alphabet *__pyx_
*/
__pyx_v_i = ((struct __pyx_vtabstruct_3_sa_StringMap *)__pyx_v_self->nonterminals->__pyx_vtab)->index(__pyx_v_self->nonterminals, __pyx_v_s);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":45
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":45
* cdef int i
* i = self.nonterminals.index(s)
* if self.first_nonterminal == -1: # <<<<<<<<<<<<<<
@@ -23046,7 +23066,7 @@ static int __pyx_f_3_sa_8Alphabet_fromcat(struct __pyx_obj_3_sa_Alphabet *__pyx_
__pyx_t_1 = (__pyx_v_self->first_nonterminal == -1);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":46
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":46
* i = self.nonterminals.index(s)
* if self.first_nonterminal == -1:
* self.first_nonterminal = i # <<<<<<<<<<<<<<
@@ -23058,7 +23078,7 @@ static int __pyx_f_3_sa_8Alphabet_fromcat(struct __pyx_obj_3_sa_Alphabet *__pyx_
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":47
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":47
* if self.first_nonterminal == -1:
* self.first_nonterminal = i
* if i > self.last_nonterminal: # <<<<<<<<<<<<<<
@@ -23068,7 +23088,7 @@ static int __pyx_f_3_sa_8Alphabet_fromcat(struct __pyx_obj_3_sa_Alphabet *__pyx_
__pyx_t_1 = (__pyx_v_i > __pyx_v_self->last_nonterminal);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":48
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":48
* self.first_nonterminal = i
* if i > self.last_nonterminal:
* self.last_nonterminal = i # <<<<<<<<<<<<<<
@@ -23080,7 +23100,7 @@ static int __pyx_f_3_sa_8Alphabet_fromcat(struct __pyx_obj_3_sa_Alphabet *__pyx_
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":49
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":49
* if i > self.last_nonterminal:
* self.last_nonterminal = i
* return -(i+1 << INDEX_SHIFT) # <<<<<<<<<<<<<<
@@ -23096,7 +23116,7 @@ static int __pyx_f_3_sa_8Alphabet_fromcat(struct __pyx_obj_3_sa_Alphabet *__pyx_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":51
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":51
* return -(i+1 << INDEX_SHIFT)
*
* cdef char* tostring(self, int sym): # <<<<<<<<<<<<<<
@@ -23119,7 +23139,7 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("tostring", 0);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":53
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":53
* cdef char* tostring(self, int sym):
* cdef int ind
* if self.isvar(sym): # <<<<<<<<<<<<<<
@@ -23129,7 +23149,7 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p
__pyx_t_1 = ((struct __pyx_vtabstruct_3_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->isvar(__pyx_v_self, __pyx_v_sym);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":54
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":54
* cdef int ind
* if self.isvar(sym):
* if sym in self.id2sym: # <<<<<<<<<<<<<<
@@ -23146,7 +23166,7 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":55
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":55
* if self.isvar(sym):
* if sym in self.id2sym:
* return self.id2sym[sym] # <<<<<<<<<<<<<<
@@ -23167,7 +23187,7 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":56
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":56
* if sym in self.id2sym:
* return self.id2sym[sym]
* ind = self.getindex(sym) # <<<<<<<<<<<<<<
@@ -23176,7 +23196,7 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p
*/
__pyx_v_ind = ((struct __pyx_vtabstruct_3_sa_Alphabet *)__pyx_v_self->__pyx_vtab)->getindex(__pyx_v_self, __pyx_v_sym);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":57
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":57
* return self.id2sym[sym]
* ind = self.getindex(sym)
* if ind > 0: # <<<<<<<<<<<<<<
@@ -23186,7 +23206,7 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p
__pyx_t_3 = (__pyx_v_ind > 0);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":58
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":58
* ind = self.getindex(sym)
* if ind > 0:
* self.id2sym[sym] = "[%s,%d]" % (self.tocat(sym), ind) # <<<<<<<<<<<<<<
@@ -23218,7 +23238,7 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":60
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":60
* self.id2sym[sym] = "[%s,%d]" % (self.tocat(sym), ind)
* else:
* self.id2sym[sym] = "[%s]" % self.tocat(sym) # <<<<<<<<<<<<<<
@@ -23239,7 +23259,7 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":61
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":61
* else:
* self.id2sym[sym] = "[%s]" % self.tocat(sym)
* return self.id2sym[sym] # <<<<<<<<<<<<<<
@@ -23260,7 +23280,7 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":63
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":63
* return self.id2sym[sym]
* else:
* return self.terminals.word(sym) # <<<<<<<<<<<<<<
@@ -23285,7 +23305,7 @@ static char *__pyx_f_3_sa_8Alphabet_tostring(struct __pyx_obj_3_sa_Alphabet *__p
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":65
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":65
* return self.terminals.word(sym)
*
* cdef int fromstring(self, char *s, bint terminal): # <<<<<<<<<<<<<<
@@ -23313,7 +23333,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("fromstring", 0);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":69
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":69
* cdef char *comma
* cdef int n
* n = strlen(s) # <<<<<<<<<<<<<<
@@ -23322,7 +23342,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p
*/
__pyx_v_n = strlen(__pyx_v_s);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":71
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":71
* n = strlen(s)
* cdef char *sep
* sep = strstr(s,"_SEP_") # <<<<<<<<<<<<<<
@@ -23331,7 +23351,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p
*/
__pyx_v_sep = strstr(__pyx_v_s, __pyx_k___SEP_);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":72
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":72
* cdef char *sep
* sep = strstr(s,"_SEP_")
* if n >= 3 and s[0] == c'[' and s[n-1] == c']' and sep == NULL: # <<<<<<<<<<<<<<
@@ -23359,7 +23379,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p
}
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":73
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":73
* sep = strstr(s,"_SEP_")
* if n >= 3 and s[0] == c'[' and s[n-1] == c']' and sep == NULL:
* if terminal: # <<<<<<<<<<<<<<
@@ -23368,7 +23388,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p
*/
if (__pyx_v_terminal) {
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":74
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":74
* if n >= 3 and s[0] == c'[' and s[n-1] == c']' and sep == NULL:
* if terminal:
* s1 = "\\"+s # <<<<<<<<<<<<<<
@@ -23383,7 +23403,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p
__pyx_v_s1 = __pyx_t_7;
__pyx_t_7 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":75
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":75
* if terminal:
* s1 = "\\"+s
* return self.terminals.index(s1) # <<<<<<<<<<<<<<
@@ -23397,7 +23417,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":76
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":76
* s1 = "\\"+s
* return self.terminals.index(s1)
* s[n-1] = c'\0' # <<<<<<<<<<<<<<
@@ -23406,7 +23426,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p
*/
(__pyx_v_s[(__pyx_v_n - 1)]) = '\x00';
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":77
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":77
* return self.terminals.index(s1)
* s[n-1] = c'\0'
* s = s + 1 # <<<<<<<<<<<<<<
@@ -23415,7 +23435,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p
*/
__pyx_v_s = (__pyx_v_s + 1);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":78
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":78
* s[n-1] = c'\0'
* s = s + 1
* comma = strrchr(s, c',') # <<<<<<<<<<<<<<
@@ -23424,7 +23444,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p
*/
__pyx_v_comma = strrchr(__pyx_v_s, ',');
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":79
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":79
* s = s + 1
* comma = strrchr(s, c',')
* if comma != NULL: # <<<<<<<<<<<<<<
@@ -23434,7 +23454,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p
__pyx_t_2 = (__pyx_v_comma != NULL);
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":80
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":80
* comma = strrchr(s, c',')
* if comma != NULL:
* comma[0] = c'\0' # <<<<<<<<<<<<<<
@@ -23443,7 +23463,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p
*/
(__pyx_v_comma[0]) = '\x00';
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":81
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":81
* if comma != NULL:
* comma[0] = c'\0'
* return self.setindex(self.fromcat(s), strtol(comma+1, NULL, 10)) # <<<<<<<<<<<<<<
@@ -23456,7 +23476,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":83
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":83
* return self.setindex(self.fromcat(s), strtol(comma+1, NULL, 10))
* else:
* return self.fromcat(s) # <<<<<<<<<<<<<<
@@ -23471,7 +23491,7 @@ static int __pyx_f_3_sa_8Alphabet_fromstring(struct __pyx_obj_3_sa_Alphabet *__p
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":85
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":85
* return self.fromcat(s)
* else:
* return self.terminals.index(s) # <<<<<<<<<<<<<<
@@ -23507,7 +23527,7 @@ static PyObject *__pyx_pw_3_sa_8Alphabet_9terminals_1__get__(PyObject *__pyx_v_s
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":8
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":8
*
* cdef class Alphabet:
* cdef readonly StringMap terminals, nonterminals # <<<<<<<<<<<<<<
@@ -23558,7 +23578,7 @@ static PyObject *__pyx_pf_3_sa_8Alphabet_12nonterminals___get__(struct __pyx_obj
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":89
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":89
* cdef Alphabet ALPHABET = Alphabet()
*
* cdef char* sym_tostring(int sym): # <<<<<<<<<<<<<<
@@ -23571,7 +23591,7 @@ static char *__pyx_f_3_sa_sym_tostring(int __pyx_v_sym) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sym_tostring", 0);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":90
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":90
*
* cdef char* sym_tostring(int sym):
* return ALPHABET.tostring(sym) # <<<<<<<<<<<<<<
@@ -23587,7 +23607,7 @@ static char *__pyx_f_3_sa_sym_tostring(int __pyx_v_sym) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":92
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":92
* return ALPHABET.tostring(sym)
*
* cdef char* sym_tocat(int sym): # <<<<<<<<<<<<<<
@@ -23600,7 +23620,7 @@ static char *__pyx_f_3_sa_sym_tocat(int __pyx_v_sym) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sym_tocat", 0);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":93
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":93
*
* cdef char* sym_tocat(int sym):
* return ALPHABET.tocat(sym) # <<<<<<<<<<<<<<
@@ -23616,7 +23636,7 @@ static char *__pyx_f_3_sa_sym_tocat(int __pyx_v_sym) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":95
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":95
* return ALPHABET.tocat(sym)
*
* cdef int sym_isvar(int sym): # <<<<<<<<<<<<<<
@@ -23629,7 +23649,7 @@ static int __pyx_f_3_sa_sym_isvar(int __pyx_v_sym) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sym_isvar", 0);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":96
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":96
*
* cdef int sym_isvar(int sym):
* return ALPHABET.isvar(sym) # <<<<<<<<<<<<<<
@@ -23645,7 +23665,7 @@ static int __pyx_f_3_sa_sym_isvar(int __pyx_v_sym) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":98
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":98
* return ALPHABET.isvar(sym)
*
* cdef int sym_getindex(int sym): # <<<<<<<<<<<<<<
@@ -23658,7 +23678,7 @@ static int __pyx_f_3_sa_sym_getindex(int __pyx_v_sym) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sym_getindex", 0);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":99
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":99
*
* cdef int sym_getindex(int sym):
* return ALPHABET.getindex(sym) # <<<<<<<<<<<<<<
@@ -23674,7 +23694,7 @@ static int __pyx_f_3_sa_sym_getindex(int __pyx_v_sym) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":101
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":101
* return ALPHABET.getindex(sym)
*
* cdef int sym_setindex(int sym, int id): # <<<<<<<<<<<<<<
@@ -23687,7 +23707,7 @@ static int __pyx_f_3_sa_sym_setindex(int __pyx_v_sym, int __pyx_v_id) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sym_setindex", 0);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":102
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":102
*
* cdef int sym_setindex(int sym, int id):
* return ALPHABET.setindex(sym, id) # <<<<<<<<<<<<<<
@@ -23703,7 +23723,7 @@ static int __pyx_f_3_sa_sym_setindex(int __pyx_v_sym, int __pyx_v_id) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":104
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":104
* return ALPHABET.setindex(sym, id)
*
* cdef int sym_fromstring(char* string, bint terminal): # <<<<<<<<<<<<<<
@@ -23716,7 +23736,7 @@ static int __pyx_f_3_sa_sym_fromstring(char *__pyx_v_string, int __pyx_v_termina
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sym_fromstring", 0);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":105
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":105
*
* cdef int sym_fromstring(char* string, bint terminal):
* return ALPHABET.fromstring(string, terminal) # <<<<<<<<<<<<<<
@@ -23733,18 +23753,18 @@ static int __pyx_f_3_sa_sym_fromstring(char *__pyx_v_string, int __pyx_v_termina
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_3isvar(PyObject *__pyx_self, PyObject *__pyx_v_sym); /*proto*/
-static PyMethodDef __pyx_mdef_3_sa_3isvar = {__Pyx_NAMESTR("isvar"), (PyCFunction)__pyx_pw_3_sa_3isvar, METH_O, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_3_sa_3isvar(PyObject *__pyx_self, PyObject *__pyx_v_sym) {
+static PyObject *__pyx_pw_3_sa_5isvar(PyObject *__pyx_self, PyObject *__pyx_v_sym); /*proto*/
+static PyMethodDef __pyx_mdef_3_sa_5isvar = {__Pyx_NAMESTR("isvar"), (PyCFunction)__pyx_pw_3_sa_5isvar, METH_O, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pw_3_sa_5isvar(PyObject *__pyx_self, PyObject *__pyx_v_sym) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("isvar (wrapper)", 0);
- __pyx_r = __pyx_pf_3_sa_2isvar(__pyx_self, ((PyObject *)__pyx_v_sym));
+ __pyx_r = __pyx_pf_3_sa_4isvar(__pyx_self, ((PyObject *)__pyx_v_sym));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":107
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":107
* return ALPHABET.fromstring(string, terminal)
*
* def isvar(sym): # <<<<<<<<<<<<<<
@@ -23752,7 +23772,7 @@ static PyObject *__pyx_pw_3_sa_3isvar(PyObject *__pyx_self, PyObject *__pyx_v_sy
*
*/
-static PyObject *__pyx_pf_3_sa_2isvar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sym) {
+static PyObject *__pyx_pf_3_sa_4isvar(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sym) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
@@ -23762,7 +23782,7 @@ static PyObject *__pyx_pf_3_sa_2isvar(CYTHON_UNUSED PyObject *__pyx_self, PyObje
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("isvar", 0);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":108
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":108
*
* def isvar(sym):
* return sym_isvar(sym) # <<<<<<<<<<<<<<
@@ -23790,19 +23810,19 @@ static PyObject *__pyx_pf_3_sa_2isvar(CYTHON_UNUSED PyObject *__pyx_self, PyObje
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_5make_lattice(PyObject *__pyx_self, PyObject *__pyx_v_words); /*proto*/
-static PyMethodDef __pyx_mdef_3_sa_5make_lattice = {__Pyx_NAMESTR("make_lattice"), (PyCFunction)__pyx_pw_3_sa_5make_lattice, METH_O, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_3_sa_5make_lattice(PyObject *__pyx_self, PyObject *__pyx_v_words) {
+static PyObject *__pyx_pw_3_sa_7make_lattice(PyObject *__pyx_self, PyObject *__pyx_v_words); /*proto*/
+static PyMethodDef __pyx_mdef_3_sa_7make_lattice = {__Pyx_NAMESTR("make_lattice"), (PyCFunction)__pyx_pw_3_sa_7make_lattice, METH_O, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pw_3_sa_7make_lattice(PyObject *__pyx_self, PyObject *__pyx_v_words) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("make_lattice (wrapper)", 0);
- __pyx_r = __pyx_pf_3_sa_4make_lattice(__pyx_self, ((PyObject *)__pyx_v_words));
+ __pyx_r = __pyx_pf_3_sa_6make_lattice(__pyx_self, ((PyObject *)__pyx_v_words));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_gb_3_sa_12make_lattice_2generator7(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":111
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":111
*
* def make_lattice(words):
* word_ids = (sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<<
@@ -23944,7 +23964,7 @@ static PyObject *__pyx_gb_3_sa_12make_lattice_2generator7(__pyx_GeneratorObject
}
static PyObject *__pyx_gb_3_sa_12make_lattice_5generator8(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":112
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":112
* def make_lattice(words):
* word_ids = (sym_fromstring(word, True) for word in words)
* return tuple(((word, None, 1), ) for word in word_ids) # <<<<<<<<<<<<<<
@@ -24099,7 +24119,7 @@ static PyObject *__pyx_gb_3_sa_12make_lattice_5generator8(__pyx_GeneratorObject
return NULL;
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":110
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":110
* return sym_isvar(sym)
*
* def make_lattice(words): # <<<<<<<<<<<<<<
@@ -24107,7 +24127,7 @@ static PyObject *__pyx_gb_3_sa_12make_lattice_5generator8(__pyx_GeneratorObject
* return tuple(((word, None, 1), ) for word in word_ids)
*/
-static PyObject *__pyx_pf_3_sa_4make_lattice(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_words) {
+static PyObject *__pyx_pf_3_sa_6make_lattice(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_words) {
struct __pyx_obj_3_sa___pyx_scope_struct_4_make_lattice *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -24127,7 +24147,7 @@ static PyObject *__pyx_pf_3_sa_4make_lattice(CYTHON_UNUSED PyObject *__pyx_self,
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_words);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_words);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":111
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":111
*
* def make_lattice(words):
* word_ids = (sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<<
@@ -24140,7 +24160,7 @@ static PyObject *__pyx_pf_3_sa_4make_lattice(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_cur_scope->__pyx_v_word_ids = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":112
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":112
* def make_lattice(words):
* word_ids = (sym_fromstring(word, True) for word in words)
* return tuple(((word, None, 1), ) for word in word_ids) # <<<<<<<<<<<<<<
@@ -24177,19 +24197,19 @@ static PyObject *__pyx_pf_3_sa_4make_lattice(CYTHON_UNUSED PyObject *__pyx_self,
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_7decode_lattice(PyObject *__pyx_self, PyObject *__pyx_v_lattice); /*proto*/
-static PyMethodDef __pyx_mdef_3_sa_7decode_lattice = {__Pyx_NAMESTR("decode_lattice"), (PyCFunction)__pyx_pw_3_sa_7decode_lattice, METH_O, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_3_sa_7decode_lattice(PyObject *__pyx_self, PyObject *__pyx_v_lattice) {
+static PyObject *__pyx_pw_3_sa_9decode_lattice(PyObject *__pyx_self, PyObject *__pyx_v_lattice); /*proto*/
+static PyMethodDef __pyx_mdef_3_sa_9decode_lattice = {__Pyx_NAMESTR("decode_lattice"), (PyCFunction)__pyx_pw_3_sa_9decode_lattice, METH_O, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pw_3_sa_9decode_lattice(PyObject *__pyx_self, PyObject *__pyx_v_lattice) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("decode_lattice (wrapper)", 0);
- __pyx_r = __pyx_pf_3_sa_6decode_lattice(__pyx_self, ((PyObject *)__pyx_v_lattice));
+ __pyx_r = __pyx_pf_3_sa_8decode_lattice(__pyx_self, ((PyObject *)__pyx_v_lattice));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":115
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":115
*
* def decode_lattice(lattice):
* return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<<
@@ -24263,7 +24283,7 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":116
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":116
* def decode_lattice(lattice):
* return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc
* for arc in node for node in lattice) # <<<<<<<<<<<<<<
@@ -24281,7 +24301,7 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec
}
for (;;) {
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":115
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":115
*
* def decode_lattice(lattice):
* return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<<
@@ -24384,7 +24404,7 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec
__pyx_cur_scope->__pyx_v_dist = __pyx_t_7;
__pyx_t_7 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":116
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":116
* def decode_lattice(lattice):
* return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc
* for arc in node for node in lattice) # <<<<<<<<<<<<<<
@@ -24472,7 +24492,7 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec
__pyx_cur_scope->__pyx_v_node = __pyx_t_6;
__pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":115
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":115
*
* def decode_lattice(lattice):
* return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<<
@@ -24553,7 +24573,7 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec
return NULL;
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":114
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":114
* return tuple(((word, None, 1), ) for word in word_ids)
*
* def decode_lattice(lattice): # <<<<<<<<<<<<<<
@@ -24561,7 +24581,7 @@ static PyObject *__pyx_gb_3_sa_14decode_lattice_2generator9(__pyx_GeneratorObjec
* for arc in node for node in lattice)
*/
-static PyObject *__pyx_pf_3_sa_6decode_lattice(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lattice) {
+static PyObject *__pyx_pf_3_sa_8decode_lattice(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lattice) {
struct __pyx_obj_3_sa___pyx_scope_struct_7_decode_lattice *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -24581,7 +24601,7 @@ static PyObject *__pyx_pf_3_sa_6decode_lattice(CYTHON_UNUSED PyObject *__pyx_sel
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_lattice);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_lattice);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":115
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":115
*
* def decode_lattice(lattice):
* return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc # <<<<<<<<<<<<<<
@@ -24618,19 +24638,19 @@ static PyObject *__pyx_pf_3_sa_6decode_lattice(CYTHON_UNUSED PyObject *__pyx_sel
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_9decode_sentence(PyObject *__pyx_self, PyObject *__pyx_v_lattice); /*proto*/
-static PyMethodDef __pyx_mdef_3_sa_9decode_sentence = {__Pyx_NAMESTR("decode_sentence"), (PyCFunction)__pyx_pw_3_sa_9decode_sentence, METH_O, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_3_sa_9decode_sentence(PyObject *__pyx_self, PyObject *__pyx_v_lattice) {
+static PyObject *__pyx_pw_3_sa_11decode_sentence(PyObject *__pyx_self, PyObject *__pyx_v_lattice); /*proto*/
+static PyMethodDef __pyx_mdef_3_sa_11decode_sentence = {__Pyx_NAMESTR("decode_sentence"), (PyCFunction)__pyx_pw_3_sa_11decode_sentence, METH_O, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pw_3_sa_11decode_sentence(PyObject *__pyx_self, PyObject *__pyx_v_lattice) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("decode_sentence (wrapper)", 0);
- __pyx_r = __pyx_pf_3_sa_8decode_sentence(__pyx_self, ((PyObject *)__pyx_v_lattice));
+ __pyx_r = __pyx_pf_3_sa_10decode_sentence(__pyx_self, ((PyObject *)__pyx_v_lattice));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":119
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":119
*
* def decode_sentence(lattice):
* return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice) # <<<<<<<<<<<<<<
@@ -24890,7 +24910,7 @@ static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObj
return NULL;
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":118
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":118
* for arc in node for node in lattice)
*
* def decode_sentence(lattice): # <<<<<<<<<<<<<<
@@ -24898,7 +24918,7 @@ static PyObject *__pyx_gb_3_sa_15decode_sentence_2generator10(__pyx_GeneratorObj
*
*/
-static PyObject *__pyx_pf_3_sa_8decode_sentence(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lattice) {
+static PyObject *__pyx_pf_3_sa_10decode_sentence(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_lattice) {
struct __pyx_obj_3_sa___pyx_scope_struct_9_decode_sentence *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -24918,7 +24938,7 @@ static PyObject *__pyx_pf_3_sa_8decode_sentence(CYTHON_UNUSED PyObject *__pyx_se
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_lattice);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_lattice);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":119
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":119
*
* def decode_sentence(lattice):
* return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice) # <<<<<<<<<<<<<<
@@ -24955,19 +24975,19 @@ static PyObject *__pyx_pf_3_sa_8decode_sentence(CYTHON_UNUSED PyObject *__pyx_se
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_11encode_words(PyObject *__pyx_self, PyObject *__pyx_v_words); /*proto*/
-static PyMethodDef __pyx_mdef_3_sa_11encode_words = {__Pyx_NAMESTR("encode_words"), (PyCFunction)__pyx_pw_3_sa_11encode_words, METH_O, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_3_sa_11encode_words(PyObject *__pyx_self, PyObject *__pyx_v_words) {
+static PyObject *__pyx_pw_3_sa_13encode_words(PyObject *__pyx_self, PyObject *__pyx_v_words); /*proto*/
+static PyMethodDef __pyx_mdef_3_sa_13encode_words = {__Pyx_NAMESTR("encode_words"), (PyCFunction)__pyx_pw_3_sa_13encode_words, METH_O, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pw_3_sa_13encode_words(PyObject *__pyx_self, PyObject *__pyx_v_words) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("encode_words (wrapper)", 0);
- __pyx_r = __pyx_pf_3_sa_10encode_words(__pyx_self, ((PyObject *)__pyx_v_words));
+ __pyx_r = __pyx_pf_3_sa_12encode_words(__pyx_self, ((PyObject *)__pyx_v_words));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_gb_3_sa_12encode_words_2generator11(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":122
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":122
*
* def encode_words(words):
* return tuple(sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<<
@@ -25108,7 +25128,7 @@ static PyObject *__pyx_gb_3_sa_12encode_words_2generator11(__pyx_GeneratorObject
return NULL;
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":121
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":121
* return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice)
*
* def encode_words(words): # <<<<<<<<<<<<<<
@@ -25116,7 +25136,7 @@ static PyObject *__pyx_gb_3_sa_12encode_words_2generator11(__pyx_GeneratorObject
*
*/
-static PyObject *__pyx_pf_3_sa_10encode_words(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_words) {
+static PyObject *__pyx_pf_3_sa_12encode_words(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_words) {
struct __pyx_obj_3_sa___pyx_scope_struct_11_encode_words *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -25136,7 +25156,7 @@ static PyObject *__pyx_pf_3_sa_10encode_words(CYTHON_UNUSED PyObject *__pyx_self
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_words);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_words);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":122
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":122
*
* def encode_words(words):
* return tuple(sym_fromstring(word, True) for word in words) # <<<<<<<<<<<<<<
@@ -25173,19 +25193,19 @@ static PyObject *__pyx_pf_3_sa_10encode_words(CYTHON_UNUSED PyObject *__pyx_self
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_13decode_words(PyObject *__pyx_self, PyObject *__pyx_v_syms); /*proto*/
-static PyMethodDef __pyx_mdef_3_sa_13decode_words = {__Pyx_NAMESTR("decode_words"), (PyCFunction)__pyx_pw_3_sa_13decode_words, METH_O, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_3_sa_13decode_words(PyObject *__pyx_self, PyObject *__pyx_v_syms) {
+static PyObject *__pyx_pw_3_sa_15decode_words(PyObject *__pyx_self, PyObject *__pyx_v_syms); /*proto*/
+static PyMethodDef __pyx_mdef_3_sa_15decode_words = {__Pyx_NAMESTR("decode_words"), (PyCFunction)__pyx_pw_3_sa_15decode_words, METH_O, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pw_3_sa_15decode_words(PyObject *__pyx_self, PyObject *__pyx_v_syms) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("decode_words (wrapper)", 0);
- __pyx_r = __pyx_pf_3_sa_12decode_words(__pyx_self, ((PyObject *)__pyx_v_syms));
+ __pyx_r = __pyx_pf_3_sa_14decode_words(__pyx_self, ((PyObject *)__pyx_v_syms));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static PyObject *__pyx_gb_3_sa_12decode_words_2generator12(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":125
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":125
*
* def decode_words(syms):
* return tuple(sym_tostring(sym) for sym in syms) # <<<<<<<<<<<<<<
@@ -25324,14 +25344,14 @@ static PyObject *__pyx_gb_3_sa_12decode_words_2generator12(__pyx_GeneratorObject
return NULL;
}
-/* "/home/m/workspace/cdec/python/src/sa/sym.pxi":124
+/* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":124
* return tuple(sym_fromstring(word, True) for word in words)
*
* def decode_words(syms): # <<<<<<<<<<<<<<
* return tuple(sym_tostring(sym) for sym in syms)
*/
-static PyObject *__pyx_pf_3_sa_12decode_words(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_syms) {
+static PyObject *__pyx_pf_3_sa_14decode_words(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_syms) {
struct __pyx_obj_3_sa___pyx_scope_struct_13_decode_words *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -25351,7 +25371,7 @@ static PyObject *__pyx_pf_3_sa_12decode_words(CYTHON_UNUSED PyObject *__pyx_self
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_syms);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_syms);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":125
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":125
*
* def decode_words(syms):
* return tuple(sym_tostring(sym) for sym in syms) # <<<<<<<<<<<<<<
@@ -25432,7 +25452,7 @@ static int __pyx_pw_3_sa_6Phrase_1__cinit__(PyObject *__pyx_v_self, PyObject *__
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":6
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":6
* cdef class Phrase:
*
* def __cinit__(self, words): # <<<<<<<<<<<<<<
@@ -25456,7 +25476,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":8
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":8
* def __cinit__(self, words):
* cdef int i, j, n, n_vars
* n_vars = 0 # <<<<<<<<<<<<<<
@@ -25465,7 +25485,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v
*/
__pyx_v_n_vars = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":9
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":9
* cdef int i, j, n, n_vars
* n_vars = 0
* n = len(words) # <<<<<<<<<<<<<<
@@ -25475,7 +25495,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v
__pyx_t_1 = PyObject_Length(__pyx_v_words); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_n = __pyx_t_1;
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":10
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":10
* n_vars = 0
* n = len(words)
* self.syms = <int *>malloc(n*sizeof(int)) # <<<<<<<<<<<<<<
@@ -25484,7 +25504,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v
*/
__pyx_v_self->syms = ((int *)malloc((__pyx_v_n * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":11
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":11
* n = len(words)
* self.syms = <int *>malloc(n*sizeof(int))
* for i from 0 <= i < n: # <<<<<<<<<<<<<<
@@ -25494,7 +25514,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v
__pyx_t_2 = __pyx_v_n;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":12
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":12
* self.syms = <int *>malloc(n*sizeof(int))
* for i from 0 <= i < n:
* self.syms[i] = words[i] # <<<<<<<<<<<<<<
@@ -25507,7 +25527,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
(__pyx_v_self->syms[__pyx_v_i]) = __pyx_t_4;
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":13
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":13
* for i from 0 <= i < n:
* self.syms[i] = words[i]
* if sym_isvar(self.syms[i]): # <<<<<<<<<<<<<<
@@ -25517,7 +25537,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v
__pyx_t_4 = __pyx_f_3_sa_sym_isvar((__pyx_v_self->syms[__pyx_v_i]));
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":14
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":14
* self.syms[i] = words[i]
* if sym_isvar(self.syms[i]):
* n_vars += 1 # <<<<<<<<<<<<<<
@@ -25530,7 +25550,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v
__pyx_L5:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":15
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":15
* if sym_isvar(self.syms[i]):
* n_vars += 1
* self.n = n # <<<<<<<<<<<<<<
@@ -25539,7 +25559,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v
*/
__pyx_v_self->n = __pyx_v_n;
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":16
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":16
* n_vars += 1
* self.n = n
* self.n_vars = n_vars # <<<<<<<<<<<<<<
@@ -25548,7 +25568,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v
*/
__pyx_v_self->n_vars = __pyx_v_n_vars;
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":17
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":17
* self.n = n
* self.n_vars = n_vars
* self.varpos = <int *>malloc(n_vars*sizeof(int)) # <<<<<<<<<<<<<<
@@ -25557,7 +25577,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v
*/
__pyx_v_self->varpos = ((int *)malloc((__pyx_v_n_vars * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":18
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":18
* self.n_vars = n_vars
* self.varpos = <int *>malloc(n_vars*sizeof(int))
* j = 0 # <<<<<<<<<<<<<<
@@ -25566,7 +25586,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v
*/
__pyx_v_j = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":19
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":19
* self.varpos = <int *>malloc(n_vars*sizeof(int))
* j = 0
* for i from 0 <= i < n: # <<<<<<<<<<<<<<
@@ -25576,7 +25596,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v
__pyx_t_2 = __pyx_v_n;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":20
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":20
* j = 0
* for i from 0 <= i < n:
* if sym_isvar(self.syms[i]): # <<<<<<<<<<<<<<
@@ -25586,7 +25606,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v
__pyx_t_4 = __pyx_f_3_sa_sym_isvar((__pyx_v_self->syms[__pyx_v_i]));
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":21
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":21
* for i from 0 <= i < n:
* if sym_isvar(self.syms[i]):
* self.varpos[j] = i # <<<<<<<<<<<<<<
@@ -25595,7 +25615,7 @@ static int __pyx_pf_3_sa_6Phrase___cinit__(struct __pyx_obj_3_sa_Phrase *__pyx_v
*/
(__pyx_v_self->varpos[__pyx_v_j]) = __pyx_v_i;
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":22
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":22
* if sym_isvar(self.syms[i]):
* self.varpos[j] = i
* j = j + 1 # <<<<<<<<<<<<<<
@@ -25628,7 +25648,7 @@ static void __pyx_pw_3_sa_6Phrase_3__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyFinishContext();
}
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":24
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":24
* j = j + 1
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -25640,7 +25660,7 @@ static void __pyx_pf_3_sa_6Phrase_2__dealloc__(struct __pyx_obj_3_sa_Phrase *__p
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":25
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":25
*
* def __dealloc__(self):
* free(self.syms) # <<<<<<<<<<<<<<
@@ -25649,7 +25669,7 @@ static void __pyx_pf_3_sa_6Phrase_2__dealloc__(struct __pyx_obj_3_sa_Phrase *__p
*/
free(__pyx_v_self->syms);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":26
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":26
* def __dealloc__(self):
* free(self.syms)
* free(self.varpos) # <<<<<<<<<<<<<<
@@ -25672,7 +25692,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_5__str__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":28
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":28
* free(self.varpos)
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -25696,7 +25716,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_4__str__(struct __pyx_obj_3_sa_Phrase *__
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__str__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":29
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":29
*
* def __str__(self):
* strs = [] # <<<<<<<<<<<<<<
@@ -25708,7 +25728,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_4__str__(struct __pyx_obj_3_sa_Phrase *__
__pyx_v_strs = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":31
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":31
* strs = []
* cdef int i, s
* for i from 0 <= i < self.n: # <<<<<<<<<<<<<<
@@ -25718,7 +25738,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_4__str__(struct __pyx_obj_3_sa_Phrase *__
__pyx_t_2 = __pyx_v_self->n;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":32
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":32
* cdef int i, s
* for i from 0 <= i < self.n:
* s = self.syms[i] # <<<<<<<<<<<<<<
@@ -25727,7 +25747,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_4__str__(struct __pyx_obj_3_sa_Phrase *__
*/
__pyx_v_s = (__pyx_v_self->syms[__pyx_v_i]);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":33
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":33
* for i from 0 <= i < self.n:
* s = self.syms[i]
* strs.append(sym_tostring(s)) # <<<<<<<<<<<<<<
@@ -25740,7 +25760,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_4__str__(struct __pyx_obj_3_sa_Phrase *__
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":34
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":34
* s = self.syms[i]
* strs.append(sym_tostring(s))
* return ' '.join(strs) # <<<<<<<<<<<<<<
@@ -25790,7 +25810,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_7handle(PyObject *__pyx_v_self, CYTHON_UN
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":36
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":36
* return ' '.join(strs)
*
* def handle(self): # <<<<<<<<<<<<<<
@@ -25814,7 +25834,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("handle", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":39
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":39
* """return a hashable representation that normalizes the ordering
* of the nonterminal indices"""
* norm = [] # <<<<<<<<<<<<<<
@@ -25826,7 +25846,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p
__pyx_v_norm = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":41
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":41
* norm = []
* cdef int i, j, s
* i = 1 # <<<<<<<<<<<<<<
@@ -25835,7 +25855,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p
*/
__pyx_v_i = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":42
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":42
* cdef int i, j, s
* i = 1
* j = 0 # <<<<<<<<<<<<<<
@@ -25844,7 +25864,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p
*/
__pyx_v_j = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":43
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":43
* i = 1
* j = 0
* for j from 0 <= j < self.n: # <<<<<<<<<<<<<<
@@ -25854,7 +25874,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p
__pyx_t_2 = __pyx_v_self->n;
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":44
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":44
* j = 0
* for j from 0 <= j < self.n:
* s = self.syms[j] # <<<<<<<<<<<<<<
@@ -25863,7 +25883,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p
*/
__pyx_v_s = (__pyx_v_self->syms[__pyx_v_j]);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":45
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":45
* for j from 0 <= j < self.n:
* s = self.syms[j]
* if sym_isvar(s): # <<<<<<<<<<<<<<
@@ -25873,7 +25893,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p
__pyx_t_3 = __pyx_f_3_sa_sym_isvar(__pyx_v_s);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":46
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":46
* s = self.syms[j]
* if sym_isvar(s):
* s = sym_setindex(s,i) # <<<<<<<<<<<<<<
@@ -25882,7 +25902,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p
*/
__pyx_v_s = __pyx_f_3_sa_sym_setindex(__pyx_v_s, __pyx_v_i);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":47
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":47
* if sym_isvar(s):
* s = sym_setindex(s,i)
* i = i + 1 # <<<<<<<<<<<<<<
@@ -25894,7 +25914,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":48
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":48
* s = sym_setindex(s,i)
* i = i + 1
* norm.append(s) # <<<<<<<<<<<<<<
@@ -25907,7 +25927,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_6handle(struct __pyx_obj_3_sa_Phrase *__p
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":49
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":49
* i = i + 1
* norm.append(s)
* return tuple(norm) # <<<<<<<<<<<<<<
@@ -25945,7 +25965,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_9strhandle(PyObject *__pyx_v_self, CYTHON
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":51
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":51
* return tuple(norm)
*
* def strhandle(self): # <<<<<<<<<<<<<<
@@ -25972,7 +25992,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase *
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("strhandle", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":52
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":52
*
* def strhandle(self):
* strs = [] # <<<<<<<<<<<<<<
@@ -25984,7 +26004,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase *
__pyx_v_strs = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":53
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":53
* def strhandle(self):
* strs = []
* norm = [] # <<<<<<<<<<<<<<
@@ -25996,7 +26016,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase *
__pyx_v_norm = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":55
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":55
* norm = []
* cdef int i, j, s
* i = 1 # <<<<<<<<<<<<<<
@@ -26005,7 +26025,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase *
*/
__pyx_v_i = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":56
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":56
* cdef int i, j, s
* i = 1
* j = 0 # <<<<<<<<<<<<<<
@@ -26014,7 +26034,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase *
*/
__pyx_v_j = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":57
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":57
* i = 1
* j = 0
* for j from 0 <= j < self.n: # <<<<<<<<<<<<<<
@@ -26024,7 +26044,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase *
__pyx_t_2 = __pyx_v_self->n;
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":58
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":58
* j = 0
* for j from 0 <= j < self.n:
* s = self.syms[j] # <<<<<<<<<<<<<<
@@ -26033,7 +26053,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase *
*/
__pyx_v_s = (__pyx_v_self->syms[__pyx_v_j]);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":59
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":59
* for j from 0 <= j < self.n:
* s = self.syms[j]
* if sym_isvar(s): # <<<<<<<<<<<<<<
@@ -26043,7 +26063,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase *
__pyx_t_3 = __pyx_f_3_sa_sym_isvar(__pyx_v_s);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":60
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":60
* s = self.syms[j]
* if sym_isvar(s):
* s = sym_setindex(s,i) # <<<<<<<<<<<<<<
@@ -26052,7 +26072,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase *
*/
__pyx_v_s = __pyx_f_3_sa_sym_setindex(__pyx_v_s, __pyx_v_i);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":61
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":61
* if sym_isvar(s):
* s = sym_setindex(s,i)
* i = i + 1 # <<<<<<<<<<<<<<
@@ -26064,7 +26084,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase *
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":62
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":62
* s = sym_setindex(s,i)
* i = i + 1
* norm.append(sym_tostring(s)) # <<<<<<<<<<<<<<
@@ -26077,7 +26097,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_8strhandle(struct __pyx_obj_3_sa_Phrase *
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":63
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":63
* i = i + 1
* norm.append(sym_tostring(s))
* return ' '.join(norm) # <<<<<<<<<<<<<<
@@ -26127,7 +26147,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_11arity(PyObject *__pyx_v_self, CYTHON_UN
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":65
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":65
* return ' '.join(norm)
*
* def arity(self): # <<<<<<<<<<<<<<
@@ -26144,7 +26164,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_10arity(struct __pyx_obj_3_sa_Phrase *__p
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("arity", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":66
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":66
*
* def arity(self):
* return self.n_vars # <<<<<<<<<<<<<<
@@ -26181,7 +26201,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_13getvarpos(PyObject *__pyx_v_self, PyObj
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":68
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":68
* return self.n_vars
*
* def getvarpos(self, i): # <<<<<<<<<<<<<<
@@ -26201,7 +26221,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_12getvarpos(struct __pyx_obj_3_sa_Phrase
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getvarpos", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":69
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":69
*
* def getvarpos(self, i):
* if 0 <= i < self.n_vars: # <<<<<<<<<<<<<<
@@ -26220,7 +26240,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_12getvarpos(struct __pyx_obj_3_sa_Phrase
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":70
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":70
* def getvarpos(self, i):
* if 0 <= i < self.n_vars:
* return self.varpos[i] # <<<<<<<<<<<<<<
@@ -26238,7 +26258,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_12getvarpos(struct __pyx_obj_3_sa_Phrase
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":72
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":72
* return self.varpos[i]
* else:
* raise IndexError # <<<<<<<<<<<<<<
@@ -26274,7 +26294,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_15getvar(PyObject *__pyx_v_self, PyObject
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":74
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":74
* raise IndexError
*
* def getvar(self, i): # <<<<<<<<<<<<<<
@@ -26294,7 +26314,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_14getvar(struct __pyx_obj_3_sa_Phrase *__
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getvar", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":75
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":75
*
* def getvar(self, i):
* if 0 <= i < self.n_vars: # <<<<<<<<<<<<<<
@@ -26313,7 +26333,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_14getvar(struct __pyx_obj_3_sa_Phrase *__
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":76
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":76
* def getvar(self, i):
* if 0 <= i < self.n_vars:
* return self.syms[self.varpos[i]] # <<<<<<<<<<<<<<
@@ -26331,7 +26351,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_14getvar(struct __pyx_obj_3_sa_Phrase *__
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":78
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":78
* return self.syms[self.varpos[i]]
* else:
* raise IndexError # <<<<<<<<<<<<<<
@@ -26356,7 +26376,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_14getvar(struct __pyx_obj_3_sa_Phrase *__
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":80
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":80
* raise IndexError
*
* cdef int chunkpos(self, int k): # <<<<<<<<<<<<<<
@@ -26370,7 +26390,7 @@ int __pyx_f_3_sa_6Phrase_chunkpos(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in
int __pyx_t_1;
__Pyx_RefNannySetupContext("chunkpos", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":81
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":81
*
* cdef int chunkpos(self, int k):
* if k == 0: # <<<<<<<<<<<<<<
@@ -26380,7 +26400,7 @@ int __pyx_f_3_sa_6Phrase_chunkpos(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in
__pyx_t_1 = (__pyx_v_k == 0);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":82
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":82
* cdef int chunkpos(self, int k):
* if k == 0:
* return 0 # <<<<<<<<<<<<<<
@@ -26393,7 +26413,7 @@ int __pyx_f_3_sa_6Phrase_chunkpos(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":84
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":84
* return 0
* else:
* return self.varpos[k-1]+1 # <<<<<<<<<<<<<<
@@ -26411,7 +26431,7 @@ int __pyx_f_3_sa_6Phrase_chunkpos(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":86
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":86
* return self.varpos[k-1]+1
*
* cdef int chunklen(self, int k): # <<<<<<<<<<<<<<
@@ -26425,7 +26445,7 @@ int __pyx_f_3_sa_6Phrase_chunklen(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in
int __pyx_t_1;
__Pyx_RefNannySetupContext("chunklen", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":87
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":87
*
* cdef int chunklen(self, int k):
* if self.n_vars == 0: # <<<<<<<<<<<<<<
@@ -26435,7 +26455,7 @@ int __pyx_f_3_sa_6Phrase_chunklen(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in
__pyx_t_1 = (__pyx_v_self->n_vars == 0);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":88
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":88
* cdef int chunklen(self, int k):
* if self.n_vars == 0:
* return self.n # <<<<<<<<<<<<<<
@@ -26447,7 +26467,7 @@ int __pyx_f_3_sa_6Phrase_chunklen(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in
goto __pyx_L3;
}
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":89
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":89
* if self.n_vars == 0:
* return self.n
* elif k == 0: # <<<<<<<<<<<<<<
@@ -26457,7 +26477,7 @@ int __pyx_f_3_sa_6Phrase_chunklen(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in
__pyx_t_1 = (__pyx_v_k == 0);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":90
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":90
* return self.n
* elif k == 0:
* return self.varpos[0] # <<<<<<<<<<<<<<
@@ -26469,7 +26489,7 @@ int __pyx_f_3_sa_6Phrase_chunklen(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in
goto __pyx_L3;
}
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":91
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":91
* elif k == 0:
* return self.varpos[0]
* elif k == self.n_vars: # <<<<<<<<<<<<<<
@@ -26479,7 +26499,7 @@ int __pyx_f_3_sa_6Phrase_chunklen(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in
__pyx_t_1 = (__pyx_v_k == __pyx_v_self->n_vars);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":92
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":92
* return self.varpos[0]
* elif k == self.n_vars:
* return self.n-self.varpos[k-1]-1 # <<<<<<<<<<<<<<
@@ -26492,7 +26512,7 @@ int __pyx_f_3_sa_6Phrase_chunklen(struct __pyx_obj_3_sa_Phrase *__pyx_v_self, in
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":94
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":94
* return self.n-self.varpos[k-1]-1
* else:
* return self.varpos[k]-self.varpos[k-1]-1 # <<<<<<<<<<<<<<
@@ -26521,7 +26541,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_17clen(PyObject *__pyx_v_self, PyObject *
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":96
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":96
* return self.varpos[k]-self.varpos[k-1]-1
*
* def clen(self, k): # <<<<<<<<<<<<<<
@@ -26539,7 +26559,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_16clen(struct __pyx_obj_3_sa_Phrase *__py
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("clen", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":97
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":97
*
* def clen(self, k):
* return self.chunklen(k) # <<<<<<<<<<<<<<
@@ -26577,7 +26597,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_19getchunk(PyObject *__pyx_v_self, PyObje
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":99
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":99
* return self.chunklen(k)
*
* def getchunk(self, ci): # <<<<<<<<<<<<<<
@@ -26600,7 +26620,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_18getchunk(struct __pyx_obj_3_sa_Phrase *
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("getchunk", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":101
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":101
* def getchunk(self, ci):
* cdef int start, stop
* start = self.chunkpos(ci) # <<<<<<<<<<<<<<
@@ -26610,7 +26630,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_18getchunk(struct __pyx_obj_3_sa_Phrase *
__pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_ci); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_start = ((struct __pyx_vtabstruct_3_sa_Phrase *)__pyx_v_self->__pyx_vtab)->chunkpos(__pyx_v_self, __pyx_t_1);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":102
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":102
* cdef int start, stop
* start = self.chunkpos(ci)
* stop = start+self.chunklen(ci) # <<<<<<<<<<<<<<
@@ -26620,7 +26640,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_18getchunk(struct __pyx_obj_3_sa_Phrase *
__pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_ci); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_stop = (__pyx_v_start + ((struct __pyx_vtabstruct_3_sa_Phrase *)__pyx_v_self->__pyx_vtab)->chunklen(__pyx_v_self, __pyx_t_1));
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":103
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":103
* start = self.chunkpos(ci)
* stop = start+self.chunklen(ci)
* chunk = [] # <<<<<<<<<<<<<<
@@ -26632,7 +26652,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_18getchunk(struct __pyx_obj_3_sa_Phrase *
__pyx_v_chunk = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":104
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":104
* stop = start+self.chunklen(ci)
* chunk = []
* for i from start <= i < stop: # <<<<<<<<<<<<<<
@@ -26642,7 +26662,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_18getchunk(struct __pyx_obj_3_sa_Phrase *
__pyx_t_1 = __pyx_v_stop;
for (__pyx_v_i = __pyx_v_start; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":105
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":105
* chunk = []
* for i from start <= i < stop:
* chunk.append(self.syms[i]) # <<<<<<<<<<<<<<
@@ -26655,7 +26675,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_18getchunk(struct __pyx_obj_3_sa_Phrase *
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":106
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":106
* for i from start <= i < stop:
* chunk.append(self.syms[i])
* return chunk # <<<<<<<<<<<<<<
@@ -26693,7 +26713,7 @@ static int __pyx_pw_3_sa_6Phrase_21__cmp__(PyObject *__pyx_v_self, PyObject *__p
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":108
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":108
* return chunk
*
* def __cmp__(self, other): # <<<<<<<<<<<<<<
@@ -26716,7 +26736,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cmp__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":111
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":111
* cdef Phrase otherp
* cdef int i
* otherp = other # <<<<<<<<<<<<<<
@@ -26727,7 +26747,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v
__Pyx_INCREF(__pyx_v_other);
__pyx_v_otherp = ((struct __pyx_obj_3_sa_Phrase *)__pyx_v_other);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":112
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":112
* cdef int i
* otherp = other
* for i from 0 <= i < min(self.n, otherp.n): # <<<<<<<<<<<<<<
@@ -26744,7 +26764,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v
__pyx_t_1 = __pyx_t_3;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":113
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":113
* otherp = other
* for i from 0 <= i < min(self.n, otherp.n):
* if self.syms[i] < otherp.syms[i]: # <<<<<<<<<<<<<<
@@ -26754,7 +26774,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v
__pyx_t_4 = ((__pyx_v_self->syms[__pyx_v_i]) < (__pyx_v_otherp->syms[__pyx_v_i]));
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":114
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":114
* for i from 0 <= i < min(self.n, otherp.n):
* if self.syms[i] < otherp.syms[i]:
* return -1 # <<<<<<<<<<<<<<
@@ -26766,7 +26786,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v
goto __pyx_L5;
}
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":115
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":115
* if self.syms[i] < otherp.syms[i]:
* return -1
* elif self.syms[i] > otherp.syms[i]: # <<<<<<<<<<<<<<
@@ -26776,7 +26796,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v
__pyx_t_4 = ((__pyx_v_self->syms[__pyx_v_i]) > (__pyx_v_otherp->syms[__pyx_v_i]));
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":116
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":116
* return -1
* elif self.syms[i] > otherp.syms[i]:
* return 1 # <<<<<<<<<<<<<<
@@ -26790,7 +26810,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v
__pyx_L5:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":117
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":117
* elif self.syms[i] > otherp.syms[i]:
* return 1
* if self.n < otherp.n: # <<<<<<<<<<<<<<
@@ -26800,7 +26820,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v
__pyx_t_4 = (__pyx_v_self->n < __pyx_v_otherp->n);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":118
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":118
* return 1
* if self.n < otherp.n:
* return -1 # <<<<<<<<<<<<<<
@@ -26812,7 +26832,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v
goto __pyx_L6;
}
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":119
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":119
* if self.n < otherp.n:
* return -1
* elif self.n > otherp.n: # <<<<<<<<<<<<<<
@@ -26822,7 +26842,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v
__pyx_t_4 = (__pyx_v_self->n > __pyx_v_otherp->n);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":120
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":120
* return -1
* elif self.n > otherp.n:
* return 1 # <<<<<<<<<<<<<<
@@ -26835,7 +26855,7 @@ static int __pyx_pf_3_sa_6Phrase_20__cmp__(struct __pyx_obj_3_sa_Phrase *__pyx_v
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":122
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":122
* return 1
* else:
* return 0 # <<<<<<<<<<<<<<
@@ -26870,7 +26890,7 @@ static Py_hash_t __pyx_pw_3_sa_6Phrase_23__hash__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":124
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":124
* return 0
*
* def __hash__(self): # <<<<<<<<<<<<<<
@@ -26887,7 +26907,7 @@ static Py_hash_t __pyx_pf_3_sa_6Phrase_22__hash__(struct __pyx_obj_3_sa_Phrase *
int __pyx_t_2;
__Pyx_RefNannySetupContext("__hash__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":127
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":127
* cdef int i
* cdef unsigned h
* h = 0 # <<<<<<<<<<<<<<
@@ -26896,7 +26916,7 @@ static Py_hash_t __pyx_pf_3_sa_6Phrase_22__hash__(struct __pyx_obj_3_sa_Phrase *
*/
__pyx_v_h = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":128
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":128
* cdef unsigned h
* h = 0
* for i from 0 <= i < self.n: # <<<<<<<<<<<<<<
@@ -26906,7 +26926,7 @@ static Py_hash_t __pyx_pf_3_sa_6Phrase_22__hash__(struct __pyx_obj_3_sa_Phrase *
__pyx_t_1 = __pyx_v_self->n;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":129
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":129
* h = 0
* for i from 0 <= i < self.n:
* if self.syms[i] > 0: # <<<<<<<<<<<<<<
@@ -26916,7 +26936,7 @@ static Py_hash_t __pyx_pf_3_sa_6Phrase_22__hash__(struct __pyx_obj_3_sa_Phrase *
__pyx_t_2 = ((__pyx_v_self->syms[__pyx_v_i]) > 0);
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":130
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":130
* for i from 0 <= i < self.n:
* if self.syms[i] > 0:
* h = (h << 1) + self.syms[i] # <<<<<<<<<<<<<<
@@ -26928,7 +26948,7 @@ static Py_hash_t __pyx_pf_3_sa_6Phrase_22__hash__(struct __pyx_obj_3_sa_Phrase *
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":132
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":132
* h = (h << 1) + self.syms[i]
* else:
* h = (h << 1) + -self.syms[i] # <<<<<<<<<<<<<<
@@ -26940,7 +26960,7 @@ static Py_hash_t __pyx_pf_3_sa_6Phrase_22__hash__(struct __pyx_obj_3_sa_Phrase *
__pyx_L5:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":133
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":133
* else:
* h = (h << 1) + -self.syms[i]
* return h # <<<<<<<<<<<<<<
@@ -26968,7 +26988,7 @@ static Py_ssize_t __pyx_pw_3_sa_6Phrase_25__len__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":135
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":135
* return h
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -26981,7 +27001,7 @@ static Py_ssize_t __pyx_pf_3_sa_6Phrase_24__len__(struct __pyx_obj_3_sa_Phrase *
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":136
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":136
*
* def __len__(self):
* return self.n # <<<<<<<<<<<<<<
@@ -27008,7 +27028,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_27__getitem__(PyObject *__pyx_v_self, PyO
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":138
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":138
* return self.n
*
* def __getitem__(self, i): # <<<<<<<<<<<<<<
@@ -27026,7 +27046,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_26__getitem__(struct __pyx_obj_3_sa_Phras
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getitem__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":139
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":139
*
* def __getitem__(self, i):
* return self.syms[i] # <<<<<<<<<<<<<<
@@ -27065,7 +27085,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_29__iter__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":141
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":141
* return self.syms[i]
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -27127,7 +27147,7 @@ static PyObject *__pyx_gb_3_sa_6Phrase_30generator2(__pyx_GeneratorObject *__pyx
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":143
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":143
* def __iter__(self):
* cdef int i
* for i from 0 <= i < self.n: # <<<<<<<<<<<<<<
@@ -27137,7 +27157,7 @@ static PyObject *__pyx_gb_3_sa_6Phrase_30generator2(__pyx_GeneratorObject *__pyx
__pyx_t_1 = __pyx_cur_scope->__pyx_v_self->n;
for (__pyx_cur_scope->__pyx_v_i = 0; __pyx_cur_scope->__pyx_v_i < __pyx_t_1; __pyx_cur_scope->__pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":144
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":144
* cdef int i
* for i from 0 <= i < self.n:
* yield self.syms[i] # <<<<<<<<<<<<<<
@@ -27227,7 +27247,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_32subst(PyObject *__pyx_v_self, PyObject
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":146
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":146
* yield self.syms[i]
*
* def subst(self, start, children): # <<<<<<<<<<<<<<
@@ -27250,7 +27270,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_31subst(struct __pyx_obj_3_sa_Phrase *__p
__Pyx_RefNannySetupContext("subst", 0);
__Pyx_INCREF(__pyx_v_start);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":148
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":148
* def subst(self, start, children):
* cdef int i
* for i from 0 <= i < self.n: # <<<<<<<<<<<<<<
@@ -27260,7 +27280,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_31subst(struct __pyx_obj_3_sa_Phrase *__p
__pyx_t_1 = __pyx_v_self->n;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":149
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":149
* cdef int i
* for i from 0 <= i < self.n:
* if sym_isvar(self.syms[i]): # <<<<<<<<<<<<<<
@@ -27270,7 +27290,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_31subst(struct __pyx_obj_3_sa_Phrase *__p
__pyx_t_2 = __pyx_f_3_sa_sym_isvar((__pyx_v_self->syms[__pyx_v_i]));
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":150
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":150
* for i from 0 <= i < self.n:
* if sym_isvar(self.syms[i]):
* start = start + children[sym_getindex(self.syms[i])-1] # <<<<<<<<<<<<<<
@@ -27290,7 +27310,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_31subst(struct __pyx_obj_3_sa_Phrase *__p
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":152
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":152
* start = start + children[sym_getindex(self.syms[i])-1]
* else:
* start = start + (self.syms[i],) # <<<<<<<<<<<<<<
@@ -27314,7 +27334,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_31subst(struct __pyx_obj_3_sa_Phrase *__p
__pyx_L5:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":153
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":153
* else:
* start = start + (self.syms[i],)
* return start # <<<<<<<<<<<<<<
@@ -27351,7 +27371,7 @@ static PyObject *__pyx_pw_3_sa_6Phrase_5words_1__get__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":156
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":156
*
* property words:
* def __get__(self): # <<<<<<<<<<<<<<
@@ -27375,7 +27395,7 @@ static PyObject *__pyx_pf_3_sa_6Phrase_5words___get__(struct __pyx_obj_3_sa_Phra
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":157
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":157
* property words:
* def __get__(self):
* return [sym_tostring(w) for w in self if not sym_isvar(w)] # <<<<<<<<<<<<<<
@@ -27470,7 +27490,7 @@ static int __pyx_pw_3_sa_4Rule_1__cinit__(PyObject *__pyx_v_self, PyObject *__py
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__lhs,&__pyx_n_s__f,&__pyx_n_s__e,&__pyx_n_s__scores,&__pyx_n_s__word_alignments,0};
PyObject* values[5] = {0,0,0,0,0};
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":161
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":161
* cdef class Rule:
*
* def __cinit__(self, int lhs, Phrase f, Phrase e, scores=None, word_alignments=None): # <<<<<<<<<<<<<<
@@ -27567,7 +27587,7 @@ static int __pyx_pf_3_sa_4Rule___cinit__(struct __pyx_obj_3_sa_Rule *__pyx_v_sel
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":162
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":162
*
* def __cinit__(self, int lhs, Phrase f, Phrase e, scores=None, word_alignments=None):
* if not sym_isvar(lhs): raise Exception('Invalid LHS symbol: %d' % lhs) # <<<<<<<<<<<<<<
@@ -27596,7 +27616,7 @@ static int __pyx_pf_3_sa_4Rule___cinit__(struct __pyx_obj_3_sa_Rule *__pyx_v_sel
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":163
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":163
* def __cinit__(self, int lhs, Phrase f, Phrase e, scores=None, word_alignments=None):
* if not sym_isvar(lhs): raise Exception('Invalid LHS symbol: %d' % lhs)
* self.lhs = lhs # <<<<<<<<<<<<<<
@@ -27605,7 +27625,7 @@ static int __pyx_pf_3_sa_4Rule___cinit__(struct __pyx_obj_3_sa_Rule *__pyx_v_sel
*/
__pyx_v_self->lhs = __pyx_v_lhs;
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":164
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":164
* if not sym_isvar(lhs): raise Exception('Invalid LHS symbol: %d' % lhs)
* self.lhs = lhs
* self.f = f # <<<<<<<<<<<<<<
@@ -27618,7 +27638,7 @@ static int __pyx_pf_3_sa_4Rule___cinit__(struct __pyx_obj_3_sa_Rule *__pyx_v_sel
__Pyx_DECREF(((PyObject *)__pyx_v_self->f));
__pyx_v_self->f = __pyx_v_f;
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":165
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":165
* self.lhs = lhs
* self.f = f
* self.e = e # <<<<<<<<<<<<<<
@@ -27631,7 +27651,7 @@ static int __pyx_pf_3_sa_4Rule___cinit__(struct __pyx_obj_3_sa_Rule *__pyx_v_sel
__Pyx_DECREF(((PyObject *)__pyx_v_self->e));
__pyx_v_self->e = __pyx_v_e;
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":166
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":166
* self.f = f
* self.e = e
* self.word_alignments = word_alignments # <<<<<<<<<<<<<<
@@ -27644,7 +27664,7 @@ static int __pyx_pf_3_sa_4Rule___cinit__(struct __pyx_obj_3_sa_Rule *__pyx_v_sel
__Pyx_DECREF(__pyx_v_self->word_alignments);
__pyx_v_self->word_alignments = __pyx_v_word_alignments;
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":167
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":167
* self.e = e
* self.word_alignments = word_alignments
* self.scores = scores # <<<<<<<<<<<<<<
@@ -27681,7 +27701,7 @@ static Py_hash_t __pyx_pw_3_sa_4Rule_3__hash__(PyObject *__pyx_v_self) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":169
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":169
* self.scores = scores
*
* def __hash__(self): # <<<<<<<<<<<<<<
@@ -27700,7 +27720,7 @@ static Py_hash_t __pyx_pf_3_sa_4Rule_2__hash__(struct __pyx_obj_3_sa_Rule *__pyx
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__hash__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":170
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":170
*
* def __hash__(self):
* return hash((self.lhs, self.f, self.e)) # <<<<<<<<<<<<<<
@@ -27756,7 +27776,7 @@ static int __pyx_pw_3_sa_4Rule_5__cmp__(PyObject *__pyx_v_self, PyObject *__pyx_
}
#endif /*!(#if PY_MAJOR_VERSION < 3)*/
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":172
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":172
* return hash((self.lhs, self.f, self.e))
*
* def __cmp__(self, Rule other): # <<<<<<<<<<<<<<
@@ -27777,7 +27797,7 @@ static int __pyx_pf_3_sa_4Rule_4__cmp__(struct __pyx_obj_3_sa_Rule *__pyx_v_self
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cmp__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":173
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":173
*
* def __cmp__(self, Rule other):
* return cmp((self.lhs, self.f, self.e, self.word_alignments), # <<<<<<<<<<<<<<
@@ -27801,7 +27821,7 @@ static int __pyx_pf_3_sa_4Rule_4__cmp__(struct __pyx_obj_3_sa_Rule *__pyx_v_self
__Pyx_GIVEREF(__pyx_v_self->word_alignments);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":174
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":174
* def __cmp__(self, Rule other):
* return cmp((self.lhs, self.f, self.e, self.word_alignments),
* (other.lhs, other.f, other.e, self.word_alignments)) # <<<<<<<<<<<<<<
@@ -27870,7 +27890,7 @@ static PyObject *__pyx_pw_3_sa_4Rule_7fmerge(PyObject *__pyx_v_self, PyObject *_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":176
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":176
* (other.lhs, other.f, other.e, self.word_alignments))
*
* def fmerge(self, Phrase f): # <<<<<<<<<<<<<<
@@ -27888,7 +27908,7 @@ static PyObject *__pyx_pf_3_sa_4Rule_6fmerge(struct __pyx_obj_3_sa_Rule *__pyx_v
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("fmerge", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":177
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":177
*
* def fmerge(self, Phrase f):
* if self.f == f: # <<<<<<<<<<<<<<
@@ -27900,7 +27920,7 @@ static PyObject *__pyx_pf_3_sa_4Rule_6fmerge(struct __pyx_obj_3_sa_Rule *__pyx_v
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":178
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":178
* def fmerge(self, Phrase f):
* if self.f == f:
* self.f = f # <<<<<<<<<<<<<<
@@ -27939,7 +27959,7 @@ static PyObject *__pyx_pw_3_sa_4Rule_9arity(PyObject *__pyx_v_self, CYTHON_UNUSE
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":180
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":180
* self.f = f
*
* def arity(self): # <<<<<<<<<<<<<<
@@ -27957,7 +27977,7 @@ static PyObject *__pyx_pf_3_sa_4Rule_8arity(struct __pyx_obj_3_sa_Rule *__pyx_v_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("arity", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":181
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":181
*
* def arity(self):
* return self.f.arity() # <<<<<<<<<<<<<<
@@ -27999,7 +28019,7 @@ static PyObject *__pyx_pw_3_sa_4Rule_11__str__(PyObject *__pyx_v_self) {
}
static PyObject *__pyx_gb_3_sa_4Rule_7__str___2generator13(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":187
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":187
* fields = [sym_tostring(self.lhs), str(self.f), str(self.e), str(self.scores)]
* if self.word_alignments is not None:
* fields.append(' '.join('%d-%d' % a for a in self.alignments())) # <<<<<<<<<<<<<<
@@ -28144,7 +28164,7 @@ static PyObject *__pyx_gb_3_sa_4Rule_7__str___2generator13(__pyx_GeneratorObject
return NULL;
}
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":183
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":183
* return self.f.arity()
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -28178,7 +28198,7 @@ static PyObject *__pyx_pf_3_sa_4Rule_10__str__(struct __pyx_obj_3_sa_Rule *__pyx
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":185
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":185
* def __str__(self):
* cdef unsigned i
* fields = [sym_tostring(self.lhs), str(self.f), str(self.e), str(self.scores)] # <<<<<<<<<<<<<<
@@ -28228,7 +28248,7 @@ static PyObject *__pyx_pf_3_sa_4Rule_10__str__(struct __pyx_obj_3_sa_Rule *__pyx
__pyx_v_fields = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":186
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":186
* cdef unsigned i
* fields = [sym_tostring(self.lhs), str(self.f), str(self.e), str(self.scores)]
* if self.word_alignments is not None: # <<<<<<<<<<<<<<
@@ -28238,7 +28258,7 @@ static PyObject *__pyx_pf_3_sa_4Rule_10__str__(struct __pyx_obj_3_sa_Rule *__pyx
__pyx_t_6 = (__pyx_cur_scope->__pyx_v_self->word_alignments != Py_None);
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":187
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":187
* fields = [sym_tostring(self.lhs), str(self.f), str(self.e), str(self.scores)]
* if self.word_alignments is not None:
* fields.append(' '.join('%d-%d' % a for a in self.alignments())) # <<<<<<<<<<<<<<
@@ -28264,7 +28284,7 @@ static PyObject *__pyx_pf_3_sa_4Rule_10__str__(struct __pyx_obj_3_sa_Rule *__pyx
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":188
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":188
* if self.word_alignments is not None:
* fields.append(' '.join('%d-%d' % a for a in self.alignments()))
* return ' ||| '.join(fields) # <<<<<<<<<<<<<<
@@ -28317,7 +28337,7 @@ static PyObject *__pyx_pw_3_sa_4Rule_13alignments(PyObject *__pyx_v_self, CYTHON
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rule.pxi":190
+/* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":190
* return ' ||| '.join(fields)
*
* def alignments(self): # <<<<<<<<<<<<<<
@@ -28383,7 +28403,7 @@ static PyObject *__pyx_gb_3_sa_4Rule_14generator3(__pyx_GeneratorObject *__pyx_g
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":191
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":191
*
* def alignments(self):
* for point in self.word_alignments: # <<<<<<<<<<<<<<
@@ -28429,7 +28449,7 @@ static PyObject *__pyx_gb_3_sa_4Rule_14generator3(__pyx_GeneratorObject *__pyx_g
__pyx_cur_scope->__pyx_v_point = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rule.pxi":192
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rule.pxi":192
* def alignments(self):
* for point in self.word_alignments:
* yield point/65536, point%65536 # <<<<<<<<<<<<<<
@@ -28544,7 +28564,7 @@ static PyObject *__pyx_pf_3_sa_4Rule_1e___get__(struct __pyx_obj_3_sa_Rule *__py
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":21
+/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":21
* int arr_len
*
* cdef _Trie_Node* new_trie_node(): # <<<<<<<<<<<<<<
@@ -28558,7 +28578,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_new_trie_node(void) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("new_trie_node", 0);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":23
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":23
* cdef _Trie_Node* new_trie_node():
* cdef _Trie_Node* node
* node = <_Trie_Node*> malloc(sizeof(_Trie_Node)) # <<<<<<<<<<<<<<
@@ -28567,7 +28587,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_new_trie_node(void) {
*/
__pyx_v_node = ((struct __pyx_t_3_sa__Trie_Node *)malloc((sizeof(struct __pyx_t_3_sa__Trie_Node))));
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":24
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":24
* cdef _Trie_Node* node
* node = <_Trie_Node*> malloc(sizeof(_Trie_Node))
* node.root = NULL # <<<<<<<<<<<<<<
@@ -28576,7 +28596,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_new_trie_node(void) {
*/
__pyx_v_node->root = NULL;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":25
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":25
* node = <_Trie_Node*> malloc(sizeof(_Trie_Node))
* node.root = NULL
* node.arr_len = 0 # <<<<<<<<<<<<<<
@@ -28585,7 +28605,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_new_trie_node(void) {
*/
__pyx_v_node->arr_len = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":26
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":26
* node.root = NULL
* node.arr_len = 0
* node.arr = <int*> malloc(sizeof(0*sizeof(int))) # <<<<<<<<<<<<<<
@@ -28594,7 +28614,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_new_trie_node(void) {
*/
__pyx_v_node->arr = ((int *)malloc((sizeof((0 * (sizeof(int)))))));
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":27
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":27
* node.arr_len = 0
* node.arr = <int*> malloc(sizeof(0*sizeof(int)))
* return node # <<<<<<<<<<<<<<
@@ -28610,7 +28630,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_new_trie_node(void) {
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":29
+/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":29
* return node
*
* cdef _Trie_Edge* new_trie_edge(int val): # <<<<<<<<<<<<<<
@@ -28624,7 +28644,7 @@ static struct __pyx_t_3_sa__Trie_Edge *__pyx_f_3_sa_new_trie_edge(int __pyx_v_va
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("new_trie_edge", 0);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":31
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":31
* cdef _Trie_Edge* new_trie_edge(int val):
* cdef _Trie_Edge* edge
* edge = <_Trie_Edge*> malloc(sizeof(_Trie_Edge)) # <<<<<<<<<<<<<<
@@ -28633,7 +28653,7 @@ static struct __pyx_t_3_sa__Trie_Edge *__pyx_f_3_sa_new_trie_edge(int __pyx_v_va
*/
__pyx_v_edge = ((struct __pyx_t_3_sa__Trie_Edge *)malloc((sizeof(struct __pyx_t_3_sa__Trie_Edge))));
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":32
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":32
* cdef _Trie_Edge* edge
* edge = <_Trie_Edge*> malloc(sizeof(_Trie_Edge))
* edge.node = new_trie_node() # <<<<<<<<<<<<<<
@@ -28642,7 +28662,7 @@ static struct __pyx_t_3_sa__Trie_Edge *__pyx_f_3_sa_new_trie_edge(int __pyx_v_va
*/
__pyx_v_edge->node = __pyx_f_3_sa_new_trie_node();
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":33
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":33
* edge = <_Trie_Edge*> malloc(sizeof(_Trie_Edge))
* edge.node = new_trie_node()
* edge.bigger = NULL # <<<<<<<<<<<<<<
@@ -28651,7 +28671,7 @@ static struct __pyx_t_3_sa__Trie_Edge *__pyx_f_3_sa_new_trie_edge(int __pyx_v_va
*/
__pyx_v_edge->bigger = NULL;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":34
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":34
* edge.node = new_trie_node()
* edge.bigger = NULL
* edge.smaller = NULL # <<<<<<<<<<<<<<
@@ -28660,7 +28680,7 @@ static struct __pyx_t_3_sa__Trie_Edge *__pyx_f_3_sa_new_trie_edge(int __pyx_v_va
*/
__pyx_v_edge->smaller = NULL;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":35
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":35
* edge.bigger = NULL
* edge.smaller = NULL
* edge.val = val # <<<<<<<<<<<<<<
@@ -28669,7 +28689,7 @@ static struct __pyx_t_3_sa__Trie_Edge *__pyx_f_3_sa_new_trie_edge(int __pyx_v_va
*/
__pyx_v_edge->val = __pyx_v_val;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":36
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":36
* edge.smaller = NULL
* edge.val = val
* return edge # <<<<<<<<<<<<<<
@@ -28685,7 +28705,7 @@ static struct __pyx_t_3_sa__Trie_Edge *__pyx_f_3_sa_new_trie_edge(int __pyx_v_va
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":38
+/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":38
* return edge
*
* cdef free_trie_node(_Trie_Node* node): # <<<<<<<<<<<<<<
@@ -28703,7 +28723,7 @@ static PyObject *__pyx_f_3_sa_free_trie_node(struct __pyx_t_3_sa__Trie_Node *__p
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("free_trie_node", 0);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":39
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":39
*
* cdef free_trie_node(_Trie_Node* node):
* if node != NULL: # <<<<<<<<<<<<<<
@@ -28713,7 +28733,7 @@ static PyObject *__pyx_f_3_sa_free_trie_node(struct __pyx_t_3_sa__Trie_Node *__p
__pyx_t_1 = (__pyx_v_node != NULL);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":40
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":40
* cdef free_trie_node(_Trie_Node* node):
* if node != NULL:
* free_trie_edge(node.root) # <<<<<<<<<<<<<<
@@ -28724,7 +28744,7 @@ static PyObject *__pyx_f_3_sa_free_trie_node(struct __pyx_t_3_sa__Trie_Node *__p
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":41
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":41
* if node != NULL:
* free_trie_edge(node.root)
* free(node.arr) # <<<<<<<<<<<<<<
@@ -28748,7 +28768,7 @@ static PyObject *__pyx_f_3_sa_free_trie_node(struct __pyx_t_3_sa__Trie_Node *__p
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":43
+/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":43
* free(node.arr)
*
* cdef free_trie_edge(_Trie_Edge* edge): # <<<<<<<<<<<<<<
@@ -28766,7 +28786,7 @@ static PyObject *__pyx_f_3_sa_free_trie_edge(struct __pyx_t_3_sa__Trie_Edge *__p
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("free_trie_edge", 0);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":44
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":44
*
* cdef free_trie_edge(_Trie_Edge* edge):
* if edge != NULL: # <<<<<<<<<<<<<<
@@ -28776,7 +28796,7 @@ static PyObject *__pyx_f_3_sa_free_trie_edge(struct __pyx_t_3_sa__Trie_Edge *__p
__pyx_t_1 = (__pyx_v_edge != NULL);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":45
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":45
* cdef free_trie_edge(_Trie_Edge* edge):
* if edge != NULL:
* free_trie_node(edge.node) # <<<<<<<<<<<<<<
@@ -28787,7 +28807,7 @@ static PyObject *__pyx_f_3_sa_free_trie_edge(struct __pyx_t_3_sa__Trie_Edge *__p
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":46
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":46
* if edge != NULL:
* free_trie_node(edge.node)
* free_trie_edge(edge.bigger) # <<<<<<<<<<<<<<
@@ -28798,7 +28818,7 @@ static PyObject *__pyx_f_3_sa_free_trie_edge(struct __pyx_t_3_sa__Trie_Edge *__p
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":47
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":47
* free_trie_node(edge.node)
* free_trie_edge(edge.bigger)
* free_trie_edge(edge.smaller) # <<<<<<<<<<<<<<
@@ -28824,7 +28844,7 @@ static PyObject *__pyx_f_3_sa_free_trie_edge(struct __pyx_t_3_sa__Trie_Edge *__p
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":49
+/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":49
* free_trie_edge(edge.smaller)
*
* cdef _Trie_Node* trie_find(_Trie_Node* node, int val): # <<<<<<<<<<<<<<
@@ -28841,7 +28861,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s
int __pyx_t_3;
__Pyx_RefNannySetupContext("trie_find", 0);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":51
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":51
* cdef _Trie_Node* trie_find(_Trie_Node* node, int val):
* cdef _Trie_Edge* cur
* cur = node.root # <<<<<<<<<<<<<<
@@ -28850,7 +28870,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s
*/
__pyx_v_cur = __pyx_v_node->root;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":52
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":52
* cdef _Trie_Edge* cur
* cur = node.root
* while cur != NULL and cur.val != val: # <<<<<<<<<<<<<<
@@ -28867,7 +28887,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s
}
if (!__pyx_t_3) break;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":53
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":53
* cur = node.root
* while cur != NULL and cur.val != val:
* if val > cur.val: # <<<<<<<<<<<<<<
@@ -28877,7 +28897,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s
__pyx_t_3 = (__pyx_v_val > __pyx_v_cur->val);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":54
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":54
* while cur != NULL and cur.val != val:
* if val > cur.val:
* cur = cur.bigger # <<<<<<<<<<<<<<
@@ -28888,7 +28908,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s
goto __pyx_L5;
}
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":55
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":55
* if val > cur.val:
* cur = cur.bigger
* elif val < cur.val: # <<<<<<<<<<<<<<
@@ -28898,7 +28918,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s
__pyx_t_3 = (__pyx_v_val < __pyx_v_cur->val);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":56
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":56
* cur = cur.bigger
* elif val < cur.val:
* cur = cur.smaller # <<<<<<<<<<<<<<
@@ -28911,7 +28931,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s
__pyx_L5:;
}
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":57
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":57
* elif val < cur.val:
* cur = cur.smaller
* if cur == NULL: # <<<<<<<<<<<<<<
@@ -28921,7 +28941,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s
__pyx_t_3 = (__pyx_v_cur == NULL);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":58
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":58
* cur = cur.smaller
* if cur == NULL:
* return NULL # <<<<<<<<<<<<<<
@@ -28934,7 +28954,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":60
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":60
* return NULL
* else:
* return cur.node # <<<<<<<<<<<<<<
@@ -28952,7 +28972,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_find(struct __pyx_t_3_s
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":62
+/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":62
* return cur.node
*
* cdef trie_node_data_append(_Trie_Node* node, int val): # <<<<<<<<<<<<<<
@@ -28966,7 +28986,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_append(struct __pyx_t_3_sa__Trie_No
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("trie_node_data_append", 0);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":64
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":64
* cdef trie_node_data_append(_Trie_Node* node, int val):
* cdef int new_len
* new_len = node.arr_len + 1 # <<<<<<<<<<<<<<
@@ -28975,7 +28995,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_append(struct __pyx_t_3_sa__Trie_No
*/
__pyx_v_new_len = (__pyx_v_node->arr_len + 1);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":65
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":65
* cdef int new_len
* new_len = node.arr_len + 1
* node.arr = <int*> realloc(node.arr, new_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -28984,7 +29004,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_append(struct __pyx_t_3_sa__Trie_No
*/
__pyx_v_node->arr = ((int *)realloc(__pyx_v_node->arr, (__pyx_v_new_len * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":66
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":66
* new_len = node.arr_len + 1
* node.arr = <int*> realloc(node.arr, new_len*sizeof(int))
* node.arr[node.arr_len] = val # <<<<<<<<<<<<<<
@@ -28993,7 +29013,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_append(struct __pyx_t_3_sa__Trie_No
*/
(__pyx_v_node->arr[__pyx_v_node->arr_len]) = __pyx_v_val;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":67
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":67
* node.arr = <int*> realloc(node.arr, new_len*sizeof(int))
* node.arr[node.arr_len] = val
* node.arr_len = new_len # <<<<<<<<<<<<<<
@@ -29008,7 +29028,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_append(struct __pyx_t_3_sa__Trie_No
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":69
+/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":69
* node.arr_len = new_len
*
* cdef trie_node_data_extend(_Trie_Node* node, int* vals, int num_vals): # <<<<<<<<<<<<<<
@@ -29022,7 +29042,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_extend(struct __pyx_t_3_sa__Trie_No
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("trie_node_data_extend", 0);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":71
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":71
* cdef trie_node_data_extend(_Trie_Node* node, int* vals, int num_vals):
* cdef int new_len
* new_len = node.arr_len + num_vals # <<<<<<<<<<<<<<
@@ -29031,7 +29051,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_extend(struct __pyx_t_3_sa__Trie_No
*/
__pyx_v_new_len = (__pyx_v_node->arr_len + __pyx_v_num_vals);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":72
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":72
* cdef int new_len
* new_len = node.arr_len + num_vals
* node.arr = <int*> realloc(node.arr, new_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -29040,7 +29060,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_extend(struct __pyx_t_3_sa__Trie_No
*/
__pyx_v_node->arr = ((int *)realloc(__pyx_v_node->arr, (__pyx_v_new_len * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":73
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":73
* new_len = node.arr_len + num_vals
* node.arr = <int*> realloc(node.arr, new_len*sizeof(int))
* memcpy(node.arr + node.arr_len, vals, num_vals*sizeof(int)) # <<<<<<<<<<<<<<
@@ -29049,7 +29069,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_extend(struct __pyx_t_3_sa__Trie_No
*/
memcpy((__pyx_v_node->arr + __pyx_v_node->arr_len), __pyx_v_vals, (__pyx_v_num_vals * (sizeof(int))));
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":74
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":74
* node.arr = <int*> realloc(node.arr, new_len*sizeof(int))
* memcpy(node.arr + node.arr_len, vals, num_vals*sizeof(int))
* node.arr_len = new_len # <<<<<<<<<<<<<<
@@ -29064,7 +29084,7 @@ static PyObject *__pyx_f_3_sa_trie_node_data_extend(struct __pyx_t_3_sa__Trie_No
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":77
+/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":77
*
*
* cdef _Trie_Node* trie_insert(_Trie_Node* node, int val): # <<<<<<<<<<<<<<
@@ -29081,7 +29101,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3
int __pyx_t_3;
__Pyx_RefNannySetupContext("trie_insert", 0);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":79
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":79
* cdef _Trie_Node* trie_insert(_Trie_Node* node, int val):
* cdef _Trie_Edge** cur
* cur = &node.root # <<<<<<<<<<<<<<
@@ -29090,7 +29110,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3
*/
__pyx_v_cur = (&__pyx_v_node->root);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":80
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":80
* cdef _Trie_Edge** cur
* cur = &node.root
* while cur[0] != NULL and cur[0].val != val: # <<<<<<<<<<<<<<
@@ -29107,7 +29127,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3
}
if (!__pyx_t_3) break;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":81
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":81
* cur = &node.root
* while cur[0] != NULL and cur[0].val != val:
* if val > cur[0].val: # <<<<<<<<<<<<<<
@@ -29117,7 +29137,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3
__pyx_t_3 = (__pyx_v_val > (__pyx_v_cur[0])->val);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":82
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":82
* while cur[0] != NULL and cur[0].val != val:
* if val > cur[0].val:
* cur = &cur[0].bigger # <<<<<<<<<<<<<<
@@ -29128,7 +29148,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3
goto __pyx_L5;
}
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":83
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":83
* if val > cur[0].val:
* cur = &cur[0].bigger
* elif val < cur[0].val: # <<<<<<<<<<<<<<
@@ -29138,7 +29158,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3
__pyx_t_3 = (__pyx_v_val < (__pyx_v_cur[0])->val);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":84
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":84
* cur = &cur[0].bigger
* elif val < cur[0].val:
* cur = &cur[0].smaller # <<<<<<<<<<<<<<
@@ -29151,7 +29171,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3
__pyx_L5:;
}
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":85
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":85
* elif val < cur[0].val:
* cur = &cur[0].smaller
* if cur[0] == NULL: # <<<<<<<<<<<<<<
@@ -29161,7 +29181,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3
__pyx_t_3 = ((__pyx_v_cur[0]) == NULL);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":86
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":86
* cur = &cur[0].smaller
* if cur[0] == NULL:
* cur[0] = new_trie_edge(val) # <<<<<<<<<<<<<<
@@ -29173,7 +29193,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3
}
__pyx_L6:;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":87
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":87
* if cur[0] == NULL:
* cur[0] = new_trie_edge(val)
* return cur[0].node # <<<<<<<<<<<<<<
@@ -29189,7 +29209,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_trie_insert(struct __pyx_t_3
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":89
+/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":89
* return cur[0].node
*
* cdef trie_node_to_map(_Trie_Node* node, result, prefix, int include_zeros): # <<<<<<<<<<<<<<
@@ -29209,7 +29229,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("trie_node_to_map", 0);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":92
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":92
* cdef IntList arr
*
* if include_zeros or node.arr_len > 0: # <<<<<<<<<<<<<<
@@ -29224,7 +29244,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_
}
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":93
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":93
*
* if include_zeros or node.arr_len > 0:
* arr = IntList() # <<<<<<<<<<<<<<
@@ -29236,7 +29256,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_
__pyx_v_arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":94
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":94
* if include_zeros or node.arr_len > 0:
* arr = IntList()
* free(arr.arr) # <<<<<<<<<<<<<<
@@ -29245,7 +29265,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_
*/
free(__pyx_v_arr->arr);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":95
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":95
* arr = IntList()
* free(arr.arr)
* arr.arr = <int*> malloc(node.arr_len * sizeof(int)) # <<<<<<<<<<<<<<
@@ -29254,7 +29274,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_
*/
__pyx_v_arr->arr = ((int *)malloc((__pyx_v_node->arr_len * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":96
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":96
* free(arr.arr)
* arr.arr = <int*> malloc(node.arr_len * sizeof(int))
* memcpy(arr.arr, node.arr, node.arr_len * sizeof(int)) # <<<<<<<<<<<<<<
@@ -29263,7 +29283,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_
*/
memcpy(__pyx_v_arr->arr, __pyx_v_node->arr, (__pyx_v_node->arr_len * (sizeof(int))));
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":97
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":97
* arr.arr = <int*> malloc(node.arr_len * sizeof(int))
* memcpy(arr.arr, node.arr, node.arr_len * sizeof(int))
* arr.len = node.arr_len # <<<<<<<<<<<<<<
@@ -29272,7 +29292,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_
*/
__pyx_v_arr->len = __pyx_v_node->arr_len;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":98
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":98
* memcpy(arr.arr, node.arr, node.arr_len * sizeof(int))
* arr.len = node.arr_len
* arr.size = node.arr_len # <<<<<<<<<<<<<<
@@ -29281,7 +29301,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_
*/
__pyx_v_arr->size = __pyx_v_node->arr_len;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":99
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":99
* arr.len = node.arr_len
* arr.size = node.arr_len
* result[prefix] = arr # <<<<<<<<<<<<<<
@@ -29293,7 +29313,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":100
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":100
* arr.size = node.arr_len
* result[prefix] = arr
* trie_edge_to_map(node.root, result, prefix, include_zeros) # <<<<<<<<<<<<<<
@@ -29317,7 +29337,7 @@ static PyObject *__pyx_f_3_sa_trie_node_to_map(struct __pyx_t_3_sa__Trie_Node *_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":102
+/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":102
* trie_edge_to_map(node.root, result, prefix, include_zeros)
*
* cdef trie_edge_to_map(_Trie_Edge* edge, result, prefix, int include_zeros): # <<<<<<<<<<<<<<
@@ -29337,7 +29357,7 @@ static PyObject *__pyx_f_3_sa_trie_edge_to_map(struct __pyx_t_3_sa__Trie_Edge *_
__Pyx_RefNannySetupContext("trie_edge_to_map", 0);
__Pyx_INCREF(__pyx_v_prefix);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":103
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":103
*
* cdef trie_edge_to_map(_Trie_Edge* edge, result, prefix, int include_zeros):
* if edge != NULL: # <<<<<<<<<<<<<<
@@ -29347,7 +29367,7 @@ static PyObject *__pyx_f_3_sa_trie_edge_to_map(struct __pyx_t_3_sa__Trie_Edge *_
__pyx_t_1 = (__pyx_v_edge != NULL);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":104
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":104
* cdef trie_edge_to_map(_Trie_Edge* edge, result, prefix, int include_zeros):
* if edge != NULL:
* trie_edge_to_map(edge.smaller, result, prefix, include_zeros) # <<<<<<<<<<<<<<
@@ -29358,7 +29378,7 @@ static PyObject *__pyx_f_3_sa_trie_edge_to_map(struct __pyx_t_3_sa__Trie_Edge *_
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":105
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":105
* if edge != NULL:
* trie_edge_to_map(edge.smaller, result, prefix, include_zeros)
* trie_edge_to_map(edge.bigger, result, prefix, include_zeros) # <<<<<<<<<<<<<<
@@ -29369,7 +29389,7 @@ static PyObject *__pyx_f_3_sa_trie_edge_to_map(struct __pyx_t_3_sa__Trie_Edge *_
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":106
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":106
* trie_edge_to_map(edge.smaller, result, prefix, include_zeros)
* trie_edge_to_map(edge.bigger, result, prefix, include_zeros)
* prefix = prefix + (edge.val,) # <<<<<<<<<<<<<<
@@ -29390,7 +29410,7 @@ static PyObject *__pyx_f_3_sa_trie_edge_to_map(struct __pyx_t_3_sa__Trie_Edge *_
__pyx_v_prefix = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":107
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":107
* trie_edge_to_map(edge.bigger, result, prefix, include_zeros)
* prefix = prefix + (edge.val,)
* trie_node_to_map(edge.node, result, prefix, include_zeros) # <<<<<<<<<<<<<<
@@ -29465,7 +29485,7 @@ static int __pyx_pw_3_sa_7TrieMap_1__cinit__(PyObject *__pyx_v_self, PyObject *_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":114
+/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":114
* cdef int V
*
* def __cinit__(self, int alphabet_size): # <<<<<<<<<<<<<<
@@ -29478,7 +29498,7 @@ static int __pyx_pf_3_sa_7TrieMap___cinit__(struct __pyx_obj_3_sa_TrieMap *__pyx
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":115
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":115
*
* def __cinit__(self, int alphabet_size):
* self.V = alphabet_size # <<<<<<<<<<<<<<
@@ -29487,7 +29507,7 @@ static int __pyx_pf_3_sa_7TrieMap___cinit__(struct __pyx_obj_3_sa_TrieMap *__pyx
*/
__pyx_v_self->V = __pyx_v_alphabet_size;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":116
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":116
* def __cinit__(self, int alphabet_size):
* self.V = alphabet_size
* self.root = <_Trie_Node**> malloc(self.V * sizeof(_Trie_Node*)) # <<<<<<<<<<<<<<
@@ -29496,7 +29516,7 @@ static int __pyx_pf_3_sa_7TrieMap___cinit__(struct __pyx_obj_3_sa_TrieMap *__pyx
*/
__pyx_v_self->root = ((struct __pyx_t_3_sa__Trie_Node **)malloc((__pyx_v_self->V * (sizeof(struct __pyx_t_3_sa__Trie_Node *)))));
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":117
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":117
* self.V = alphabet_size
* self.root = <_Trie_Node**> malloc(self.V * sizeof(_Trie_Node*))
* memset(self.root, 0, self.V * sizeof(_Trie_Node*)) # <<<<<<<<<<<<<<
@@ -29519,7 +29539,7 @@ static void __pyx_pw_3_sa_7TrieMap_3__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyFinishContext();
}
-/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":120
+/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":120
*
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -29538,7 +29558,7 @@ static void __pyx_pf_3_sa_7TrieMap_2__dealloc__(struct __pyx_obj_3_sa_TrieMap *_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":122
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":122
* def __dealloc__(self):
* cdef int i
* for i from 0 <= i < self.V: # <<<<<<<<<<<<<<
@@ -29548,7 +29568,7 @@ static void __pyx_pf_3_sa_7TrieMap_2__dealloc__(struct __pyx_obj_3_sa_TrieMap *_
__pyx_t_1 = __pyx_v_self->V;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":123
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":123
* cdef int i
* for i from 0 <= i < self.V:
* if self.root[i] != NULL: # <<<<<<<<<<<<<<
@@ -29558,7 +29578,7 @@ static void __pyx_pf_3_sa_7TrieMap_2__dealloc__(struct __pyx_obj_3_sa_TrieMap *_
__pyx_t_2 = ((__pyx_v_self->root[__pyx_v_i]) != NULL);
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":124
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":124
* for i from 0 <= i < self.V:
* if self.root[i] != NULL:
* free_trie_node(self.root[i]) # <<<<<<<<<<<<<<
@@ -29573,7 +29593,7 @@ static void __pyx_pf_3_sa_7TrieMap_2__dealloc__(struct __pyx_obj_3_sa_TrieMap *_
__pyx_L5:;
}
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":125
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":125
* if self.root[i] != NULL:
* free_trie_node(self.root[i])
* free(self.root) # <<<<<<<<<<<<<<
@@ -29601,7 +29621,7 @@ static PyObject *__pyx_pw_3_sa_7TrieMap_5insert(PyObject *__pyx_v_self, PyObject
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":128
+/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":128
*
*
* def insert(self, pattern): # <<<<<<<<<<<<<<
@@ -29624,7 +29644,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_4insert(struct __pyx_obj_3_sa_TrieMap *_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("insert", 0);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":131
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":131
* cdef int* p
* cdef int i, l
* l = len(pattern) # <<<<<<<<<<<<<<
@@ -29634,7 +29654,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_4insert(struct __pyx_obj_3_sa_TrieMap *_
__pyx_t_1 = PyObject_Length(__pyx_v_pattern); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_l = __pyx_t_1;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":132
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":132
* cdef int i, l
* l = len(pattern)
* p = <int*> malloc(l*sizeof(int)) # <<<<<<<<<<<<<<
@@ -29643,7 +29663,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_4insert(struct __pyx_obj_3_sa_TrieMap *_
*/
__pyx_v_p = ((int *)malloc((__pyx_v_l * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":133
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":133
* l = len(pattern)
* p = <int*> malloc(l*sizeof(int))
* for i from 0 <= i < l: # <<<<<<<<<<<<<<
@@ -29653,7 +29673,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_4insert(struct __pyx_obj_3_sa_TrieMap *_
__pyx_t_2 = __pyx_v_l;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":134
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":134
* p = <int*> malloc(l*sizeof(int))
* for i from 0 <= i < l:
* p[i] = pattern[i] # <<<<<<<<<<<<<<
@@ -29667,7 +29687,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_4insert(struct __pyx_obj_3_sa_TrieMap *_
(__pyx_v_p[__pyx_v_i]) = __pyx_t_4;
}
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":135
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":135
* for i from 0 <= i < l:
* p[i] = pattern[i]
* self._insert(p,l) # <<<<<<<<<<<<<<
@@ -29676,7 +29696,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_4insert(struct __pyx_obj_3_sa_TrieMap *_
*/
((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_self->__pyx_vtab)->_insert(__pyx_v_self, __pyx_v_p, __pyx_v_l);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":136
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":136
* p[i] = pattern[i]
* self._insert(p,l)
* free(p) # <<<<<<<<<<<<<<
@@ -29697,7 +29717,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_4insert(struct __pyx_obj_3_sa_TrieMap *_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":139
+/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":139
*
*
* cdef _Trie_Node* _insert(self, int* pattern, int pattern_len): # <<<<<<<<<<<<<<
@@ -29714,7 +29734,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__insert(struct __py
int __pyx_t_2;
__Pyx_RefNannySetupContext("_insert", 0);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":142
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":142
* cdef int i
* cdef _Trie_Node* node
* if self.root[pattern[0]] == NULL: # <<<<<<<<<<<<<<
@@ -29724,7 +29744,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__insert(struct __py
__pyx_t_1 = ((__pyx_v_self->root[(__pyx_v_pattern[0])]) == NULL);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":143
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":143
* cdef _Trie_Node* node
* if self.root[pattern[0]] == NULL:
* self.root[pattern[0]] = new_trie_node() # <<<<<<<<<<<<<<
@@ -29736,7 +29756,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__insert(struct __py
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":144
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":144
* if self.root[pattern[0]] == NULL:
* self.root[pattern[0]] = new_trie_node()
* node = self.root[pattern[0]] # <<<<<<<<<<<<<<
@@ -29745,7 +29765,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__insert(struct __py
*/
__pyx_v_node = (__pyx_v_self->root[(__pyx_v_pattern[0])]);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":145
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":145
* self.root[pattern[0]] = new_trie_node()
* node = self.root[pattern[0]]
* for i from 1 <= i < pattern_len: # <<<<<<<<<<<<<<
@@ -29755,7 +29775,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__insert(struct __py
__pyx_t_2 = __pyx_v_pattern_len;
for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":146
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":146
* node = self.root[pattern[0]]
* for i from 1 <= i < pattern_len:
* node = trie_insert(node, pattern[i]) # <<<<<<<<<<<<<<
@@ -29765,7 +29785,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__insert(struct __py
__pyx_v_node = __pyx_f_3_sa_trie_insert(__pyx_v_node, (__pyx_v_pattern[__pyx_v_i]));
}
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":147
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":147
* for i from 1 <= i < pattern_len:
* node = trie_insert(node, pattern[i])
* return node # <<<<<<<<<<<<<<
@@ -29792,7 +29812,7 @@ static PyObject *__pyx_pw_3_sa_7TrieMap_7contains(PyObject *__pyx_v_self, PyObje
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":149
+/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":149
* return node
*
* def contains(self, pattern): # <<<<<<<<<<<<<<
@@ -29817,7 +29837,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("contains", 0);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":153
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":153
* cdef int i, l
* cdef _Trie_Node* node
* l = len(pattern) # <<<<<<<<<<<<<<
@@ -29827,7 +29847,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap
__pyx_t_1 = PyObject_Length(__pyx_v_pattern); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_l = __pyx_t_1;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":154
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":154
* cdef _Trie_Node* node
* l = len(pattern)
* p = <int*> malloc(l*sizeof(int)) # <<<<<<<<<<<<<<
@@ -29836,7 +29856,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap
*/
__pyx_v_p = ((int *)malloc((__pyx_v_l * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":155
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":155
* l = len(pattern)
* p = <int*> malloc(l*sizeof(int))
* for i from 0 <= i < l: # <<<<<<<<<<<<<<
@@ -29846,7 +29866,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap
__pyx_t_2 = __pyx_v_l;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":156
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":156
* p = <int*> malloc(l*sizeof(int))
* for i from 0 <= i < l:
* p[i] = pattern[i] # <<<<<<<<<<<<<<
@@ -29860,7 +29880,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap
(__pyx_v_p[__pyx_v_i]) = __pyx_t_4;
}
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":157
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":157
* for i from 0 <= i < l:
* p[i] = pattern[i]
* node = self._contains(p,l) # <<<<<<<<<<<<<<
@@ -29869,7 +29889,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap
*/
__pyx_v_node = ((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_self->__pyx_vtab)->_contains(__pyx_v_self, __pyx_v_p, __pyx_v_l);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":158
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":158
* p[i] = pattern[i]
* node = self._contains(p,l)
* free(p) # <<<<<<<<<<<<<<
@@ -29878,7 +29898,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap
*/
free(__pyx_v_p);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":159
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":159
* node = self._contains(p,l)
* free(p)
* if node == NULL: # <<<<<<<<<<<<<<
@@ -29888,7 +29908,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap
__pyx_t_5 = (__pyx_v_node == NULL);
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":160
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":160
* free(p)
* if node == NULL:
* return False # <<<<<<<<<<<<<<
@@ -29905,7 +29925,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":162
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":162
* return False
* else:
* return True # <<<<<<<<<<<<<<
@@ -29933,7 +29953,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_6contains(struct __pyx_obj_3_sa_TrieMap
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":164
+/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":164
* return True
*
* cdef _Trie_Node* _contains(self, int* pattern, int pattern_len): # <<<<<<<<<<<<<<
@@ -29951,7 +29971,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__contains(struct __
int __pyx_t_3;
__Pyx_RefNannySetupContext("_contains", 0);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":167
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":167
* cdef int i
* cdef _Trie_Node* node
* node = self.root[pattern[0]] # <<<<<<<<<<<<<<
@@ -29960,7 +29980,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__contains(struct __
*/
__pyx_v_node = (__pyx_v_self->root[(__pyx_v_pattern[0])]);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":168
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":168
* cdef _Trie_Node* node
* node = self.root[pattern[0]]
* i = 1 # <<<<<<<<<<<<<<
@@ -29969,7 +29989,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__contains(struct __
*/
__pyx_v_i = 1;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":169
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":169
* node = self.root[pattern[0]]
* i = 1
* while node != NULL and i < pattern_len: # <<<<<<<<<<<<<<
@@ -29986,7 +30006,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__contains(struct __
}
if (!__pyx_t_3) break;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":170
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":170
* i = 1
* while node != NULL and i < pattern_len:
* node = trie_find(node, pattern[i]) # <<<<<<<<<<<<<<
@@ -29995,7 +30015,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__contains(struct __
*/
__pyx_v_node = __pyx_f_3_sa_trie_find(__pyx_v_node, (__pyx_v_pattern[__pyx_v_i]));
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":171
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":171
* while node != NULL and i < pattern_len:
* node = trie_find(node, pattern[i])
* i = i+1 # <<<<<<<<<<<<<<
@@ -30005,7 +30025,7 @@ static struct __pyx_t_3_sa__Trie_Node *__pyx_f_3_sa_7TrieMap__contains(struct __
__pyx_v_i = (__pyx_v_i + 1);
}
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":172
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":172
* node = trie_find(node, pattern[i])
* i = i+1
* return node # <<<<<<<<<<<<<<
@@ -30032,7 +30052,7 @@ static PyObject *__pyx_pw_3_sa_7TrieMap_9toMap(PyObject *__pyx_v_self, PyObject
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":174
+/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":174
* return node
*
* def toMap(self, flag): # <<<<<<<<<<<<<<
@@ -30055,7 +30075,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_8toMap(struct __pyx_obj_3_sa_TrieMap *__
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("toMap", 0);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":177
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":177
* cdef int i, include_zeros
*
* if flag: # <<<<<<<<<<<<<<
@@ -30065,7 +30085,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_8toMap(struct __pyx_obj_3_sa_TrieMap *__
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flag); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":178
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":178
*
* if flag:
* include_zeros=1 # <<<<<<<<<<<<<<
@@ -30077,7 +30097,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_8toMap(struct __pyx_obj_3_sa_TrieMap *__
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":180
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":180
* include_zeros=1
* else:
* include_zeros=0 # <<<<<<<<<<<<<<
@@ -30088,7 +30108,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_8toMap(struct __pyx_obj_3_sa_TrieMap *__
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":181
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":181
* else:
* include_zeros=0
* result = {} # <<<<<<<<<<<<<<
@@ -30100,7 +30120,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_8toMap(struct __pyx_obj_3_sa_TrieMap *__
__pyx_v_result = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":182
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":182
* include_zeros=0
* result = {}
* for i from 0 <= i < self.V: # <<<<<<<<<<<<<<
@@ -30110,7 +30130,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_8toMap(struct __pyx_obj_3_sa_TrieMap *__
__pyx_t_3 = __pyx_v_self->V;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":183
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":183
* result = {}
* for i from 0 <= i < self.V:
* if self.root[i] != NULL: # <<<<<<<<<<<<<<
@@ -30120,7 +30140,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_8toMap(struct __pyx_obj_3_sa_TrieMap *__
__pyx_t_1 = ((__pyx_v_self->root[__pyx_v_i]) != NULL);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":184
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":184
* for i from 0 <= i < self.V:
* if self.root[i] != NULL:
* trie_node_to_map(self.root[i], result, (i,), include_zeros) # <<<<<<<<<<<<<<
@@ -30143,7 +30163,7 @@ static PyObject *__pyx_pf_3_sa_7TrieMap_8toMap(struct __pyx_obj_3_sa_TrieMap *__
__pyx_L6:;
}
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":185
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":185
* if self.root[i] != NULL:
* trie_node_to_map(self.root[i], result, (i,), include_zeros)
* return result # <<<<<<<<<<<<<<
@@ -30188,7 +30208,7 @@ static int __pyx_pw_3_sa_14Precomputation_1__cinit__(PyObject *__pyx_v_self, PyO
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fsarray,&__pyx_n_s__from_stats,&__pyx_n_s__from_binary,&__pyx_n_s__precompute_rank,&__pyx_n_s_70,&__pyx_n_s__max_length,&__pyx_n_s__max_nonterminals,&__pyx_n_s_71,&__pyx_n_s__train_min_gap_size,0};
PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":200
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":200
* cdef write_map(self, m, FILE* f)
*
* def __cinit__(self, fsarray=None, from_stats=None, from_binary=None, # <<<<<<<<<<<<<<
@@ -30322,7 +30342,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":204
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":204
* max_length=5, max_nonterminals=2,
* train_max_initial_size=10, train_min_gap_size=2):
* self.precompute_rank = precompute_rank # <<<<<<<<<<<<<<
@@ -30332,7 +30352,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom
__pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_precompute_rank); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->precompute_rank = __pyx_t_1;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":205
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":205
* train_max_initial_size=10, train_min_gap_size=2):
* self.precompute_rank = precompute_rank
* self.precompute_secondary_rank = precompute_secondary_rank # <<<<<<<<<<<<<<
@@ -30342,7 +30362,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom
__pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_precompute_secondary_rank); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->precompute_secondary_rank = __pyx_t_1;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":206
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":206
* self.precompute_rank = precompute_rank
* self.precompute_secondary_rank = precompute_secondary_rank
* self.max_length = max_length # <<<<<<<<<<<<<<
@@ -30352,7 +30372,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom
__pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_max_length); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->max_length = __pyx_t_1;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":207
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":207
* self.precompute_secondary_rank = precompute_secondary_rank
* self.max_length = max_length
* self.max_nonterminals = max_nonterminals # <<<<<<<<<<<<<<
@@ -30362,7 +30382,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom
__pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_max_nonterminals); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->max_nonterminals = __pyx_t_1;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":208
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":208
* self.max_length = max_length
* self.max_nonterminals = max_nonterminals
* self.train_max_initial_size = train_max_initial_size # <<<<<<<<<<<<<<
@@ -30372,7 +30392,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom
__pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_train_max_initial_size); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->train_max_initial_size = __pyx_t_1;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":209
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":209
* self.max_nonterminals = max_nonterminals
* self.train_max_initial_size = train_max_initial_size
* self.train_min_gap_size = train_min_gap_size # <<<<<<<<<<<<<<
@@ -30382,7 +30402,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom
__pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_train_min_gap_size); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->train_min_gap_size = __pyx_t_1;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":210
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":210
* self.train_max_initial_size = train_max_initial_size
* self.train_min_gap_size = train_min_gap_size
* if from_binary: # <<<<<<<<<<<<<<
@@ -30392,7 +30412,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_binary); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":211
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":211
* self.train_min_gap_size = train_min_gap_size
* if from_binary:
* self.read_binary(from_binary) # <<<<<<<<<<<<<<
@@ -30414,7 +30434,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom
goto __pyx_L3;
}
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":212
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":212
* if from_binary:
* self.read_binary(from_binary)
* elif from_stats: # <<<<<<<<<<<<<<
@@ -30424,7 +30444,7 @@ static int __pyx_pf_3_sa_14Precomputation___cinit__(struct __pyx_obj_3_sa_Precom
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_stats); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":213
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":213
* self.read_binary(from_binary)
* elif from_stats:
* self.precompute(from_stats, fsarray) # <<<<<<<<<<<<<<
@@ -30484,7 +30504,7 @@ static PyObject *__pyx_pw_3_sa_14Precomputation_3read_binary(PyObject *__pyx_v_s
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":216
+/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":216
*
*
* def read_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -30502,7 +30522,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_binary", 0);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":218
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":218
* def read_binary(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "r") # <<<<<<<<<<<<<<
@@ -30511,7 +30531,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":219
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":219
* cdef FILE* f
* f = fopen(filename, "r")
* fread(&(self.precompute_rank), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -30520,7 +30540,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_
*/
fread((&__pyx_v_self->precompute_rank), (sizeof(int)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":220
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":220
* f = fopen(filename, "r")
* fread(&(self.precompute_rank), sizeof(int), 1, f)
* fread(&(self.precompute_secondary_rank), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -30529,7 +30549,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_
*/
fread((&__pyx_v_self->precompute_secondary_rank), (sizeof(int)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":221
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":221
* fread(&(self.precompute_rank), sizeof(int), 1, f)
* fread(&(self.precompute_secondary_rank), sizeof(int), 1, f)
* fread(&(self.max_length), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -30538,7 +30558,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_
*/
fread((&__pyx_v_self->max_length), (sizeof(int)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":222
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":222
* fread(&(self.precompute_secondary_rank), sizeof(int), 1, f)
* fread(&(self.max_length), sizeof(int), 1, f)
* fread(&(self.max_nonterminals), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -30547,7 +30567,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_
*/
fread((&__pyx_v_self->max_nonterminals), (sizeof(int)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":223
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":223
* fread(&(self.max_length), sizeof(int), 1, f)
* fread(&(self.max_nonterminals), sizeof(int), 1, f)
* fread(&(self.train_max_initial_size), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -30556,7 +30576,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_
*/
fread((&__pyx_v_self->train_max_initial_size), (sizeof(int)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":224
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":224
* fread(&(self.max_nonterminals), sizeof(int), 1, f)
* fread(&(self.train_max_initial_size), sizeof(int), 1, f)
* fread(&(self.train_min_gap_size), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -30565,7 +30585,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_
*/
fread((&__pyx_v_self->train_min_gap_size), (sizeof(int)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":225
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":225
* fread(&(self.train_max_initial_size), sizeof(int), 1, f)
* fread(&(self.train_min_gap_size), sizeof(int), 1, f)
* self.precomputed_index = self.read_map(f) # <<<<<<<<<<<<<<
@@ -30580,7 +30600,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_
__pyx_v_self->precomputed_index = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":226
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":226
* fread(&(self.train_min_gap_size), sizeof(int), 1, f)
* self.precomputed_index = self.read_map(f)
* self.precomputed_collocations = self.read_map(f) # <<<<<<<<<<<<<<
@@ -30595,7 +30615,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_2read_binary(struct __pyx_obj_3_
__pyx_v_self->precomputed_collocations = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":227
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":227
* self.precomputed_index = self.read_map(f)
* self.precomputed_collocations = self.read_map(f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -30637,7 +30657,7 @@ static PyObject *__pyx_pw_3_sa_14Precomputation_5write_binary(PyObject *__pyx_v_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":230
+/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":230
*
*
* def write_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -30656,7 +30676,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_binary", 0);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":232
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":232
* def write_binary(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "w") # <<<<<<<<<<<<<<
@@ -30665,7 +30685,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":233
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":233
* cdef FILE* f
* f = fopen(filename, "w")
* fwrite(&(self.precompute_rank), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -30674,7 +30694,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3
*/
fwrite((&__pyx_v_self->precompute_rank), (sizeof(int)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":234
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":234
* f = fopen(filename, "w")
* fwrite(&(self.precompute_rank), sizeof(int), 1, f)
* fwrite(&(self.precompute_secondary_rank), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -30683,7 +30703,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3
*/
fwrite((&__pyx_v_self->precompute_secondary_rank), (sizeof(int)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":235
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":235
* fwrite(&(self.precompute_rank), sizeof(int), 1, f)
* fwrite(&(self.precompute_secondary_rank), sizeof(int), 1, f)
* fwrite(&(self.max_length), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -30692,7 +30712,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3
*/
fwrite((&__pyx_v_self->max_length), (sizeof(int)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":236
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":236
* fwrite(&(self.precompute_secondary_rank), sizeof(int), 1, f)
* fwrite(&(self.max_length), sizeof(int), 1, f)
* fwrite(&(self.max_nonterminals), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -30701,7 +30721,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3
*/
fwrite((&__pyx_v_self->max_nonterminals), (sizeof(int)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":237
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":237
* fwrite(&(self.max_length), sizeof(int), 1, f)
* fwrite(&(self.max_nonterminals), sizeof(int), 1, f)
* fwrite(&(self.train_max_initial_size), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -30710,7 +30730,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3
*/
fwrite((&__pyx_v_self->train_max_initial_size), (sizeof(int)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":238
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":238
* fwrite(&(self.max_nonterminals), sizeof(int), 1, f)
* fwrite(&(self.train_max_initial_size), sizeof(int), 1, f)
* fwrite(&(self.train_min_gap_size), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -30719,7 +30739,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3
*/
fwrite((&__pyx_v_self->train_min_gap_size), (sizeof(int)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":239
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":239
* fwrite(&(self.train_max_initial_size), sizeof(int), 1, f)
* fwrite(&(self.train_min_gap_size), sizeof(int), 1, f)
* self.write_map(self.precomputed_index, f) # <<<<<<<<<<<<<<
@@ -30733,7 +30753,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":240
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":240
* fwrite(&(self.train_min_gap_size), sizeof(int), 1, f)
* self.write_map(self.precomputed_index, f)
* self.write_map(self.precomputed_collocations, f) # <<<<<<<<<<<<<<
@@ -30747,7 +30767,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":241
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":241
* self.write_map(self.precomputed_index, f)
* self.write_map(self.precomputed_collocations, f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -30769,7 +30789,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_4write_binary(struct __pyx_obj_3
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":244
+/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":244
*
*
* cdef write_map(self, m, FILE* f): # <<<<<<<<<<<<<<
@@ -30800,7 +30820,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_map", 0);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":248
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":248
* cdef IntList arr
*
* N = len(m) # <<<<<<<<<<<<<<
@@ -30810,7 +30830,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __
__pyx_t_1 = PyObject_Length(__pyx_v_m); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_N = __pyx_t_1;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":249
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":249
*
* N = len(m)
* fwrite(&(N), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -30819,7 +30839,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __
*/
fwrite((&__pyx_v_N), (sizeof(int)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":250
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":250
* N = len(m)
* fwrite(&(N), sizeof(int), 1, f)
* for pattern, val in m.iteritems(): # <<<<<<<<<<<<<<
@@ -30849,7 +30869,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __
__pyx_v_val = __pyx_t_6;
__pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":251
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":251
* fwrite(&(N), sizeof(int), 1, f)
* for pattern, val in m.iteritems():
* N = len(pattern) # <<<<<<<<<<<<<<
@@ -30859,7 +30879,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __
__pyx_t_8 = PyObject_Length(__pyx_v_pattern); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_N = __pyx_t_8;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":252
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":252
* for pattern, val in m.iteritems():
* N = len(pattern)
* fwrite(&(N), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -30868,7 +30888,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __
*/
fwrite((&__pyx_v_N), (sizeof(int)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":253
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":253
* N = len(pattern)
* fwrite(&(N), sizeof(int), 1, f)
* for word_id in pattern: # <<<<<<<<<<<<<<
@@ -30913,7 +30933,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __
__pyx_v_word_id = __pyx_t_5;
__pyx_t_5 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":254
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":254
* fwrite(&(N), sizeof(int), 1, f)
* for word_id in pattern:
* i = word_id # <<<<<<<<<<<<<<
@@ -30923,7 +30943,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __
__pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_word_id); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_i = __pyx_t_7;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":255
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":255
* for word_id in pattern:
* i = word_id
* fwrite(&(i), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -30934,7 +30954,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":256
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":256
* i = word_id
* fwrite(&(i), sizeof(int), 1, f)
* arr = val # <<<<<<<<<<<<<<
@@ -30946,7 +30966,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __
__Pyx_XDECREF(((PyObject *)__pyx_v_arr));
__pyx_v_arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_v_val);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":257
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":257
* fwrite(&(i), sizeof(int), 1, f)
* arr = val
* arr.write_handle(f) # <<<<<<<<<<<<<<
@@ -30975,7 +30995,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_write_map(CYTHON_UNUSED struct __
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":260
+/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":260
*
*
* cdef read_map(self, FILE* f): # <<<<<<<<<<<<<<
@@ -31003,7 +31023,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_map", 0);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":264
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":264
* cdef IntList arr
*
* m = {} # <<<<<<<<<<<<<<
@@ -31015,7 +31035,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p
__pyx_v_m = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":265
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":265
*
* m = {}
* fread(&(N), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -31024,7 +31044,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p
*/
fread((&__pyx_v_N), (sizeof(int)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":266
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":266
* m = {}
* fread(&(N), sizeof(int), 1, f)
* for j from 0 <= j < N: # <<<<<<<<<<<<<<
@@ -31034,7 +31054,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p
__pyx_t_2 = __pyx_v_N;
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_2; __pyx_v_j++) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":267
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":267
* fread(&(N), sizeof(int), 1, f)
* for j from 0 <= j < N:
* fread(&(i), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -31043,7 +31063,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p
*/
fread((&__pyx_v_i), (sizeof(int)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":268
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":268
* for j from 0 <= j < N:
* fread(&(i), sizeof(int), 1, f)
* key = () # <<<<<<<<<<<<<<
@@ -31054,7 +31074,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p
__Pyx_XDECREF(((PyObject *)__pyx_v_key));
__pyx_v_key = __pyx_empty_tuple;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":269
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":269
* fread(&(i), sizeof(int), 1, f)
* key = ()
* for k from 0 <= k < i: # <<<<<<<<<<<<<<
@@ -31064,7 +31084,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p
__pyx_t_3 = __pyx_v_i;
for (__pyx_v_k = 0; __pyx_v_k < __pyx_t_3; __pyx_v_k++) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":270
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":270
* key = ()
* for k from 0 <= k < i:
* fread(&(word_id), sizeof(int), 1, f) # <<<<<<<<<<<<<<
@@ -31073,7 +31093,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p
*/
fread((&__pyx_v_word_id), (sizeof(int)), 1, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":271
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":271
* for k from 0 <= k < i:
* fread(&(word_id), sizeof(int), 1, f)
* key = key + (word_id,) # <<<<<<<<<<<<<<
@@ -31095,7 +31115,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p
__pyx_t_1 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":272
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":272
* fread(&(word_id), sizeof(int), 1, f)
* key = key + (word_id,)
* arr = IntList() # <<<<<<<<<<<<<<
@@ -31108,7 +31128,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p
__pyx_v_arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":273
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":273
* key = key + (word_id,)
* arr = IntList()
* arr.read_handle(f) # <<<<<<<<<<<<<<
@@ -31117,7 +31137,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_arr->__pyx_vtab)->read_handle(__pyx_v_arr, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":274
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":274
* arr = IntList()
* arr.read_handle(f)
* m[key] = arr # <<<<<<<<<<<<<<
@@ -31127,7 +31147,7 @@ static PyObject *__pyx_f_3_sa_14Precomputation_read_map(CYTHON_UNUSED struct __p
if (PyDict_SetItem(((PyObject *)__pyx_v_m), ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_arr)) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":275
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":275
* arr.read_handle(f)
* m[key] = arr
* return m # <<<<<<<<<<<<<<
@@ -31216,7 +31236,7 @@ static PyObject *__pyx_pw_3_sa_14Precomputation_7precompute(PyObject *__pyx_v_se
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":278
+/* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":278
*
*
* def precompute(self, stats, SuffixArray sarray): # <<<<<<<<<<<<<<
@@ -31279,29 +31299,30 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
- PyObject *(*__pyx_t_4)(PyObject *);
- PyObject *__pyx_t_5 = NULL;
+ float __pyx_t_4;
+ PyObject *(*__pyx_t_5)(PyObject *);
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
- PyObject *(*__pyx_t_10)(PyObject *);
- int __pyx_t_11;
- Py_ssize_t __pyx_t_12;
- int __pyx_t_13;
- Py_ssize_t __pyx_t_14;
- int __pyx_t_15;
+ PyObject *__pyx_t_10 = NULL;
+ PyObject *(*__pyx_t_11)(PyObject *);
+ int __pyx_t_12;
+ Py_ssize_t __pyx_t_13;
+ int __pyx_t_14;
+ Py_ssize_t __pyx_t_15;
int __pyx_t_16;
int __pyx_t_17;
int __pyx_t_18;
int __pyx_t_19;
- PyObject *(*__pyx_t_20)(PyObject *);
+ int __pyx_t_20;
+ PyObject *(*__pyx_t_21)(PyObject *);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("precompute", 0);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":280
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":280
* def precompute(self, stats, SuffixArray sarray):
* cdef int i, l, N, max_pattern_len, i1, l1, i2, l2, i3, l3, ptr1, ptr2, ptr3, is_super, sent_count, max_rank
* cdef DataArray darray = sarray.darray # <<<<<<<<<<<<<<
@@ -31311,7 +31332,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
__Pyx_INCREF(((PyObject *)__pyx_v_sarray->darray));
__pyx_v_darray = __pyx_v_sarray->darray;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":285
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":285
* cdef _Trie_Node* node
*
* data = darray.data # <<<<<<<<<<<<<<
@@ -31321,7 +31342,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
__Pyx_INCREF(((PyObject *)__pyx_v_darray->data));
__pyx_v_data = __pyx_v_darray->data;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":287
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":287
* data = darray.data
*
* frequent_patterns = TrieMap(len(darray.id2word)) # <<<<<<<<<<<<<<
@@ -31345,7 +31366,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
__pyx_v_frequent_patterns = ((struct __pyx_obj_3_sa_TrieMap *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":288
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":288
*
* frequent_patterns = TrieMap(len(darray.id2word))
* super_frequent_patterns = TrieMap(len(darray.id2word)) # <<<<<<<<<<<<<<
@@ -31369,7 +31390,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
__pyx_v_super_frequent_patterns = ((struct __pyx_obj_3_sa_TrieMap *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":289
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":289
* frequent_patterns = TrieMap(len(darray.id2word))
* super_frequent_patterns = TrieMap(len(darray.id2word))
* collocations = TrieMap(len(darray.id2word)) # <<<<<<<<<<<<<<
@@ -31393,7 +31414,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
__pyx_v_collocations = ((struct __pyx_obj_3_sa_TrieMap *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":291
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":291
* collocations = TrieMap(len(darray.id2word))
*
* I_set = set() # <<<<<<<<<<<<<<
@@ -31405,7 +31426,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
__pyx_v_I_set = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":292
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":292
*
* I_set = set()
* J_set = set() # <<<<<<<<<<<<<<
@@ -31417,7 +31438,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
__pyx_v_J_set = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":293
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":293
* I_set = set()
* J_set = set()
* J2_set = set() # <<<<<<<<<<<<<<
@@ -31429,7 +31450,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
__pyx_v_J2_set = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":294
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":294
* J_set = set()
* J2_set = set()
* IJ_set = set() # <<<<<<<<<<<<<<
@@ -31441,7 +31462,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
__pyx_v_IJ_set = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":295
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":295
* J2_set = set()
* IJ_set = set()
* pattern_rank = {} # <<<<<<<<<<<<<<
@@ -31453,7 +31474,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
__pyx_v_pattern_rank = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":297
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":297
* pattern_rank = {}
*
* logger.info("Precomputing frequent intersections") # <<<<<<<<<<<<<<
@@ -31470,16 +31491,23 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":298
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":298
*
* logger.info("Precomputing frequent intersections")
* cdef float start_time = monitor_cpu() # <<<<<<<<<<<<<<
*
* max_pattern_len = 0
*/
- __pyx_v_start_time = __pyx_f_3_sa_monitor_cpu();
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_start_time = __pyx_t_4;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":300
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":300
* cdef float start_time = monitor_cpu()
*
* max_pattern_len = 0 # <<<<<<<<<<<<<<
@@ -31488,7 +31516,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
*/
__pyx_v_max_pattern_len = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":301
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":301
*
* max_pattern_len = 0
* for rank, (_, _, phrase) in enumerate(stats): # <<<<<<<<<<<<<<
@@ -31496,43 +31524,43 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
* break
*/
__Pyx_INCREF(__pyx_int_0);
- __pyx_t_1 = __pyx_int_0;
+ __pyx_t_3 = __pyx_int_0;
if (PyList_CheckExact(__pyx_v_stats) || PyTuple_CheckExact(__pyx_v_stats)) {
- __pyx_t_3 = __pyx_v_stats; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0;
- __pyx_t_4 = NULL;
+ __pyx_t_1 = __pyx_v_stats; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
+ __pyx_t_5 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_stats); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_stats); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
for (;;) {
- if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_3)) {
- if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
+ if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) {
+ if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_3)) {
- if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
+ } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_1)) {
+ if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
- __pyx_t_5 = __pyx_t_4(__pyx_t_3);
- if (unlikely(!__pyx_t_5)) {
+ __pyx_t_6 = __pyx_t_5(__pyx_t_1);
+ if (unlikely(!__pyx_t_6)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
- __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_6);
}
- if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
- PyObject* sequence = __pyx_t_5;
+ if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
+ PyObject* sequence = __pyx_t_6;
#if CYTHON_COMPILING_IN_CPYTHON
Py_ssize_t size = Py_SIZE(sequence);
#else
@@ -31545,81 +31573,81 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
- __pyx_t_8 = PyTuple_GET_ITEM(sequence, 2);
+ __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
+ __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2);
} else {
- __pyx_t_6 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
- __pyx_t_8 = PyList_GET_ITEM(sequence, 2);
+ __pyx_t_7 = PyList_GET_ITEM(sequence, 0);
+ __pyx_t_8 = PyList_GET_ITEM(sequence, 1);
+ __pyx_t_9 = PyList_GET_ITEM(sequence, 2);
}
- __Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx_t_8);
+ __Pyx_INCREF(__pyx_t_9);
#else
- __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_9 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
- index = 0; __pyx_t_6 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_6);
- index = 1; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed;
+ __pyx_t_10 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
+ index = 0; __pyx_t_7 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_7);
- index = 2; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L5_unpacking_failed;
+ index = 1; __pyx_t_8 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_8)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_8);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_10 = NULL;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ index = 2; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L5_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_9);
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 3) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = NULL;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L6_unpacking_done;
__pyx_L5_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_10 = NULL;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_11 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
{__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L6_unpacking_done:;
}
__Pyx_XDECREF(__pyx_v__);
- __pyx_v__ = __pyx_t_6;
- __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_v__);
__pyx_v__ = __pyx_t_7;
__pyx_t_7 = 0;
- __Pyx_XDECREF(__pyx_v_phrase);
- __pyx_v_phrase = __pyx_t_8;
+ __Pyx_DECREF(__pyx_v__);
+ __pyx_v__ = __pyx_t_8;
__pyx_t_8 = 0;
- __Pyx_INCREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_v_phrase);
+ __pyx_v_phrase = __pyx_t_9;
+ __pyx_t_9 = 0;
+ __Pyx_INCREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_v_rank);
- __pyx_v_rank = __pyx_t_1;
- __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1);
- __pyx_t_1 = __pyx_t_5;
- __pyx_t_5 = 0;
+ __pyx_v_rank = __pyx_t_3;
+ __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3);
+ __pyx_t_3 = __pyx_t_6;
+ __pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":302
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":302
* max_pattern_len = 0
* for rank, (_, _, phrase) in enumerate(stats):
* if rank >= self.precompute_rank: # <<<<<<<<<<<<<<
* break
* max_pattern_len = max(max_pattern_len, len(phrase))
*/
- __pyx_t_5 = PyInt_FromLong(__pyx_v_self->precompute_rank); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_8 = PyObject_RichCompare(__pyx_v_rank, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (__pyx_t_11) {
+ __pyx_t_6 = PyInt_FromLong(__pyx_v_self->precompute_rank); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_9 = PyObject_RichCompare(__pyx_v_rank, __pyx_t_6, Py_GE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ if (__pyx_t_12) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":303
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":303
* for rank, (_, _, phrase) in enumerate(stats):
* if rank >= self.precompute_rank:
* break # <<<<<<<<<<<<<<
@@ -31631,52 +31659,52 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
}
__pyx_L7:;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":304
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":304
* if rank >= self.precompute_rank:
* break
* max_pattern_len = max(max_pattern_len, len(phrase)) # <<<<<<<<<<<<<<
* frequent_patterns.insert(phrase)
* I_set.add(phrase)
*/
- __pyx_t_12 = PyObject_Length(__pyx_v_phrase); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_13 = __pyx_v_max_pattern_len;
- if ((__pyx_t_12 > __pyx_t_13)) {
- __pyx_t_14 = __pyx_t_12;
+ __pyx_t_13 = PyObject_Length(__pyx_v_phrase); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __pyx_v_max_pattern_len;
+ if ((__pyx_t_13 > __pyx_t_14)) {
+ __pyx_t_15 = __pyx_t_13;
} else {
- __pyx_t_14 = __pyx_t_13;
+ __pyx_t_15 = __pyx_t_14;
}
- __pyx_v_max_pattern_len = __pyx_t_14;
+ __pyx_v_max_pattern_len = __pyx_t_15;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":305
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":305
* break
* max_pattern_len = max(max_pattern_len, len(phrase))
* frequent_patterns.insert(phrase) # <<<<<<<<<<<<<<
* I_set.add(phrase)
* pattern_rank[phrase] = rank
*/
- __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_v_frequent_patterns), __pyx_n_s__insert); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_9 = PyObject_GetAttr(((PyObject *)__pyx_v_frequent_patterns), __pyx_n_s__insert); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(__pyx_v_phrase);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_phrase);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_phrase);
__Pyx_GIVEREF(__pyx_v_phrase);
- __pyx_t_7 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_8 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":306
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":306
* max_pattern_len = max(max_pattern_len, len(phrase))
* frequent_patterns.insert(phrase)
* I_set.add(phrase) # <<<<<<<<<<<<<<
* pattern_rank[phrase] = rank
* if rank < self.precompute_secondary_rank:
*/
- __pyx_t_15 = PySet_Add(__pyx_v_I_set, __pyx_v_phrase); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PySet_Add(__pyx_v_I_set, __pyx_v_phrase); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":307
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":307
* frequent_patterns.insert(phrase)
* I_set.add(phrase)
* pattern_rank[phrase] = rank # <<<<<<<<<<<<<<
@@ -31685,91 +31713,91 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
*/
if (PyDict_SetItem(((PyObject *)__pyx_v_pattern_rank), __pyx_v_phrase, __pyx_v_rank) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":308
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":308
* I_set.add(phrase)
* pattern_rank[phrase] = rank
* if rank < self.precompute_secondary_rank: # <<<<<<<<<<<<<<
* super_frequent_patterns.insert(phrase)
* J_set.add(phrase)
*/
- __pyx_t_7 = PyInt_FromLong(__pyx_v_self->precompute_secondary_rank); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_rank, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_11) {
+ __pyx_t_8 = PyInt_FromLong(__pyx_v_self->precompute_secondary_rank); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_6 = PyObject_RichCompare(__pyx_v_rank, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (__pyx_t_12) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":309
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":309
* pattern_rank[phrase] = rank
* if rank < self.precompute_secondary_rank:
* super_frequent_patterns.insert(phrase) # <<<<<<<<<<<<<<
* J_set.add(phrase)
*
*/
- __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_super_frequent_patterns), __pyx_n_s__insert); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_super_frequent_patterns), __pyx_n_s__insert); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(__pyx_v_phrase);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_phrase);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_phrase);
__Pyx_GIVEREF(__pyx_v_phrase);
- __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_9 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":310
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":310
* if rank < self.precompute_secondary_rank:
* super_frequent_patterns.insert(phrase)
* J_set.add(phrase) # <<<<<<<<<<<<<<
*
* queue = IntList(increment=1000)
*/
- __pyx_t_15 = PySet_Add(__pyx_v_J_set, __pyx_v_phrase); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PySet_Add(__pyx_v_J_set, __pyx_v_phrase); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L8;
}
__pyx_L8:;
}
__pyx_L4_break:;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":312
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":312
* J_set.add(phrase)
*
* queue = IntList(increment=1000) # <<<<<<<<<<<<<<
*
* logger.info(" Computing inverted indexes...")
*/
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__increment), __pyx_int_1000) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_v_queue = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_3);
- __pyx_t_3 = 0;
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+ if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__increment), __pyx_int_1000) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+ __pyx_v_queue = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
+ __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":314
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":314
* queue = IntList(increment=1000)
*
* logger.info(" Computing inverted indexes...") # <<<<<<<<<<<<<<
* N = len(data)
* for i from 0 <= i < N:
*/
- __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_75), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_75), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":315
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":315
*
* logger.info(" Computing inverted indexes...")
* N = len(data) # <<<<<<<<<<<<<<
@@ -31779,17 +31807,17 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
__pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_data)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_N = __pyx_t_2;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":316
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":316
* logger.info(" Computing inverted indexes...")
* N = len(data)
* for i from 0 <= i < N: # <<<<<<<<<<<<<<
* sa_word_id = data.arr[i]
* if sa_word_id == 1:
*/
- __pyx_t_13 = __pyx_v_N;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_13; __pyx_v_i++) {
+ __pyx_t_14 = __pyx_v_N;
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_14; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":317
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":317
* N = len(data)
* for i from 0 <= i < N:
* sa_word_id = data.arr[i] # <<<<<<<<<<<<<<
@@ -31798,17 +31826,17 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
*/
__pyx_v_sa_word_id = (__pyx_v_data->arr[__pyx_v_i]);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":318
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":318
* for i from 0 <= i < N:
* sa_word_id = data.arr[i]
* if sa_word_id == 1: # <<<<<<<<<<<<<<
* queue._append(-1)
* else:
*/
- __pyx_t_11 = (__pyx_v_sa_word_id == 1);
- if (__pyx_t_11) {
+ __pyx_t_12 = (__pyx_v_sa_word_id == 1);
+ if (__pyx_t_12) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":319
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":319
* sa_word_id = data.arr[i]
* if sa_word_id == 1:
* queue._append(-1) # <<<<<<<<<<<<<<
@@ -31820,17 +31848,17 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":321
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":321
* queue._append(-1)
* else:
* for l from 1 <= l <= max_pattern_len: # <<<<<<<<<<<<<<
* node = frequent_patterns._contains(data.arr+i, l)
* if node == NULL:
*/
- __pyx_t_16 = __pyx_v_max_pattern_len;
- for (__pyx_v_l = 1; __pyx_v_l <= __pyx_t_16; __pyx_v_l++) {
+ __pyx_t_17 = __pyx_v_max_pattern_len;
+ for (__pyx_v_l = 1; __pyx_v_l <= __pyx_t_17; __pyx_v_l++) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":322
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":322
* else:
* for l from 1 <= l <= max_pattern_len:
* node = frequent_patterns._contains(data.arr+i, l) # <<<<<<<<<<<<<<
@@ -31839,17 +31867,17 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
*/
__pyx_v_node = ((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_frequent_patterns->__pyx_vtab)->_contains(__pyx_v_frequent_patterns, (__pyx_v_data->arr + __pyx_v_i), __pyx_v_l);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":323
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":323
* for l from 1 <= l <= max_pattern_len:
* node = frequent_patterns._contains(data.arr+i, l)
* if node == NULL: # <<<<<<<<<<<<<<
* break
* queue._append(i)
*/
- __pyx_t_11 = (__pyx_v_node == NULL);
- if (__pyx_t_11) {
+ __pyx_t_12 = (__pyx_v_node == NULL);
+ if (__pyx_t_12) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":324
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":324
* node = frequent_patterns._contains(data.arr+i, l)
* if node == NULL:
* break # <<<<<<<<<<<<<<
@@ -31861,7 +31889,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
}
__pyx_L14:;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":325
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":325
* if node == NULL:
* break
* queue._append(i) # <<<<<<<<<<<<<<
@@ -31870,7 +31898,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_queue->__pyx_vtab)->_append(__pyx_v_queue, __pyx_v_i);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":326
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":326
* break
* queue._append(i)
* queue._append(l) # <<<<<<<<<<<<<<
@@ -31879,40 +31907,40 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_queue->__pyx_vtab)->_append(__pyx_v_queue, __pyx_v_l);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":327
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":327
* queue._append(i)
* queue._append(l)
* trie_node_data_append(node, i) # <<<<<<<<<<<<<<
*
* logger.info(" Computing collocations...")
*/
- __pyx_t_3 = __pyx_f_3_sa_trie_node_data_append(__pyx_v_node, __pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_1 = __pyx_f_3_sa_trie_node_data_append(__pyx_v_node, __pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
__pyx_L13_break:;
}
__pyx_L11:;
}
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":329
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":329
* trie_node_data_append(node, i)
*
* logger.info(" Computing collocations...") # <<<<<<<<<<<<<<
* N = len(queue)
* ptr1 = 0
*/
- __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_77), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_77), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":330
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":330
*
* logger.info(" Computing collocations...")
* N = len(queue) # <<<<<<<<<<<<<<
@@ -31922,7 +31950,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
__pyx_t_2 = PyObject_Length(((PyObject *)__pyx_v_queue)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_N = __pyx_t_2;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":331
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":331
* logger.info(" Computing collocations...")
* N = len(queue)
* ptr1 = 0 # <<<<<<<<<<<<<<
@@ -31931,7 +31959,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
*/
__pyx_v_ptr1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":332
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":332
* N = len(queue)
* ptr1 = 0
* sent_count = 0 # <<<<<<<<<<<<<<
@@ -31940,7 +31968,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
*/
__pyx_v_sent_count = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":333
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":333
* ptr1 = 0
* sent_count = 0
* while ptr1 < N: # main loop # <<<<<<<<<<<<<<
@@ -31948,10 +31976,10 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
* if i1 > -1:
*/
while (1) {
- __pyx_t_11 = (__pyx_v_ptr1 < __pyx_v_N);
- if (!__pyx_t_11) break;
+ __pyx_t_12 = (__pyx_v_ptr1 < __pyx_v_N);
+ if (!__pyx_t_12) break;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":334
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":334
* sent_count = 0
* while ptr1 < N: # main loop
* i1 = queue.arr[ptr1] # <<<<<<<<<<<<<<
@@ -31960,17 +31988,17 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
*/
__pyx_v_i1 = (__pyx_v_queue->arr[__pyx_v_ptr1]);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":335
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":335
* while ptr1 < N: # main loop
* i1 = queue.arr[ptr1]
* if i1 > -1: # <<<<<<<<<<<<<<
* l1 = queue.arr[ptr1+1]
* ptr2 = ptr1 + 2
*/
- __pyx_t_11 = (__pyx_v_i1 > -1);
- if (__pyx_t_11) {
+ __pyx_t_12 = (__pyx_v_i1 > -1);
+ if (__pyx_t_12) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":336
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":336
* i1 = queue.arr[ptr1]
* if i1 > -1:
* l1 = queue.arr[ptr1+1] # <<<<<<<<<<<<<<
@@ -31979,7 +32007,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
*/
__pyx_v_l1 = (__pyx_v_queue->arr[(__pyx_v_ptr1 + 1)]);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":337
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":337
* if i1 > -1:
* l1 = queue.arr[ptr1+1]
* ptr2 = ptr1 + 2 # <<<<<<<<<<<<<<
@@ -31988,7 +32016,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
*/
__pyx_v_ptr2 = (__pyx_v_ptr1 + 2);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":338
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":338
* l1 = queue.arr[ptr1+1]
* ptr2 = ptr1 + 2
* while ptr2 < N: # <<<<<<<<<<<<<<
@@ -31996,10 +32024,10 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
* if i2 == -1 or i2 - i1 >= self.train_max_initial_size:
*/
while (1) {
- __pyx_t_11 = (__pyx_v_ptr2 < __pyx_v_N);
- if (!__pyx_t_11) break;
+ __pyx_t_12 = (__pyx_v_ptr2 < __pyx_v_N);
+ if (!__pyx_t_12) break;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":339
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":339
* ptr2 = ptr1 + 2
* while ptr2 < N:
* i2 = queue.arr[ptr2] # <<<<<<<<<<<<<<
@@ -32008,23 +32036,23 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
*/
__pyx_v_i2 = (__pyx_v_queue->arr[__pyx_v_ptr2]);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":340
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":340
* while ptr2 < N:
* i2 = queue.arr[ptr2]
* if i2 == -1 or i2 - i1 >= self.train_max_initial_size: # <<<<<<<<<<<<<<
* break
* l2 = queue.arr[ptr2+1]
*/
- __pyx_t_11 = (__pyx_v_i2 == -1);
- if (!__pyx_t_11) {
- __pyx_t_17 = ((__pyx_v_i2 - __pyx_v_i1) >= __pyx_v_self->train_max_initial_size);
- __pyx_t_18 = __pyx_t_17;
+ __pyx_t_12 = (__pyx_v_i2 == -1);
+ if (!__pyx_t_12) {
+ __pyx_t_18 = ((__pyx_v_i2 - __pyx_v_i1) >= __pyx_v_self->train_max_initial_size);
+ __pyx_t_19 = __pyx_t_18;
} else {
- __pyx_t_18 = __pyx_t_11;
+ __pyx_t_19 = __pyx_t_12;
}
- if (__pyx_t_18) {
+ if (__pyx_t_19) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":341
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":341
* i2 = queue.arr[ptr2]
* if i2 == -1 or i2 - i1 >= self.train_max_initial_size:
* break # <<<<<<<<<<<<<<
@@ -32036,7 +32064,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
}
__pyx_L20:;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":342
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":342
* if i2 == -1 or i2 - i1 >= self.train_max_initial_size:
* break
* l2 = queue.arr[ptr2+1] # <<<<<<<<<<<<<<
@@ -32045,45 +32073,45 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
*/
__pyx_v_l2 = (__pyx_v_queue->arr[(__pyx_v_ptr2 + 1)]);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":343
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":343
* break
* l2 = queue.arr[ptr2+1]
* if (i2 - i1 - l1 >= self.train_min_gap_size and # <<<<<<<<<<<<<<
* i2 + l2 - i1 <= self.train_max_initial_size and
* l1+l2+1 <= self.max_length):
*/
- __pyx_t_18 = (((__pyx_v_i2 - __pyx_v_i1) - __pyx_v_l1) >= __pyx_v_self->train_min_gap_size);
- if (__pyx_t_18) {
+ __pyx_t_19 = (((__pyx_v_i2 - __pyx_v_i1) - __pyx_v_l1) >= __pyx_v_self->train_min_gap_size);
+ if (__pyx_t_19) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":344
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":344
* l2 = queue.arr[ptr2+1]
* if (i2 - i1 - l1 >= self.train_min_gap_size and
* i2 + l2 - i1 <= self.train_max_initial_size and # <<<<<<<<<<<<<<
* l1+l2+1 <= self.max_length):
* node = collocations._insert(data.arr+i1, l1)
*/
- __pyx_t_11 = (((__pyx_v_i2 + __pyx_v_l2) - __pyx_v_i1) <= __pyx_v_self->train_max_initial_size);
- if (__pyx_t_11) {
+ __pyx_t_12 = (((__pyx_v_i2 + __pyx_v_l2) - __pyx_v_i1) <= __pyx_v_self->train_max_initial_size);
+ if (__pyx_t_12) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":345
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":345
* if (i2 - i1 - l1 >= self.train_min_gap_size and
* i2 + l2 - i1 <= self.train_max_initial_size and
* l1+l2+1 <= self.max_length): # <<<<<<<<<<<<<<
* node = collocations._insert(data.arr+i1, l1)
* node = trie_insert(node, -1)
*/
- __pyx_t_17 = (((__pyx_v_l1 + __pyx_v_l2) + 1) <= __pyx_v_self->max_length);
- __pyx_t_19 = __pyx_t_17;
+ __pyx_t_18 = (((__pyx_v_l1 + __pyx_v_l2) + 1) <= __pyx_v_self->max_length);
+ __pyx_t_20 = __pyx_t_18;
} else {
- __pyx_t_19 = __pyx_t_11;
+ __pyx_t_20 = __pyx_t_12;
}
- __pyx_t_11 = __pyx_t_19;
+ __pyx_t_12 = __pyx_t_20;
} else {
- __pyx_t_11 = __pyx_t_18;
+ __pyx_t_12 = __pyx_t_19;
}
- if (__pyx_t_11) {
+ if (__pyx_t_12) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":346
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":346
* i2 + l2 - i1 <= self.train_max_initial_size and
* l1+l2+1 <= self.max_length):
* node = collocations._insert(data.arr+i1, l1) # <<<<<<<<<<<<<<
@@ -32092,7 +32120,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
*/
__pyx_v_node = ((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_collocations->__pyx_vtab)->_insert(__pyx_v_collocations, (__pyx_v_data->arr + __pyx_v_i1), __pyx_v_l1);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":347
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":347
* l1+l2+1 <= self.max_length):
* node = collocations._insert(data.arr+i1, l1)
* node = trie_insert(node, -1) # <<<<<<<<<<<<<<
@@ -32101,17 +32129,17 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
*/
__pyx_v_node = __pyx_f_3_sa_trie_insert(__pyx_v_node, -1);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":348
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":348
* node = collocations._insert(data.arr+i1, l1)
* node = trie_insert(node, -1)
* for i from i2 <= i < i2+l2: # <<<<<<<<<<<<<<
* node = trie_insert(node, data.arr[i])
* trie_node_data_append(node, i1)
*/
- __pyx_t_13 = (__pyx_v_i2 + __pyx_v_l2);
- for (__pyx_v_i = __pyx_v_i2; __pyx_v_i < __pyx_t_13; __pyx_v_i++) {
+ __pyx_t_14 = (__pyx_v_i2 + __pyx_v_l2);
+ for (__pyx_v_i = __pyx_v_i2; __pyx_v_i < __pyx_t_14; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":349
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":349
* node = trie_insert(node, -1)
* for i from i2 <= i < i2+l2:
* node = trie_insert(node, data.arr[i]) # <<<<<<<<<<<<<<
@@ -32121,49 +32149,49 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
__pyx_v_node = __pyx_f_3_sa_trie_insert(__pyx_v_node, (__pyx_v_data->arr[__pyx_v_i]));
}
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":350
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":350
* for i from i2 <= i < i2+l2:
* node = trie_insert(node, data.arr[i])
* trie_node_data_append(node, i1) # <<<<<<<<<<<<<<
* trie_node_data_append(node, i2)
* if super_frequent_patterns._contains(data.arr+i2, l2) != NULL:
*/
- __pyx_t_3 = __pyx_f_3_sa_trie_node_data_append(__pyx_v_node, __pyx_v_i1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_1 = __pyx_f_3_sa_trie_node_data_append(__pyx_v_node, __pyx_v_i1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":351
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":351
* node = trie_insert(node, data.arr[i])
* trie_node_data_append(node, i1)
* trie_node_data_append(node, i2) # <<<<<<<<<<<<<<
* if super_frequent_patterns._contains(data.arr+i2, l2) != NULL:
* if super_frequent_patterns._contains(data.arr+i1, l1) != NULL:
*/
- __pyx_t_3 = __pyx_f_3_sa_trie_node_data_append(__pyx_v_node, __pyx_v_i2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_1 = __pyx_f_3_sa_trie_node_data_append(__pyx_v_node, __pyx_v_i2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":352
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":352
* trie_node_data_append(node, i1)
* trie_node_data_append(node, i2)
* if super_frequent_patterns._contains(data.arr+i2, l2) != NULL: # <<<<<<<<<<<<<<
* if super_frequent_patterns._contains(data.arr+i1, l1) != NULL:
* is_super = 1
*/
- __pyx_t_11 = (((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_super_frequent_patterns->__pyx_vtab)->_contains(__pyx_v_super_frequent_patterns, (__pyx_v_data->arr + __pyx_v_i2), __pyx_v_l2) != NULL);
- if (__pyx_t_11) {
+ __pyx_t_12 = (((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_super_frequent_patterns->__pyx_vtab)->_contains(__pyx_v_super_frequent_patterns, (__pyx_v_data->arr + __pyx_v_i2), __pyx_v_l2) != NULL);
+ if (__pyx_t_12) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":353
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":353
* trie_node_data_append(node, i2)
* if super_frequent_patterns._contains(data.arr+i2, l2) != NULL:
* if super_frequent_patterns._contains(data.arr+i1, l1) != NULL: # <<<<<<<<<<<<<<
* is_super = 1
* else:
*/
- __pyx_t_11 = (((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_super_frequent_patterns->__pyx_vtab)->_contains(__pyx_v_super_frequent_patterns, (__pyx_v_data->arr + __pyx_v_i1), __pyx_v_l1) != NULL);
- if (__pyx_t_11) {
+ __pyx_t_12 = (((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_super_frequent_patterns->__pyx_vtab)->_contains(__pyx_v_super_frequent_patterns, (__pyx_v_data->arr + __pyx_v_i1), __pyx_v_l1) != NULL);
+ if (__pyx_t_12) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":354
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":354
* if super_frequent_patterns._contains(data.arr+i2, l2) != NULL:
* if super_frequent_patterns._contains(data.arr+i1, l1) != NULL:
* is_super = 1 # <<<<<<<<<<<<<<
@@ -32175,7 +32203,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":356
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":356
* is_super = 1
* else:
* is_super = 0 # <<<<<<<<<<<<<<
@@ -32186,7 +32214,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
}
__pyx_L25:;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":357
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":357
* else:
* is_super = 0
* ptr3 = ptr2 + 2 # <<<<<<<<<<<<<<
@@ -32195,7 +32223,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
*/
__pyx_v_ptr3 = (__pyx_v_ptr2 + 2);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":358
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":358
* is_super = 0
* ptr3 = ptr2 + 2
* while ptr3 < N: # <<<<<<<<<<<<<<
@@ -32203,10 +32231,10 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
* if i3 == -1 or i3 - i1 >= self.train_max_initial_size:
*/
while (1) {
- __pyx_t_11 = (__pyx_v_ptr3 < __pyx_v_N);
- if (!__pyx_t_11) break;
+ __pyx_t_12 = (__pyx_v_ptr3 < __pyx_v_N);
+ if (!__pyx_t_12) break;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":359
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":359
* ptr3 = ptr2 + 2
* while ptr3 < N:
* i3 = queue.arr[ptr3] # <<<<<<<<<<<<<<
@@ -32215,23 +32243,23 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
*/
__pyx_v_i3 = (__pyx_v_queue->arr[__pyx_v_ptr3]);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":360
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":360
* while ptr3 < N:
* i3 = queue.arr[ptr3]
* if i3 == -1 or i3 - i1 >= self.train_max_initial_size: # <<<<<<<<<<<<<<
* break
* l3 = queue.arr[ptr3+1]
*/
- __pyx_t_11 = (__pyx_v_i3 == -1);
- if (!__pyx_t_11) {
- __pyx_t_18 = ((__pyx_v_i3 - __pyx_v_i1) >= __pyx_v_self->train_max_initial_size);
- __pyx_t_19 = __pyx_t_18;
+ __pyx_t_12 = (__pyx_v_i3 == -1);
+ if (!__pyx_t_12) {
+ __pyx_t_19 = ((__pyx_v_i3 - __pyx_v_i1) >= __pyx_v_self->train_max_initial_size);
+ __pyx_t_20 = __pyx_t_19;
} else {
- __pyx_t_19 = __pyx_t_11;
+ __pyx_t_20 = __pyx_t_12;
}
- if (__pyx_t_19) {
+ if (__pyx_t_20) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":361
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":361
* i3 = queue.arr[ptr3]
* if i3 == -1 or i3 - i1 >= self.train_max_initial_size:
* break # <<<<<<<<<<<<<<
@@ -32243,7 +32271,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
}
__pyx_L28:;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":362
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":362
* if i3 == -1 or i3 - i1 >= self.train_max_initial_size:
* break
* l3 = queue.arr[ptr3+1] # <<<<<<<<<<<<<<
@@ -32252,45 +32280,45 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
*/
__pyx_v_l3 = (__pyx_v_queue->arr[(__pyx_v_ptr3 + 1)]);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":363
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":363
* break
* l3 = queue.arr[ptr3+1]
* if (i3 - i2 - l2 >= self.train_min_gap_size and # <<<<<<<<<<<<<<
* i3 + l3 - i1 <= self.train_max_initial_size and
* l1+l2+l3+2 <= self.max_length):
*/
- __pyx_t_19 = (((__pyx_v_i3 - __pyx_v_i2) - __pyx_v_l2) >= __pyx_v_self->train_min_gap_size);
- if (__pyx_t_19) {
+ __pyx_t_20 = (((__pyx_v_i3 - __pyx_v_i2) - __pyx_v_l2) >= __pyx_v_self->train_min_gap_size);
+ if (__pyx_t_20) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":364
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":364
* l3 = queue.arr[ptr3+1]
* if (i3 - i2 - l2 >= self.train_min_gap_size and
* i3 + l3 - i1 <= self.train_max_initial_size and # <<<<<<<<<<<<<<
* l1+l2+l3+2 <= self.max_length):
* if is_super or super_frequent_patterns._contains(data.arr+i3, l3) != NULL:
*/
- __pyx_t_11 = (((__pyx_v_i3 + __pyx_v_l3) - __pyx_v_i1) <= __pyx_v_self->train_max_initial_size);
- if (__pyx_t_11) {
+ __pyx_t_12 = (((__pyx_v_i3 + __pyx_v_l3) - __pyx_v_i1) <= __pyx_v_self->train_max_initial_size);
+ if (__pyx_t_12) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":365
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":365
* if (i3 - i2 - l2 >= self.train_min_gap_size and
* i3 + l3 - i1 <= self.train_max_initial_size and
* l1+l2+l3+2 <= self.max_length): # <<<<<<<<<<<<<<
* if is_super or super_frequent_patterns._contains(data.arr+i3, l3) != NULL:
* node = collocations._insert(data.arr+i1, l1)
*/
- __pyx_t_18 = ((((__pyx_v_l1 + __pyx_v_l2) + __pyx_v_l3) + 2) <= __pyx_v_self->max_length);
- __pyx_t_17 = __pyx_t_18;
+ __pyx_t_19 = ((((__pyx_v_l1 + __pyx_v_l2) + __pyx_v_l3) + 2) <= __pyx_v_self->max_length);
+ __pyx_t_18 = __pyx_t_19;
} else {
- __pyx_t_17 = __pyx_t_11;
+ __pyx_t_18 = __pyx_t_12;
}
- __pyx_t_11 = __pyx_t_17;
+ __pyx_t_12 = __pyx_t_18;
} else {
- __pyx_t_11 = __pyx_t_19;
+ __pyx_t_12 = __pyx_t_20;
}
- if (__pyx_t_11) {
+ if (__pyx_t_12) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":366
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":366
* i3 + l3 - i1 <= self.train_max_initial_size and
* l1+l2+l3+2 <= self.max_length):
* if is_super or super_frequent_patterns._contains(data.arr+i3, l3) != NULL: # <<<<<<<<<<<<<<
@@ -32298,14 +32326,14 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
* node = trie_insert(node, -1)
*/
if (!__pyx_v_is_super) {
- __pyx_t_11 = (((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_super_frequent_patterns->__pyx_vtab)->_contains(__pyx_v_super_frequent_patterns, (__pyx_v_data->arr + __pyx_v_i3), __pyx_v_l3) != NULL);
- __pyx_t_19 = __pyx_t_11;
+ __pyx_t_12 = (((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_super_frequent_patterns->__pyx_vtab)->_contains(__pyx_v_super_frequent_patterns, (__pyx_v_data->arr + __pyx_v_i3), __pyx_v_l3) != NULL);
+ __pyx_t_20 = __pyx_t_12;
} else {
- __pyx_t_19 = __pyx_v_is_super;
+ __pyx_t_20 = __pyx_v_is_super;
}
- if (__pyx_t_19) {
+ if (__pyx_t_20) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":367
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":367
* l1+l2+l3+2 <= self.max_length):
* if is_super or super_frequent_patterns._contains(data.arr+i3, l3) != NULL:
* node = collocations._insert(data.arr+i1, l1) # <<<<<<<<<<<<<<
@@ -32314,7 +32342,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
*/
__pyx_v_node = ((struct __pyx_vtabstruct_3_sa_TrieMap *)__pyx_v_collocations->__pyx_vtab)->_insert(__pyx_v_collocations, (__pyx_v_data->arr + __pyx_v_i1), __pyx_v_l1);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":368
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":368
* if is_super or super_frequent_patterns._contains(data.arr+i3, l3) != NULL:
* node = collocations._insert(data.arr+i1, l1)
* node = trie_insert(node, -1) # <<<<<<<<<<<<<<
@@ -32323,17 +32351,17 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
*/
__pyx_v_node = __pyx_f_3_sa_trie_insert(__pyx_v_node, -1);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":369
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":369
* node = collocations._insert(data.arr+i1, l1)
* node = trie_insert(node, -1)
* for i from i2 <= i < i2+l2: # <<<<<<<<<<<<<<
* node = trie_insert(node, data.arr[i])
* node = trie_insert(node, -1)
*/
- __pyx_t_13 = (__pyx_v_i2 + __pyx_v_l2);
- for (__pyx_v_i = __pyx_v_i2; __pyx_v_i < __pyx_t_13; __pyx_v_i++) {
+ __pyx_t_14 = (__pyx_v_i2 + __pyx_v_l2);
+ for (__pyx_v_i = __pyx_v_i2; __pyx_v_i < __pyx_t_14; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":370
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":370
* node = trie_insert(node, -1)
* for i from i2 <= i < i2+l2:
* node = trie_insert(node, data.arr[i]) # <<<<<<<<<<<<<<
@@ -32343,7 +32371,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
__pyx_v_node = __pyx_f_3_sa_trie_insert(__pyx_v_node, (__pyx_v_data->arr[__pyx_v_i]));
}
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":371
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":371
* for i from i2 <= i < i2+l2:
* node = trie_insert(node, data.arr[i])
* node = trie_insert(node, -1) # <<<<<<<<<<<<<<
@@ -32352,17 +32380,17 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
*/
__pyx_v_node = __pyx_f_3_sa_trie_insert(__pyx_v_node, -1);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":372
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":372
* node = trie_insert(node, data.arr[i])
* node = trie_insert(node, -1)
* for i from i3 <= i < i3+l3: # <<<<<<<<<<<<<<
* node = trie_insert(node, data.arr[i])
* trie_node_data_append(node, i1)
*/
- __pyx_t_13 = (__pyx_v_i3 + __pyx_v_l3);
- for (__pyx_v_i = __pyx_v_i3; __pyx_v_i < __pyx_t_13; __pyx_v_i++) {
+ __pyx_t_14 = (__pyx_v_i3 + __pyx_v_l3);
+ for (__pyx_v_i = __pyx_v_i3; __pyx_v_i < __pyx_t_14; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":373
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":373
* node = trie_insert(node, -1)
* for i from i3 <= i < i3+l3:
* node = trie_insert(node, data.arr[i]) # <<<<<<<<<<<<<<
@@ -32372,38 +32400,38 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
__pyx_v_node = __pyx_f_3_sa_trie_insert(__pyx_v_node, (__pyx_v_data->arr[__pyx_v_i]));
}
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":374
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":374
* for i from i3 <= i < i3+l3:
* node = trie_insert(node, data.arr[i])
* trie_node_data_append(node, i1) # <<<<<<<<<<<<<<
* trie_node_data_append(node, i2)
* trie_node_data_append(node, i3)
*/
- __pyx_t_3 = __pyx_f_3_sa_trie_node_data_append(__pyx_v_node, __pyx_v_i1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_1 = __pyx_f_3_sa_trie_node_data_append(__pyx_v_node, __pyx_v_i1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":375
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":375
* node = trie_insert(node, data.arr[i])
* trie_node_data_append(node, i1)
* trie_node_data_append(node, i2) # <<<<<<<<<<<<<<
* trie_node_data_append(node, i3)
* ptr3 = ptr3 + 2
*/
- __pyx_t_3 = __pyx_f_3_sa_trie_node_data_append(__pyx_v_node, __pyx_v_i2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_1 = __pyx_f_3_sa_trie_node_data_append(__pyx_v_node, __pyx_v_i2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":376
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":376
* trie_node_data_append(node, i1)
* trie_node_data_append(node, i2)
* trie_node_data_append(node, i3) # <<<<<<<<<<<<<<
* ptr3 = ptr3 + 2
* ptr2 = ptr2 + 2
*/
- __pyx_t_3 = __pyx_f_3_sa_trie_node_data_append(__pyx_v_node, __pyx_v_i3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_1 = __pyx_f_3_sa_trie_node_data_append(__pyx_v_node, __pyx_v_i3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L30;
}
__pyx_L30:;
@@ -32411,7 +32439,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
}
__pyx_L29:;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":377
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":377
* trie_node_data_append(node, i2)
* trie_node_data_append(node, i3)
* ptr3 = ptr3 + 2 # <<<<<<<<<<<<<<
@@ -32428,7 +32456,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
}
__pyx_L21:;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":378
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":378
* trie_node_data_append(node, i3)
* ptr3 = ptr3 + 2
* ptr2 = ptr2 + 2 # <<<<<<<<<<<<<<
@@ -32439,7 +32467,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
}
__pyx_L19_break:;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":379
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":379
* ptr3 = ptr3 + 2
* ptr2 = ptr2 + 2
* ptr1 = ptr1 + 2 # <<<<<<<<<<<<<<
@@ -32451,7 +32479,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":381
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":381
* ptr1 = ptr1 + 2
* else:
* sent_count = sent_count + 1 # <<<<<<<<<<<<<<
@@ -32460,48 +32488,48 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
*/
__pyx_v_sent_count = (__pyx_v_sent_count + 1);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":382
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":382
* else:
* sent_count = sent_count + 1
* if sent_count % 10000 == 0: # <<<<<<<<<<<<<<
* logger.debug(" %d sentences", sent_count)
* ptr1 = ptr1 + 1
*/
- __pyx_t_19 = (__Pyx_mod_long(__pyx_v_sent_count, 10000) == 0);
- if (__pyx_t_19) {
+ __pyx_t_20 = (__Pyx_mod_long(__pyx_v_sent_count, 10000) == 0);
+ if (__pyx_t_20) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":383
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":383
* sent_count = sent_count + 1
* if sent_count % 10000 == 0:
* logger.debug(" %d sentences", sent_count) # <<<<<<<<<<<<<<
* ptr1 = ptr1 + 1
*
*/
- __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__debug); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyInt_FromLong(__pyx_v_sent_count); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__debug); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_sent_count); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_78));
- PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_kp_s_78));
+ PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_kp_s_78));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_78));
- PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
+ PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L35;
}
__pyx_L35:;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":384
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":384
* if sent_count % 10000 == 0:
* logger.debug(" %d sentences", sent_count)
* ptr1 = ptr1 + 1 # <<<<<<<<<<<<<<
@@ -32513,59 +32541,59 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
__pyx_L17:;
}
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":386
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":386
* ptr1 = ptr1 + 1
*
* self.precomputed_collocations = collocations.toMap(False) # <<<<<<<<<<<<<<
* self.precomputed_index = frequent_patterns.toMap(True)
*
*/
- __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_collocations), __pyx_n_s__toMap); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_8 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_collocations), __pyx_n_s__toMap); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_8);
- __pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __Pyx_GIVEREF(__pyx_t_8);
+ __pyx_t_9 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9);
+ __Pyx_GIVEREF(__pyx_t_9);
+ __pyx_t_9 = 0;
+ __pyx_t_9 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+ __Pyx_GIVEREF(__pyx_t_9);
__Pyx_GOTREF(__pyx_v_self->precomputed_collocations);
__Pyx_DECREF(__pyx_v_self->precomputed_collocations);
- __pyx_v_self->precomputed_collocations = __pyx_t_8;
- __pyx_t_8 = 0;
+ __pyx_v_self->precomputed_collocations = __pyx_t_9;
+ __pyx_t_9 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":387
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":387
*
* self.precomputed_collocations = collocations.toMap(False)
* self.precomputed_index = frequent_patterns.toMap(True) # <<<<<<<<<<<<<<
*
* x = 0
*/
- __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_v_frequent_patterns), __pyx_n_s__toMap); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyObject_GetAttr(((PyObject *)__pyx_v_frequent_patterns), __pyx_n_s__toMap); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_3 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+ __Pyx_GIVEREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_v_self->precomputed_index);
__Pyx_DECREF(__pyx_v_self->precomputed_index);
- __pyx_v_self->precomputed_index = __pyx_t_1;
- __pyx_t_1 = 0;
+ __pyx_v_self->precomputed_index = __pyx_t_3;
+ __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":389
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":389
* self.precomputed_index = frequent_patterns.toMap(True)
*
* x = 0 # <<<<<<<<<<<<<<
@@ -32575,59 +32603,59 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
__Pyx_INCREF(__pyx_int_0);
__pyx_v_x = __pyx_int_0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":390
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":390
*
* x = 0
* for pattern1 in J_set: # <<<<<<<<<<<<<<
* for pattern2 in J_set:
* if len(pattern1) + len(pattern2) + 1 < self.max_length:
*/
- __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_J_set)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
+ __pyx_t_3 = PyObject_GetIter(((PyObject *)__pyx_v_J_set)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
for (;;) {
{
- __pyx_t_3 = __pyx_t_4(__pyx_t_1);
- if (unlikely(!__pyx_t_3)) {
+ __pyx_t_1 = __pyx_t_5(__pyx_t_3);
+ if (unlikely(!__pyx_t_1)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
- __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GOTREF(__pyx_t_1);
}
__Pyx_XDECREF(__pyx_v_pattern1);
- __pyx_v_pattern1 = __pyx_t_3;
- __pyx_t_3 = 0;
+ __pyx_v_pattern1 = __pyx_t_1;
+ __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":391
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":391
* x = 0
* for pattern1 in J_set:
* for pattern2 in J_set: # <<<<<<<<<<<<<<
* if len(pattern1) + len(pattern2) + 1 < self.max_length:
* combined_pattern = pattern1 + (-1,) + pattern2
*/
- __pyx_t_3 = PyObject_GetIter(((PyObject *)__pyx_v_J_set)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_20 = Py_TYPE(__pyx_t_3)->tp_iternext;
+ __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_J_set)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_21 = Py_TYPE(__pyx_t_1)->tp_iternext;
for (;;) {
{
- __pyx_t_8 = __pyx_t_20(__pyx_t_3);
- if (unlikely(!__pyx_t_8)) {
+ __pyx_t_9 = __pyx_t_21(__pyx_t_1);
+ if (unlikely(!__pyx_t_9)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
- __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_GOTREF(__pyx_t_9);
}
__Pyx_XDECREF(__pyx_v_pattern2);
- __pyx_v_pattern2 = __pyx_t_8;
- __pyx_t_8 = 0;
+ __pyx_v_pattern2 = __pyx_t_9;
+ __pyx_t_9 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":392
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":392
* for pattern1 in J_set:
* for pattern2 in J_set:
* if len(pattern1) + len(pattern2) + 1 < self.max_length: # <<<<<<<<<<<<<<
@@ -32635,217 +32663,217 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
* J2_set.add(combined_pattern)
*/
__pyx_t_2 = PyObject_Length(__pyx_v_pattern1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_14 = PyObject_Length(__pyx_v_pattern2); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_19 = (((__pyx_t_2 + __pyx_t_14) + 1) < __pyx_v_self->max_length);
- if (__pyx_t_19) {
+ __pyx_t_15 = PyObject_Length(__pyx_v_pattern2); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_20 = (((__pyx_t_2 + __pyx_t_15) + 1) < __pyx_v_self->max_length);
+ if (__pyx_t_20) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":393
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":393
* for pattern2 in J_set:
* if len(pattern1) + len(pattern2) + 1 < self.max_length:
* combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<<
* J2_set.add(combined_pattern)
*
*/
- __pyx_t_8 = PyNumber_Add(__pyx_v_pattern1, ((PyObject *)__pyx_k_tuple_79)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyNumber_Add(__pyx_v_pattern1, ((PyObject *)__pyx_k_tuple_79)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_8 = PyNumber_Add(__pyx_t_9, __pyx_v_pattern2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_7 = PyNumber_Add(__pyx_t_8, __pyx_v_pattern2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_XDECREF(__pyx_v_combined_pattern);
- __pyx_v_combined_pattern = __pyx_t_7;
- __pyx_t_7 = 0;
+ __pyx_v_combined_pattern = __pyx_t_8;
+ __pyx_t_8 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":394
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":394
* if len(pattern1) + len(pattern2) + 1 < self.max_length:
* combined_pattern = pattern1 + (-1,) + pattern2
* J2_set.add(combined_pattern) # <<<<<<<<<<<<<<
*
* for pattern1 in I_set:
*/
- __pyx_t_15 = PySet_Add(__pyx_v_J2_set, __pyx_v_combined_pattern); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PySet_Add(__pyx_v_J2_set, __pyx_v_combined_pattern); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L40;
}
__pyx_L40:;
}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":396
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":396
* J2_set.add(combined_pattern)
*
* for pattern1 in I_set: # <<<<<<<<<<<<<<
* for pattern2 in I_set:
* x = x+1
*/
- __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_I_set)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
+ __pyx_t_3 = PyObject_GetIter(((PyObject *)__pyx_v_I_set)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
for (;;) {
{
- __pyx_t_3 = __pyx_t_4(__pyx_t_1);
- if (unlikely(!__pyx_t_3)) {
+ __pyx_t_1 = __pyx_t_5(__pyx_t_3);
+ if (unlikely(!__pyx_t_1)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
- __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GOTREF(__pyx_t_1);
}
__Pyx_XDECREF(__pyx_v_pattern1);
- __pyx_v_pattern1 = __pyx_t_3;
- __pyx_t_3 = 0;
+ __pyx_v_pattern1 = __pyx_t_1;
+ __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":397
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":397
*
* for pattern1 in I_set:
* for pattern2 in I_set: # <<<<<<<<<<<<<<
* x = x+1
* if len(pattern1) + len(pattern2) + 1 <= self.max_length:
*/
- __pyx_t_3 = PyObject_GetIter(((PyObject *)__pyx_v_I_set)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_20 = Py_TYPE(__pyx_t_3)->tp_iternext;
+ __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_I_set)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_21 = Py_TYPE(__pyx_t_1)->tp_iternext;
for (;;) {
{
- __pyx_t_7 = __pyx_t_20(__pyx_t_3);
- if (unlikely(!__pyx_t_7)) {
+ __pyx_t_8 = __pyx_t_21(__pyx_t_1);
+ if (unlikely(!__pyx_t_8)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
- __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GOTREF(__pyx_t_8);
}
__Pyx_XDECREF(__pyx_v_pattern2);
- __pyx_v_pattern2 = __pyx_t_7;
- __pyx_t_7 = 0;
+ __pyx_v_pattern2 = __pyx_t_8;
+ __pyx_t_8 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":398
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":398
* for pattern1 in I_set:
* for pattern2 in I_set:
* x = x+1 # <<<<<<<<<<<<<<
* if len(pattern1) + len(pattern2) + 1 <= self.max_length:
* combined_pattern = pattern1 + (-1,) + pattern2
*/
- __pyx_t_7 = PyNumber_Add(__pyx_v_x, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_8 = PyNumber_Add(__pyx_v_x, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_v_x);
- __pyx_v_x = __pyx_t_7;
- __pyx_t_7 = 0;
+ __pyx_v_x = __pyx_t_8;
+ __pyx_t_8 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":399
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":399
* for pattern2 in I_set:
* x = x+1
* if len(pattern1) + len(pattern2) + 1 <= self.max_length: # <<<<<<<<<<<<<<
* combined_pattern = pattern1 + (-1,) + pattern2
* IJ_set.add(combined_pattern)
*/
- __pyx_t_14 = PyObject_Length(__pyx_v_pattern1); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_Length(__pyx_v_pattern1); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_2 = PyObject_Length(__pyx_v_pattern2); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_19 = (((__pyx_t_14 + __pyx_t_2) + 1) <= __pyx_v_self->max_length);
- if (__pyx_t_19) {
+ __pyx_t_20 = (((__pyx_t_15 + __pyx_t_2) + 1) <= __pyx_v_self->max_length);
+ if (__pyx_t_20) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":400
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":400
* x = x+1
* if len(pattern1) + len(pattern2) + 1 <= self.max_length:
* combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<<
* IJ_set.add(combined_pattern)
*
*/
- __pyx_t_7 = PyNumber_Add(__pyx_v_pattern1, ((PyObject *)__pyx_k_tuple_80)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_v_pattern2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyNumber_Add(__pyx_v_pattern1, ((PyObject *)__pyx_k_tuple_80)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_v_pattern2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_XDECREF(__pyx_v_combined_pattern);
- __pyx_v_combined_pattern = __pyx_t_8;
- __pyx_t_8 = 0;
+ __pyx_v_combined_pattern = __pyx_t_9;
+ __pyx_t_9 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":401
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":401
* if len(pattern1) + len(pattern2) + 1 <= self.max_length:
* combined_pattern = pattern1 + (-1,) + pattern2
* IJ_set.add(combined_pattern) # <<<<<<<<<<<<<<
*
* for pattern1 in I_set:
*/
- __pyx_t_15 = PySet_Add(__pyx_v_IJ_set, __pyx_v_combined_pattern); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PySet_Add(__pyx_v_IJ_set, __pyx_v_combined_pattern); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L45;
}
__pyx_L45:;
}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":403
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":403
* IJ_set.add(combined_pattern)
*
* for pattern1 in I_set: # <<<<<<<<<<<<<<
* for pattern2 in J2_set:
* x = x+2
*/
- __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_I_set)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
+ __pyx_t_3 = PyObject_GetIter(((PyObject *)__pyx_v_I_set)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
for (;;) {
{
- __pyx_t_3 = __pyx_t_4(__pyx_t_1);
- if (unlikely(!__pyx_t_3)) {
+ __pyx_t_1 = __pyx_t_5(__pyx_t_3);
+ if (unlikely(!__pyx_t_1)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
- __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GOTREF(__pyx_t_1);
}
__Pyx_XDECREF(__pyx_v_pattern1);
- __pyx_v_pattern1 = __pyx_t_3;
- __pyx_t_3 = 0;
+ __pyx_v_pattern1 = __pyx_t_1;
+ __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":404
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":404
*
* for pattern1 in I_set:
* for pattern2 in J2_set: # <<<<<<<<<<<<<<
* x = x+2
* if len(pattern1) + len(pattern2) + 1<= self.max_length:
*/
- __pyx_t_3 = PyObject_GetIter(((PyObject *)__pyx_v_J2_set)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_20 = Py_TYPE(__pyx_t_3)->tp_iternext;
+ __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_J2_set)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_21 = Py_TYPE(__pyx_t_1)->tp_iternext;
for (;;) {
{
- __pyx_t_8 = __pyx_t_20(__pyx_t_3);
- if (unlikely(!__pyx_t_8)) {
+ __pyx_t_9 = __pyx_t_21(__pyx_t_1);
+ if (unlikely(!__pyx_t_9)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
- __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_GOTREF(__pyx_t_9);
}
__Pyx_XDECREF(__pyx_v_pattern2);
- __pyx_v_pattern2 = __pyx_t_8;
- __pyx_t_8 = 0;
+ __pyx_v_pattern2 = __pyx_t_9;
+ __pyx_t_9 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":405
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":405
* for pattern1 in I_set:
* for pattern2 in J2_set:
* x = x+2 # <<<<<<<<<<<<<<
* if len(pattern1) + len(pattern2) + 1<= self.max_length:
* combined_pattern = pattern1 + (-1,) + pattern2
*/
- __pyx_t_8 = PyNumber_Add(__pyx_v_x, __pyx_int_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_9 = PyNumber_Add(__pyx_v_x, __pyx_int_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_v_x);
- __pyx_v_x = __pyx_t_8;
- __pyx_t_8 = 0;
+ __pyx_v_x = __pyx_t_9;
+ __pyx_t_9 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":406
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":406
* for pattern2 in J2_set:
* x = x+2
* if len(pattern1) + len(pattern2) + 1<= self.max_length: # <<<<<<<<<<<<<<
@@ -32853,156 +32881,156 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
* IJ_set.add(combined_pattern)
*/
__pyx_t_2 = PyObject_Length(__pyx_v_pattern1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_14 = PyObject_Length(__pyx_v_pattern2); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_19 = (((__pyx_t_2 + __pyx_t_14) + 1) <= __pyx_v_self->max_length);
- if (__pyx_t_19) {
+ __pyx_t_15 = PyObject_Length(__pyx_v_pattern2); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_20 = (((__pyx_t_2 + __pyx_t_15) + 1) <= __pyx_v_self->max_length);
+ if (__pyx_t_20) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":407
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":407
* x = x+2
* if len(pattern1) + len(pattern2) + 1<= self.max_length:
* combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<<
* IJ_set.add(combined_pattern)
* combined_pattern = pattern2 + (-1,) + pattern1
*/
- __pyx_t_8 = PyNumber_Add(__pyx_v_pattern1, ((PyObject *)__pyx_k_tuple_81)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyNumber_Add(__pyx_v_pattern1, ((PyObject *)__pyx_k_tuple_81)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_8 = PyNumber_Add(__pyx_t_9, __pyx_v_pattern2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_7 = PyNumber_Add(__pyx_t_8, __pyx_v_pattern2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_XDECREF(__pyx_v_combined_pattern);
- __pyx_v_combined_pattern = __pyx_t_7;
- __pyx_t_7 = 0;
+ __pyx_v_combined_pattern = __pyx_t_8;
+ __pyx_t_8 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":408
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":408
* if len(pattern1) + len(pattern2) + 1<= self.max_length:
* combined_pattern = pattern1 + (-1,) + pattern2
* IJ_set.add(combined_pattern) # <<<<<<<<<<<<<<
* combined_pattern = pattern2 + (-1,) + pattern1
* IJ_set.add(combined_pattern)
*/
- __pyx_t_15 = PySet_Add(__pyx_v_IJ_set, __pyx_v_combined_pattern); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PySet_Add(__pyx_v_IJ_set, __pyx_v_combined_pattern); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":409
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":409
* combined_pattern = pattern1 + (-1,) + pattern2
* IJ_set.add(combined_pattern)
* combined_pattern = pattern2 + (-1,) + pattern1 # <<<<<<<<<<<<<<
* IJ_set.add(combined_pattern)
*
*/
- __pyx_t_7 = PyNumber_Add(__pyx_v_pattern2, ((PyObject *)__pyx_k_tuple_82)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_v_pattern1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyNumber_Add(__pyx_v_pattern2, ((PyObject *)__pyx_k_tuple_82)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_v_pattern1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_v_combined_pattern);
- __pyx_v_combined_pattern = __pyx_t_8;
- __pyx_t_8 = 0;
+ __pyx_v_combined_pattern = __pyx_t_9;
+ __pyx_t_9 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":410
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":410
* IJ_set.add(combined_pattern)
* combined_pattern = pattern2 + (-1,) + pattern1
* IJ_set.add(combined_pattern) # <<<<<<<<<<<<<<
*
* N = len(pattern_rank)
*/
- __pyx_t_15 = PySet_Add(__pyx_v_IJ_set, __pyx_v_combined_pattern); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PySet_Add(__pyx_v_IJ_set, __pyx_v_combined_pattern); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L50;
}
__pyx_L50:;
}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":412
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":412
* IJ_set.add(combined_pattern)
*
* N = len(pattern_rank) # <<<<<<<<<<<<<<
* cost_by_rank = IntList(initial_len=N)
* count_by_rank = IntList(initial_len=N)
*/
- __pyx_t_14 = PyDict_Size(((PyObject *)__pyx_v_pattern_rank)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_N = __pyx_t_14;
+ __pyx_t_15 = PyDict_Size(((PyObject *)__pyx_v_pattern_rank)); if (unlikely(__pyx_t_15 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_v_N = __pyx_t_15;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":413
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":413
*
* N = len(pattern_rank)
* cost_by_rank = IntList(initial_len=N) # <<<<<<<<<<<<<<
* count_by_rank = IntList(initial_len=N)
* for pattern, arr in self.precomputed_collocations.iteritems():
*/
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_t_3 = PyInt_FromLong(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_v_cost_by_rank = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_3);
- __pyx_t_3 = 0;
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+ __pyx_v_cost_by_rank = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
+ __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":414
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":414
* N = len(pattern_rank)
* cost_by_rank = IntList(initial_len=N)
* count_by_rank = IntList(initial_len=N) # <<<<<<<<<<<<<<
* for pattern, arr in self.precomputed_collocations.iteritems():
* if pattern not in IJ_set:
*/
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
- __pyx_t_1 = PyInt_FromLong(__pyx_v_N); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_v_count_by_rank = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
- __pyx_t_1 = 0;
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+ __pyx_t_3 = PyInt_FromLong(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+ __pyx_v_count_by_rank = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_3);
+ __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":415
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":415
* cost_by_rank = IntList(initial_len=N)
* count_by_rank = IntList(initial_len=N)
* for pattern, arr in self.precomputed_collocations.iteritems(): # <<<<<<<<<<<<<<
* if pattern not in IJ_set:
* s = ""
*/
- __pyx_t_14 = 0;
+ __pyx_t_15 = 0;
if (unlikely(__pyx_v_self->precomputed_collocations == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
{__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_3 = __Pyx_dict_iterator(__pyx_v_self->precomputed_collocations, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_2), (&__pyx_t_13)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_1);
- __pyx_t_1 = __pyx_t_3;
- __pyx_t_3 = 0;
+ __pyx_t_1 = __Pyx_dict_iterator(__pyx_v_self->precomputed_collocations, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_2), (&__pyx_t_14)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_3);
+ __pyx_t_3 = __pyx_t_1;
+ __pyx_t_1 = 0;
while (1) {
- __pyx_t_16 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_2, &__pyx_t_14, &__pyx_t_3, &__pyx_t_8, NULL, __pyx_t_13);
- if (unlikely(__pyx_t_16 == 0)) break;
- if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_17 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_2, &__pyx_t_15, &__pyx_t_1, &__pyx_t_9, NULL, __pyx_t_14);
+ if (unlikely(__pyx_t_17 == 0)) break;
+ if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_v_pattern);
- __pyx_v_pattern = __pyx_t_3;
- __pyx_t_3 = 0;
+ __pyx_v_pattern = __pyx_t_1;
+ __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_v_arr);
- __pyx_v_arr = __pyx_t_8;
- __pyx_t_8 = 0;
+ __pyx_v_arr = __pyx_t_9;
+ __pyx_t_9 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":416
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":416
* count_by_rank = IntList(initial_len=N)
* for pattern, arr in self.precomputed_collocations.iteritems():
* if pattern not in IJ_set: # <<<<<<<<<<<<<<
* s = ""
* for word_id in pattern:
*/
- __pyx_t_19 = (__Pyx_PySequence_Contains(__pyx_v_pattern, ((PyObject *)__pyx_v_IJ_set), Py_NE)); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__pyx_t_19) {
+ __pyx_t_20 = (__Pyx_PySequence_Contains(__pyx_v_pattern, ((PyObject *)__pyx_v_IJ_set), Py_NE)); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_20) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":417
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":417
* for pattern, arr in self.precomputed_collocations.iteritems():
* if pattern not in IJ_set:
* s = "" # <<<<<<<<<<<<<<
@@ -33013,7 +33041,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
__Pyx_XDECREF(__pyx_v_s);
__pyx_v_s = ((PyObject *)__pyx_kp_s_45);
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":418
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":418
* if pattern not in IJ_set:
* s = ""
* for word_id in pattern: # <<<<<<<<<<<<<<
@@ -33021,124 +33049,124 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
* s = s + "X "
*/
if (PyList_CheckExact(__pyx_v_pattern) || PyTuple_CheckExact(__pyx_v_pattern)) {
- __pyx_t_8 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_8); __pyx_t_12 = 0;
- __pyx_t_4 = NULL;
+ __pyx_t_9 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_9); __pyx_t_13 = 0;
+ __pyx_t_5 = NULL;
} else {
- __pyx_t_12 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_4 = Py_TYPE(__pyx_t_8)->tp_iternext;
+ __pyx_t_13 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_5 = Py_TYPE(__pyx_t_9)->tp_iternext;
}
for (;;) {
- if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_8)) {
- if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_8)) break;
+ if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_9)) {
+ if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_9)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_3); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_8)) {
- if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
+ } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_9)) {
+ if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_3); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
- __pyx_t_3 = __pyx_t_4(__pyx_t_8);
- if (unlikely(!__pyx_t_3)) {
+ __pyx_t_1 = __pyx_t_5(__pyx_t_9);
+ if (unlikely(!__pyx_t_1)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
- __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GOTREF(__pyx_t_1);
}
__Pyx_XDECREF(__pyx_v_word_id);
- __pyx_v_word_id = __pyx_t_3;
- __pyx_t_3 = 0;
+ __pyx_v_word_id = __pyx_t_1;
+ __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":419
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":419
* s = ""
* for word_id in pattern:
* if word_id == -1: # <<<<<<<<<<<<<<
* s = s + "X "
* else:
*/
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_19) {
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (__pyx_t_20) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":420
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":420
* for word_id in pattern:
* if word_id == -1:
* s = s + "X " # <<<<<<<<<<<<<<
* else:
* s = s + darray.id2word[word_id] + " "
*/
- __pyx_t_3 = PyNumber_Add(__pyx_v_s, ((PyObject *)__pyx_kp_s_83)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = PyNumber_Add(__pyx_v_s, ((PyObject *)__pyx_kp_s_83)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_v_s);
- __pyx_v_s = __pyx_t_3;
- __pyx_t_3 = 0;
+ __pyx_v_s = __pyx_t_1;
+ __pyx_t_1 = 0;
goto __pyx_L56;
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":422
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":422
* s = s + "X "
* else:
* s = s + darray.id2word[word_id] + " " # <<<<<<<<<<<<<<
* logger.warn("ERROR: unexpected pattern %s in set of precomputed collocations", s)
* else:
*/
- __pyx_t_3 = PyObject_GetItem(__pyx_v_darray->id2word, __pyx_v_word_id); if (!__pyx_t_3) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = PyNumber_Add(__pyx_v_s, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Add(__pyx_t_7, ((PyObject *)__pyx_kp_s_67)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_1 = PyObject_GetItem(__pyx_v_darray->id2word, __pyx_v_word_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_8 = PyNumber_Add(__pyx_v_s, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyNumber_Add(__pyx_t_8, ((PyObject *)__pyx_kp_s_67)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_v_s);
- __pyx_v_s = __pyx_t_3;
- __pyx_t_3 = 0;
+ __pyx_v_s = __pyx_t_1;
+ __pyx_t_1 = 0;
}
__pyx_L56:;
}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":423
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":423
* else:
* s = s + darray.id2word[word_id] + " "
* logger.warn("ERROR: unexpected pattern %s in set of precomputed collocations", s) # <<<<<<<<<<<<<<
* else:
* chunk = ()
*/
- __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__warn); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__warn); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_84));
- PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_kp_s_84));
+ PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_kp_s_84));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_84));
__Pyx_INCREF(__pyx_v_s);
- PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_s);
+ PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_s);
__Pyx_GIVEREF(__pyx_v_s);
- __pyx_t_7 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
goto __pyx_L53;
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":425
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":425
* logger.warn("ERROR: unexpected pattern %s in set of precomputed collocations", s)
* else:
* chunk = () # <<<<<<<<<<<<<<
@@ -33149,7 +33177,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
__Pyx_XDECREF(((PyObject *)__pyx_v_chunk));
__pyx_v_chunk = __pyx_empty_tuple;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":426
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":426
* else:
* chunk = ()
* max_rank = 0 # <<<<<<<<<<<<<<
@@ -33158,7 +33186,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
*/
__pyx_v_max_rank = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":427
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":427
* chunk = ()
* max_rank = 0
* arity = 0 # <<<<<<<<<<<<<<
@@ -33169,7 +33197,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
__Pyx_XDECREF(__pyx_v_arity);
__pyx_v_arity = __pyx_int_0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":428
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":428
* max_rank = 0
* arity = 0
* for word_id in pattern: # <<<<<<<<<<<<<<
@@ -33177,99 +33205,99 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
* max_rank = max(max_rank, pattern_rank[chunk])
*/
if (PyList_CheckExact(__pyx_v_pattern) || PyTuple_CheckExact(__pyx_v_pattern)) {
- __pyx_t_7 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_7); __pyx_t_12 = 0;
- __pyx_t_4 = NULL;
+ __pyx_t_8 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_8); __pyx_t_13 = 0;
+ __pyx_t_5 = NULL;
} else {
- __pyx_t_12 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_4 = Py_TYPE(__pyx_t_7)->tp_iternext;
+ __pyx_t_13 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_5 = Py_TYPE(__pyx_t_8)->tp_iternext;
}
for (;;) {
- if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_7)) {
- if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_7)) break;
+ if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_8)) {
+ if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_8)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_8); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_13); __Pyx_INCREF(__pyx_t_9); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_7)) {
- if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
+ } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_8)) {
+ if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_12); __Pyx_INCREF(__pyx_t_8); __pyx_t_12++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_13); __Pyx_INCREF(__pyx_t_9); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_7, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
- __pyx_t_8 = __pyx_t_4(__pyx_t_7);
- if (unlikely(!__pyx_t_8)) {
+ __pyx_t_9 = __pyx_t_5(__pyx_t_8);
+ if (unlikely(!__pyx_t_9)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
- __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_GOTREF(__pyx_t_9);
}
__Pyx_XDECREF(__pyx_v_word_id);
- __pyx_v_word_id = __pyx_t_8;
- __pyx_t_8 = 0;
+ __pyx_v_word_id = __pyx_t_9;
+ __pyx_t_9 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":429
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":429
* arity = 0
* for word_id in pattern:
* if word_id == -1: # <<<<<<<<<<<<<<
* max_rank = max(max_rank, pattern_rank[chunk])
* arity = arity + 1
*/
- __pyx_t_8 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (__pyx_t_19) {
+ __pyx_t_9 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ if (__pyx_t_20) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":430
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":430
* for word_id in pattern:
* if word_id == -1:
* max_rank = max(max_rank, pattern_rank[chunk]) # <<<<<<<<<<<<<<
* arity = arity + 1
* chunk = ()
*/
- __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_pattern_rank), ((PyObject *)__pyx_v_chunk)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_16 = __pyx_v_max_rank;
- __pyx_t_5 = PyInt_FromLong(__pyx_t_16); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PyObject_RichCompare(__pyx_t_8, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_pattern_rank), ((PyObject *)__pyx_v_chunk)); if (!__pyx_t_9) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_17 = __pyx_v_max_rank;
+ __pyx_t_6 = PyInt_FromLong(__pyx_t_17); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_7 = PyObject_RichCompare(__pyx_t_9, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (__pyx_t_19) {
- __Pyx_INCREF(__pyx_t_8);
- __pyx_t_3 = __pyx_t_8;
+ __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ if (__pyx_t_20) {
+ __Pyx_INCREF(__pyx_t_9);
+ __pyx_t_1 = __pyx_t_9;
} else {
- __pyx_t_6 = PyInt_FromLong(__pyx_t_16); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = __pyx_t_6;
- __pyx_t_6 = 0;
+ __pyx_t_7 = PyInt_FromLong(__pyx_t_17); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_1 = __pyx_t_7;
+ __pyx_t_7 = 0;
}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_16 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_max_rank = __pyx_t_16;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_17 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v_max_rank = __pyx_t_17;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":431
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":431
* if word_id == -1:
* max_rank = max(max_rank, pattern_rank[chunk])
* arity = arity + 1 # <<<<<<<<<<<<<<
* chunk = ()
* else:
*/
- __pyx_t_3 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_v_arity);
- __pyx_v_arity = __pyx_t_3;
- __pyx_t_3 = 0;
+ __pyx_v_arity = __pyx_t_1;
+ __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":432
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":432
* max_rank = max(max_rank, pattern_rank[chunk])
* arity = arity + 1
* chunk = () # <<<<<<<<<<<<<<
@@ -33283,100 +33311,100 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":434
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":434
* chunk = ()
* else:
* chunk = chunk + (word_id,) # <<<<<<<<<<<<<<
* max_rank = max(max_rank, pattern_rank[chunk])
* cost_by_rank.arr[max_rank] = cost_by_rank.arr[max_rank] + (4*len(arr))
*/
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_word_id);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_word_id);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_word_id);
__Pyx_GIVEREF(__pyx_v_word_id);
- __pyx_t_8 = PyNumber_Add(((PyObject *)__pyx_v_chunk), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_8));
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+ __pyx_t_9 = PyNumber_Add(((PyObject *)__pyx_v_chunk), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_9));
+ __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_v_chunk));
- __pyx_v_chunk = __pyx_t_8;
- __pyx_t_8 = 0;
+ __pyx_v_chunk = __pyx_t_9;
+ __pyx_t_9 = 0;
}
__pyx_L59:;
}
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":435
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":435
* else:
* chunk = chunk + (word_id,)
* max_rank = max(max_rank, pattern_rank[chunk]) # <<<<<<<<<<<<<<
* cost_by_rank.arr[max_rank] = cost_by_rank.arr[max_rank] + (4*len(arr))
* count_by_rank.arr[max_rank] = count_by_rank.arr[max_rank] + (len(arr)/(arity+1))
*/
- __pyx_t_7 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_pattern_rank), ((PyObject *)__pyx_v_chunk)); if (!__pyx_t_7) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_16 = __pyx_v_max_rank;
- __pyx_t_3 = PyInt_FromLong(__pyx_t_16); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (__pyx_t_19) {
- __Pyx_INCREF(__pyx_t_7);
- __pyx_t_8 = __pyx_t_7;
+ __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_pattern_rank), ((PyObject *)__pyx_v_chunk)); if (!__pyx_t_8) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_17 = __pyx_v_max_rank;
+ __pyx_t_1 = PyInt_FromLong(__pyx_t_17); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_7 = PyObject_RichCompare(__pyx_t_8, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_20 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ if (__pyx_t_20) {
+ __Pyx_INCREF(__pyx_t_8);
+ __pyx_t_9 = __pyx_t_8;
} else {
- __pyx_t_6 = PyInt_FromLong(__pyx_t_16); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_8 = __pyx_t_6;
- __pyx_t_6 = 0;
+ __pyx_t_7 = PyInt_FromLong(__pyx_t_17); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_9 = __pyx_t_7;
+ __pyx_t_7 = 0;
}
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_16 = __Pyx_PyInt_AsInt(__pyx_t_8); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_v_max_rank = __pyx_t_16;
+ __pyx_t_17 = __Pyx_PyInt_AsInt(__pyx_t_9); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_v_max_rank = __pyx_t_17;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":436
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":436
* chunk = chunk + (word_id,)
* max_rank = max(max_rank, pattern_rank[chunk])
* cost_by_rank.arr[max_rank] = cost_by_rank.arr[max_rank] + (4*len(arr)) # <<<<<<<<<<<<<<
* count_by_rank.arr[max_rank] = count_by_rank.arr[max_rank] + (len(arr)/(arity+1))
*
*/
- __pyx_t_12 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- (__pyx_v_cost_by_rank->arr[__pyx_v_max_rank]) = ((__pyx_v_cost_by_rank->arr[__pyx_v_max_rank]) + (4 * __pyx_t_12));
+ __pyx_t_13 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ (__pyx_v_cost_by_rank->arr[__pyx_v_max_rank]) = ((__pyx_v_cost_by_rank->arr[__pyx_v_max_rank]) + (4 * __pyx_t_13));
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":437
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":437
* max_rank = max(max_rank, pattern_rank[chunk])
* cost_by_rank.arr[max_rank] = cost_by_rank.arr[max_rank] + (4*len(arr))
* count_by_rank.arr[max_rank] = count_by_rank.arr[max_rank] + (len(arr)/(arity+1)) # <<<<<<<<<<<<<<
*
* cumul_cost = 0
*/
- __pyx_t_8 = PyInt_FromLong((__pyx_v_count_by_rank->arr[__pyx_v_max_rank])); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyInt_FromLong((__pyx_v_count_by_rank->arr[__pyx_v_max_rank])); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_13 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_12 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_12); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyNumber_Add(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_16 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- (__pyx_v_count_by_rank->arr[__pyx_v_max_rank]) = __pyx_t_16;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_7 = PyNumber_Add(__pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_17 = __Pyx_PyInt_AsInt(__pyx_t_7); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ (__pyx_v_count_by_rank->arr[__pyx_v_max_rank]) = __pyx_t_17;
}
__pyx_L53:;
}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":439
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":439
* count_by_rank.arr[max_rank] = count_by_rank.arr[max_rank] + (len(arr)/(arity+1))
*
* cumul_cost = 0 # <<<<<<<<<<<<<<
@@ -33386,7 +33414,7 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
__Pyx_INCREF(__pyx_int_0);
__pyx_v_cumul_cost = __pyx_int_0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":440
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":440
*
* cumul_cost = 0
* cumul_count = 0 # <<<<<<<<<<<<<<
@@ -33396,172 +33424,179 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
__Pyx_INCREF(__pyx_int_0);
__pyx_v_cumul_count = __pyx_int_0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":441
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":441
* cumul_cost = 0
* cumul_count = 0
* for i from 0 <= i < N: # <<<<<<<<<<<<<<
* cumul_cost = cumul_cost + cost_by_rank.arr[i]
* cumul_count = cumul_count + count_by_rank.arr[i]
*/
- __pyx_t_13 = __pyx_v_N;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_13; __pyx_v_i++) {
+ __pyx_t_14 = __pyx_v_N;
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_14; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":442
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":442
* cumul_count = 0
* for i from 0 <= i < N:
* cumul_cost = cumul_cost + cost_by_rank.arr[i] # <<<<<<<<<<<<<<
* cumul_count = cumul_count + count_by_rank.arr[i]
* logger.debug("RANK %d\tCOUNT, COST: %d %d\tCUMUL: %d, %d", i, count_by_rank.arr[i], cost_by_rank.arr[i], cumul_count, cumul_cost)
*/
- __pyx_t_1 = PyInt_FromLong((__pyx_v_cost_by_rank->arr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyNumber_Add(__pyx_v_cumul_cost, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_3 = PyInt_FromLong((__pyx_v_cost_by_rank->arr[__pyx_v_i])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_7 = PyNumber_Add(__pyx_v_cumul_cost, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_v_cumul_cost);
- __pyx_v_cumul_cost = __pyx_t_6;
- __pyx_t_6 = 0;
+ __pyx_v_cumul_cost = __pyx_t_7;
+ __pyx_t_7 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":443
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":443
* for i from 0 <= i < N:
* cumul_cost = cumul_cost + cost_by_rank.arr[i]
* cumul_count = cumul_count + count_by_rank.arr[i] # <<<<<<<<<<<<<<
* logger.debug("RANK %d\tCOUNT, COST: %d %d\tCUMUL: %d, %d", i, count_by_rank.arr[i], cost_by_rank.arr[i], cumul_count, cumul_cost)
*
*/
- __pyx_t_6 = PyInt_FromLong((__pyx_v_count_by_rank->arr[__pyx_v_i])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_1 = PyNumber_Add(__pyx_v_cumul_count, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_7 = PyInt_FromLong((__pyx_v_count_by_rank->arr[__pyx_v_i])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_3 = PyNumber_Add(__pyx_v_cumul_count, __pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_v_cumul_count);
- __pyx_v_cumul_count = __pyx_t_1;
- __pyx_t_1 = 0;
+ __pyx_v_cumul_count = __pyx_t_3;
+ __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":444
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":444
* cumul_cost = cumul_cost + cost_by_rank.arr[i]
* cumul_count = cumul_count + count_by_rank.arr[i]
* logger.debug("RANK %d\tCOUNT, COST: %d %d\tCUMUL: %d, %d", i, count_by_rank.arr[i], cost_by_rank.arr[i], cumul_count, cumul_cost) # <<<<<<<<<<<<<<
*
* num_found_patterns = len(self.precomputed_collocations)
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__debug); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyInt_FromLong((__pyx_v_count_by_rank->arr[__pyx_v_i])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_8 = PyInt_FromLong((__pyx_v_cost_by_rank->arr[__pyx_v_i])); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_7 = PyTuple_New(6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__debug); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = PyInt_FromLong((__pyx_v_count_by_rank->arr[__pyx_v_i])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_9 = PyInt_FromLong((__pyx_v_cost_by_rank->arr[__pyx_v_i])); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_8 = PyTuple_New(6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_85));
- PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_s_85));
+ PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_kp_s_85));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_85));
- PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_9);
+ __Pyx_GIVEREF(__pyx_t_9);
__Pyx_INCREF(__pyx_v_cumul_count);
- PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_v_cumul_count);
+ PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_v_cumul_count);
__Pyx_GIVEREF(__pyx_v_cumul_count);
__Pyx_INCREF(__pyx_v_cumul_cost);
- PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_v_cumul_cost);
+ PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_v_cumul_cost);
__Pyx_GIVEREF(__pyx_v_cumul_cost);
- __pyx_t_1 = 0;
__pyx_t_3 = 0;
- __pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_1 = 0;
+ __pyx_t_9 = 0;
+ __pyx_t_9 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":446
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":446
* logger.debug("RANK %d\tCOUNT, COST: %d %d\tCUMUL: %d, %d", i, count_by_rank.arr[i], cost_by_rank.arr[i], cumul_count, cumul_cost)
*
* num_found_patterns = len(self.precomputed_collocations) # <<<<<<<<<<<<<<
* for pattern in IJ_set:
* if pattern not in self.precomputed_collocations:
*/
- __pyx_t_8 = __pyx_v_self->precomputed_collocations;
- __Pyx_INCREF(__pyx_t_8);
- __pyx_t_2 = PyObject_Length(__pyx_t_8); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_v_num_found_patterns = __pyx_t_8;
- __pyx_t_8 = 0;
+ __pyx_t_9 = __pyx_v_self->precomputed_collocations;
+ __Pyx_INCREF(__pyx_t_9);
+ __pyx_t_2 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_v_num_found_patterns = __pyx_t_9;
+ __pyx_t_9 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":447
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":447
*
* num_found_patterns = len(self.precomputed_collocations)
* for pattern in IJ_set: # <<<<<<<<<<<<<<
* if pattern not in self.precomputed_collocations:
* self.precomputed_collocations[pattern] = IntList()
*/
- __pyx_t_8 = PyObject_GetIter(((PyObject *)__pyx_v_IJ_set)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_4 = Py_TYPE(__pyx_t_8)->tp_iternext;
+ __pyx_t_9 = PyObject_GetIter(((PyObject *)__pyx_v_IJ_set)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_5 = Py_TYPE(__pyx_t_9)->tp_iternext;
for (;;) {
{
- __pyx_t_7 = __pyx_t_4(__pyx_t_8);
- if (unlikely(!__pyx_t_7)) {
+ __pyx_t_8 = __pyx_t_5(__pyx_t_9);
+ if (unlikely(!__pyx_t_8)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[11]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
- __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GOTREF(__pyx_t_8);
}
__Pyx_XDECREF(__pyx_v_pattern);
- __pyx_v_pattern = __pyx_t_7;
- __pyx_t_7 = 0;
+ __pyx_v_pattern = __pyx_t_8;
+ __pyx_t_8 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":448
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":448
* num_found_patterns = len(self.precomputed_collocations)
* for pattern in IJ_set:
* if pattern not in self.precomputed_collocations: # <<<<<<<<<<<<<<
* self.precomputed_collocations[pattern] = IntList()
*
*/
- __pyx_t_19 = (__Pyx_PySequence_Contains(__pyx_v_pattern, __pyx_v_self->precomputed_collocations, Py_NE)); if (unlikely(__pyx_t_19 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__pyx_t_19) {
+ __pyx_t_20 = (__Pyx_PySequence_Contains(__pyx_v_pattern, __pyx_v_self->precomputed_collocations, Py_NE)); if (unlikely(__pyx_t_20 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_20) {
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":449
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":449
* for pattern in IJ_set:
* if pattern not in self.precomputed_collocations:
* self.precomputed_collocations[pattern] = IntList() # <<<<<<<<<<<<<<
*
* cdef float stop_time = monitor_cpu()
*/
- __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- if (PyObject_SetItem(__pyx_v_self->precomputed_collocations, __pyx_v_pattern, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ if (PyObject_SetItem(__pyx_v_self->precomputed_collocations, __pyx_v_pattern, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
goto __pyx_L64;
}
__pyx_L64:;
}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":451
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":451
* self.precomputed_collocations[pattern] = IntList()
*
* cdef float stop_time = monitor_cpu() # <<<<<<<<<<<<<<
* logger.info("Precomputed collocations for %d patterns out of %d possible (upper bound %d)", num_found_patterns, len(self.precomputed_collocations), x)
* logger.info("Precomputed inverted index for %d patterns ", len(self.precomputed_index))
*/
- __pyx_v_stop_time = __pyx_f_3_sa_monitor_cpu();
+ __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_8 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_8); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_v_stop_time = __pyx_t_4;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":452
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":452
*
* cdef float stop_time = monitor_cpu()
* logger.info("Precomputed collocations for %d patterns out of %d possible (upper bound %d)", num_found_patterns, len(self.precomputed_collocations), x) # <<<<<<<<<<<<<<
@@ -33570,8 +33605,8 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
*/
__pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_7 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_9 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_8 = __pyx_v_self->precomputed_collocations;
__Pyx_INCREF(__pyx_t_8);
@@ -33579,27 +33614,27 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_8 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_86));
- PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_86));
+ PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_s_86));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_86));
__Pyx_INCREF(__pyx_v_num_found_patterns);
- PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_num_found_patterns);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_num_found_patterns);
__Pyx_GIVEREF(__pyx_v_num_found_patterns);
- PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
__Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_v_x);
+ PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_v_x);
__Pyx_GIVEREF(__pyx_v_x);
__pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":453
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":453
* cdef float stop_time = monitor_cpu()
* logger.info("Precomputed collocations for %d patterns out of %d possible (upper bound %d)", num_found_patterns, len(self.precomputed_collocations), x)
* logger.info("Precomputed inverted index for %d patterns ", len(self.precomputed_index)) # <<<<<<<<<<<<<<
@@ -33607,8 +33642,8 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
*/
__pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_6 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_7 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_8 = __pyx_v_self->precomputed_index;
__Pyx_INCREF(__pyx_t_8);
@@ -33616,44 +33651,44 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_8 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_87));
- PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_s_87));
+ PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_kp_s_87));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_87));
- PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
__pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":454
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":454
* logger.info("Precomputed collocations for %d patterns out of %d possible (upper bound %d)", num_found_patterns, len(self.precomputed_collocations), x)
* logger.info("Precomputed inverted index for %d patterns ", len(self.precomputed_index))
* logger.info("Precomputation took %f seconds", (stop_time - start_time)) # <<<<<<<<<<<<<<
*/
__pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_7 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_9 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_8 = PyFloat_FromDouble((__pyx_v_stop_time - __pyx_v_start_time)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_88));
- PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_kp_s_88));
+ PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_s_88));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_88));
- PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
__pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
@@ -33661,11 +33696,11 @@ static PyObject *__pyx_pf_3_sa_14Precomputation_6precompute(struct __pyx_obj_3_s
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("_sa.Precomputation.precompute", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -33716,7 +33751,7 @@ static int __pyx_pw_3_sa_11SuffixArray_1__cinit__(PyObject *__pyx_v_self, PyObje
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__from_binary,&__pyx_n_s__from_text,&__pyx_n_s__side,0};
PyObject* values[3] = {0,0,0};
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":11
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":11
* cdef IntList ha
*
* def __cinit__(self, from_binary=None, from_text=None, side=None): # <<<<<<<<<<<<<<
@@ -33795,7 +33830,7 @@ static int __pyx_pf_3_sa_11SuffixArray___cinit__(struct __pyx_obj_3_sa_SuffixArr
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":12
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":12
*
* def __cinit__(self, from_binary=None, from_text=None, side=None):
* self.darray = DataArray() # <<<<<<<<<<<<<<
@@ -33810,7 +33845,7 @@ static int __pyx_pf_3_sa_11SuffixArray___cinit__(struct __pyx_obj_3_sa_SuffixArr
__pyx_v_self->darray = ((struct __pyx_obj_3_sa_DataArray *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":13
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":13
* def __cinit__(self, from_binary=None, from_text=None, side=None):
* self.darray = DataArray()
* self.sa = IntList() # <<<<<<<<<<<<<<
@@ -33825,7 +33860,7 @@ static int __pyx_pf_3_sa_11SuffixArray___cinit__(struct __pyx_obj_3_sa_SuffixArr
__pyx_v_self->sa = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":14
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":14
* self.darray = DataArray()
* self.sa = IntList()
* self.ha = IntList() # <<<<<<<<<<<<<<
@@ -33840,7 +33875,7 @@ static int __pyx_pf_3_sa_11SuffixArray___cinit__(struct __pyx_obj_3_sa_SuffixArr
__pyx_v_self->ha = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":15
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":15
* self.sa = IntList()
* self.ha = IntList()
* if from_binary: # <<<<<<<<<<<<<<
@@ -33850,7 +33885,7 @@ static int __pyx_pf_3_sa_11SuffixArray___cinit__(struct __pyx_obj_3_sa_SuffixArr
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_binary); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":16
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":16
* self.ha = IntList()
* if from_binary:
* self.read_binary(from_binary) # <<<<<<<<<<<<<<
@@ -33872,7 +33907,7 @@ static int __pyx_pf_3_sa_11SuffixArray___cinit__(struct __pyx_obj_3_sa_SuffixArr
goto __pyx_L3;
}
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":17
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":17
* if from_binary:
* self.read_binary(from_binary)
* elif from_text: # <<<<<<<<<<<<<<
@@ -33882,7 +33917,7 @@ static int __pyx_pf_3_sa_11SuffixArray___cinit__(struct __pyx_obj_3_sa_SuffixArr
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_from_text); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":18
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":18
* self.read_binary(from_binary)
* elif from_text:
* self.read_text(from_text, side) # <<<<<<<<<<<<<<
@@ -33932,7 +33967,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_3__getitem__(PyObject *__pyx_v_self
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":20
+/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":20
* self.read_text(from_text, side)
*
* def __getitem__(self, i): # <<<<<<<<<<<<<<
@@ -33950,7 +33985,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_2__getitem__(struct __pyx_obj_3_sa_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getitem__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":21
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":21
*
* def __getitem__(self, i):
* return self.sa.arr[i] # <<<<<<<<<<<<<<
@@ -34034,7 +34069,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_5read_text(PyObject *__pyx_v_self,
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":23
+/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":23
* return self.sa.arr[i]
*
* def read_text(self, filename, side): # <<<<<<<<<<<<<<
@@ -34061,20 +34096,21 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
Py_ssize_t __pyx_t_3;
- int __pyx_t_4;
- long __pyx_t_5;
- int __pyx_t_6;
+ float __pyx_t_4;
+ int __pyx_t_5;
+ long __pyx_t_6;
int __pyx_t_7;
int __pyx_t_8;
- PyObject *__pyx_t_9 = NULL;
+ int __pyx_t_9;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
+ PyObject *__pyx_t_12 = NULL;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_text", 0);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":29
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":29
* cdef IntList isa, word_count
*
* self.darray = DataArray(from_text=filename, side=side, use_sent_id=True) # <<<<<<<<<<<<<<
@@ -34098,7 +34134,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
__pyx_v_self->darray = ((struct __pyx_obj_3_sa_DataArray *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":30
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":30
*
* self.darray = DataArray(from_text=filename, side=side, use_sent_id=True)
* N = len(self.darray) # <<<<<<<<<<<<<<
@@ -34111,7 +34147,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_N = __pyx_t_3;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":31
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":31
* self.darray = DataArray(from_text=filename, side=side, use_sent_id=True)
* N = len(self.darray)
* V = len(self.darray.id2word) # <<<<<<<<<<<<<<
@@ -34124,7 +34160,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_V = __pyx_t_3;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":33
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":33
* V = len(self.darray.id2word)
*
* self.sa = IntList(initial_len=N) # <<<<<<<<<<<<<<
@@ -34146,7 +34182,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
__pyx_v_self->sa = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":34
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":34
*
* self.sa = IntList(initial_len=N)
* self.ha = IntList(initial_len=V+1) # <<<<<<<<<<<<<<
@@ -34168,7 +34204,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
__pyx_v_self->ha = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":36
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":36
* self.ha = IntList(initial_len=V+1)
*
* isa = IntList(initial_len=N) # <<<<<<<<<<<<<<
@@ -34187,7 +34223,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
__pyx_v_isa = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":37
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":37
*
* isa = IntList(initial_len=N)
* word_count = IntList(initial_len=V+1) # <<<<<<<<<<<<<<
@@ -34206,16 +34242,23 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
__pyx_v_word_count = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":40
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":40
*
* '''Step 1: bucket sort data'''
* cdef float sort_start_time = monitor_cpu() # <<<<<<<<<<<<<<
* cdef float start_time = sort_start_time
* for i from 0 <= i < N:
*/
- __pyx_v_sort_start_time = __pyx_f_3_sa_monitor_cpu();
+ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v_sort_start_time = __pyx_t_4;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":41
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":41
* '''Step 1: bucket sort data'''
* cdef float sort_start_time = monitor_cpu()
* cdef float start_time = sort_start_time # <<<<<<<<<<<<<<
@@ -34224,17 +34267,17 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
*/
__pyx_v_start_time = __pyx_v_sort_start_time;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":42
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":42
* cdef float sort_start_time = monitor_cpu()
* cdef float start_time = sort_start_time
* for i from 0 <= i < N: # <<<<<<<<<<<<<<
* a_i = self.darray.data.arr[i]
* word_count.arr[a_i] = word_count.arr[a_i] + 1
*/
- __pyx_t_4 = __pyx_v_N;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
+ __pyx_t_5 = __pyx_v_N;
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":43
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":43
* cdef float start_time = sort_start_time
* for i from 0 <= i < N:
* a_i = self.darray.data.arr[i] # <<<<<<<<<<<<<<
@@ -34243,7 +34286,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
*/
__pyx_v_a_i = (__pyx_v_self->darray->data->arr[__pyx_v_i]);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":44
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":44
* for i from 0 <= i < N:
* a_i = self.darray.data.arr[i]
* word_count.arr[a_i] = word_count.arr[a_i] + 1 # <<<<<<<<<<<<<<
@@ -34253,7 +34296,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
(__pyx_v_word_count->arr[__pyx_v_a_i]) = ((__pyx_v_word_count->arr[__pyx_v_a_i]) + 1);
}
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":46
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":46
* word_count.arr[a_i] = word_count.arr[a_i] + 1
*
* n = 0 # <<<<<<<<<<<<<<
@@ -34262,17 +34305,17 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
*/
__pyx_v_n = 0;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":47
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":47
*
* n = 0
* for i from 0 <= i < V+1: # <<<<<<<<<<<<<<
* self.ha.arr[i] = n
* n = n + word_count.arr[i]
*/
- __pyx_t_5 = (__pyx_v_V + 1);
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {
+ __pyx_t_6 = (__pyx_v_V + 1);
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":48
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":48
* n = 0
* for i from 0 <= i < V+1:
* self.ha.arr[i] = n # <<<<<<<<<<<<<<
@@ -34281,7 +34324,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
*/
(__pyx_v_self->ha->arr[__pyx_v_i]) = __pyx_v_n;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":49
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":49
* for i from 0 <= i < V+1:
* self.ha.arr[i] = n
* n = n + word_count.arr[i] # <<<<<<<<<<<<<<
@@ -34290,7 +34333,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
*/
__pyx_v_n = (__pyx_v_n + (__pyx_v_word_count->arr[__pyx_v_i]));
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":50
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":50
* self.ha.arr[i] = n
* n = n + word_count.arr[i]
* word_count.arr[i] = 0 # <<<<<<<<<<<<<<
@@ -34300,17 +34343,17 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
(__pyx_v_word_count->arr[__pyx_v_i]) = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":52
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":52
* word_count.arr[i] = 0
*
* for i from 0 <= i < N: # <<<<<<<<<<<<<<
* a_i = self.darray.data.arr[i]
* self.sa.arr[self.ha.arr[a_i] + word_count.arr[a_i]] = i
*/
- __pyx_t_4 = __pyx_v_N;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
+ __pyx_t_5 = __pyx_v_N;
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":53
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":53
*
* for i from 0 <= i < N:
* a_i = self.darray.data.arr[i] # <<<<<<<<<<<<<<
@@ -34319,7 +34362,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
*/
__pyx_v_a_i = (__pyx_v_self->darray->data->arr[__pyx_v_i]);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":54
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":54
* for i from 0 <= i < N:
* a_i = self.darray.data.arr[i]
* self.sa.arr[self.ha.arr[a_i] + word_count.arr[a_i]] = i # <<<<<<<<<<<<<<
@@ -34328,7 +34371,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
*/
(__pyx_v_self->sa->arr[((__pyx_v_self->ha->arr[__pyx_v_a_i]) + (__pyx_v_word_count->arr[__pyx_v_a_i]))]) = __pyx_v_i;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":55
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":55
* a_i = self.darray.data.arr[i]
* self.sa.arr[self.ha.arr[a_i] + word_count.arr[a_i]] = i
* isa.arr[i] = self.ha.arr[a_i + 1] - 1 # bucket pointer is last index in bucket # <<<<<<<<<<<<<<
@@ -34337,7 +34380,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
*/
(__pyx_v_isa->arr[__pyx_v_i]) = ((__pyx_v_self->ha->arr[(__pyx_v_a_i + 1)]) - 1);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":56
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":56
* self.sa.arr[self.ha.arr[a_i] + word_count.arr[a_i]] = i
* isa.arr[i] = self.ha.arr[a_i + 1] - 1 # bucket pointer is last index in bucket
* word_count.arr[a_i] = word_count.arr[a_i] + 1 # <<<<<<<<<<<<<<
@@ -34347,7 +34390,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
(__pyx_v_word_count->arr[__pyx_v_a_i]) = ((__pyx_v_word_count->arr[__pyx_v_a_i]) + 1);
}
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":59
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":59
*
* '''Determine size of initial runs'''
* current_run = 0 # <<<<<<<<<<<<<<
@@ -34356,33 +34399,33 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
*/
__pyx_v_current_run = 0;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":60
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":60
* '''Determine size of initial runs'''
* current_run = 0
* for i from 0 <= i < V+1: # <<<<<<<<<<<<<<
* if i < V and self.ha.arr[i+1] - self.ha.arr[i] == 1:
* current_run = current_run + 1
*/
- __pyx_t_5 = (__pyx_v_V + 1);
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {
+ __pyx_t_6 = (__pyx_v_V + 1);
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":61
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":61
* current_run = 0
* for i from 0 <= i < V+1:
* if i < V and self.ha.arr[i+1] - self.ha.arr[i] == 1: # <<<<<<<<<<<<<<
* current_run = current_run + 1
* else:
*/
- __pyx_t_6 = (__pyx_v_i < __pyx_v_V);
- if (__pyx_t_6) {
- __pyx_t_7 = (((__pyx_v_self->ha->arr[(__pyx_v_i + 1)]) - (__pyx_v_self->ha->arr[__pyx_v_i])) == 1);
- __pyx_t_8 = __pyx_t_7;
+ __pyx_t_7 = (__pyx_v_i < __pyx_v_V);
+ if (__pyx_t_7) {
+ __pyx_t_8 = (((__pyx_v_self->ha->arr[(__pyx_v_i + 1)]) - (__pyx_v_self->ha->arr[__pyx_v_i])) == 1);
+ __pyx_t_9 = __pyx_t_8;
} else {
- __pyx_t_8 = __pyx_t_6;
+ __pyx_t_9 = __pyx_t_7;
}
- if (__pyx_t_8) {
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":62
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":62
* for i from 0 <= i < V+1:
* if i < V and self.ha.arr[i+1] - self.ha.arr[i] == 1:
* current_run = current_run + 1 # <<<<<<<<<<<<<<
@@ -34394,17 +34437,17 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":64
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":64
* current_run = current_run + 1
* else:
* if current_run > 0: # <<<<<<<<<<<<<<
* self.sa.arr[self.ha.arr[i] - current_run] = -current_run
* current_run = 0
*/
- __pyx_t_8 = (__pyx_v_current_run > 0);
- if (__pyx_t_8) {
+ __pyx_t_9 = (__pyx_v_current_run > 0);
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":65
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":65
* else:
* if current_run > 0:
* self.sa.arr[self.ha.arr[i] - current_run] = -current_run # <<<<<<<<<<<<<<
@@ -34413,7 +34456,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
*/
(__pyx_v_self->sa->arr[((__pyx_v_self->ha->arr[__pyx_v_i]) - __pyx_v_current_run)]) = (-__pyx_v_current_run);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":66
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":66
* if current_run > 0:
* self.sa.arr[self.ha.arr[i] - current_run] = -current_run
* current_run = 0 # <<<<<<<<<<<<<<
@@ -34428,35 +34471,44 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
__pyx_L11:;
}
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":68
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":68
* current_run = 0
*
* logger.info(" Bucket sort took %f seconds", (monitor_cpu() - sort_start_time)) # <<<<<<<<<<<<<<
*
* '''Step 2: prefix-doubling sort'''
*/
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyFloat_FromDouble((__pyx_f_3_sa_monitor_cpu() - __pyx_v_sort_start_time)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyFloat_FromDouble(__pyx_v_sort_start_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_11 = PyNumber_Subtract(__pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_89));
- PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_kp_s_89));
+ PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_89));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_89));
- PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_11);
+ __pyx_t_11 = 0;
+ __pyx_t_11 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":71
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":71
*
* '''Step 2: prefix-doubling sort'''
* h = 1 # <<<<<<<<<<<<<<
@@ -34465,7 +34517,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
*/
__pyx_v_h = 1;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":72
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":72
* '''Step 2: prefix-doubling sort'''
* h = 1
* while self.sa.arr[0] != -N: # <<<<<<<<<<<<<<
@@ -34473,47 +34525,54 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
* logger.debug(" Refining, sort depth = %d", h)
*/
while (1) {
- __pyx_t_8 = ((__pyx_v_self->sa->arr[0]) != (-__pyx_v_N));
- if (!__pyx_t_8) break;
+ __pyx_t_9 = ((__pyx_v_self->sa->arr[0]) != (-__pyx_v_N));
+ if (!__pyx_t_9) break;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":73
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":73
* h = 1
* while self.sa.arr[0] != -N:
* sort_start_time = monitor_cpu() # <<<<<<<<<<<<<<
* logger.debug(" Refining, sort depth = %d", h)
* i = 0
*/
- __pyx_v_sort_start_time = __pyx_f_3_sa_monitor_cpu();
+ __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_1 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v_sort_start_time = __pyx_t_4;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":74
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":74
* while self.sa.arr[0] != -N:
* sort_start_time = monitor_cpu()
* logger.debug(" Refining, sort depth = %d", h) # <<<<<<<<<<<<<<
* i = 0
* skip = 0
*/
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_9 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__debug); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyInt_FromLong(__pyx_v_h); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_11 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__debug); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_h); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_90));
- PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_90));
+ PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_90));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_90));
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_1 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":75
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":75
* sort_start_time = monitor_cpu()
* logger.debug(" Refining, sort depth = %d", h)
* i = 0 # <<<<<<<<<<<<<<
@@ -34522,7 +34581,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
*/
__pyx_v_i = 0;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":76
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":76
* logger.debug(" Refining, sort depth = %d", h)
* i = 0
* skip = 0 # <<<<<<<<<<<<<<
@@ -34531,7 +34590,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
*/
__pyx_v_skip = 0;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":77
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":77
* i = 0
* skip = 0
* while i < N: # <<<<<<<<<<<<<<
@@ -34539,20 +34598,20 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
* skip = skip + self.sa.arr[i]
*/
while (1) {
- __pyx_t_8 = (__pyx_v_i < __pyx_v_N);
- if (!__pyx_t_8) break;
+ __pyx_t_9 = (__pyx_v_i < __pyx_v_N);
+ if (!__pyx_t_9) break;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":78
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":78
* skip = 0
* while i < N:
* if self.sa.arr[i] < 0: # <<<<<<<<<<<<<<
* skip = skip + self.sa.arr[i]
* i = i - self.sa.arr[i]
*/
- __pyx_t_8 = ((__pyx_v_self->sa->arr[__pyx_v_i]) < 0);
- if (__pyx_t_8) {
+ __pyx_t_9 = ((__pyx_v_self->sa->arr[__pyx_v_i]) < 0);
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":79
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":79
* while i < N:
* if self.sa.arr[i] < 0:
* skip = skip + self.sa.arr[i] # <<<<<<<<<<<<<<
@@ -34561,7 +34620,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
*/
__pyx_v_skip = (__pyx_v_skip + (__pyx_v_self->sa->arr[__pyx_v_i]));
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":80
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":80
* if self.sa.arr[i] < 0:
* skip = skip + self.sa.arr[i]
* i = i - self.sa.arr[i] # <<<<<<<<<<<<<<
@@ -34573,17 +34632,17 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":82
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":82
* i = i - self.sa.arr[i]
* else:
* if skip < 0: # <<<<<<<<<<<<<<
* self.sa.arr[i+skip] = skip
* skip = 0
*/
- __pyx_t_8 = (__pyx_v_skip < 0);
- if (__pyx_t_8) {
+ __pyx_t_9 = (__pyx_v_skip < 0);
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":83
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":83
* else:
* if skip < 0:
* self.sa.arr[i+skip] = skip # <<<<<<<<<<<<<<
@@ -34592,7 +34651,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
*/
(__pyx_v_self->sa->arr[(__pyx_v_i + __pyx_v_skip)]) = __pyx_v_skip;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":84
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":84
* if skip < 0:
* self.sa.arr[i+skip] = skip
* skip = 0 # <<<<<<<<<<<<<<
@@ -34604,7 +34663,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
}
__pyx_L18:;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":85
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":85
* self.sa.arr[i+skip] = skip
* skip = 0
* j = isa.arr[self.sa.arr[i]] # <<<<<<<<<<<<<<
@@ -34613,42 +34672,42 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
*/
__pyx_v_j = (__pyx_v_isa->arr[(__pyx_v_self->sa->arr[__pyx_v_i])]);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":86
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":86
* skip = 0
* j = isa.arr[self.sa.arr[i]]
* self.q3sort(i, j, h, isa) # <<<<<<<<<<<<<<
* i = j+1
* if skip < 0:
*/
- __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__q3sort); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__q3sort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_9 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_2 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_11 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
__pyx_t_10 = PyInt_FromLong(__pyx_v_h); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = PyTuple_New(4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_t_10);
+ __pyx_t_12 = PyTuple_New(4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_11);
+ PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_10);
__Pyx_GIVEREF(__pyx_t_10);
__Pyx_INCREF(((PyObject *)__pyx_v_isa));
- PyTuple_SET_ITEM(__pyx_t_11, 3, ((PyObject *)__pyx_v_isa));
+ PyTuple_SET_ITEM(__pyx_t_12, 3, ((PyObject *)__pyx_v_isa));
__Pyx_GIVEREF(((PyObject *)__pyx_v_isa));
- __pyx_t_1 = 0;
- __pyx_t_9 = 0;
+ __pyx_t_2 = 0;
+ __pyx_t_11 = 0;
__pyx_t_10 = 0;
- __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":87
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":87
* j = isa.arr[self.sa.arr[i]]
* self.q3sort(i, j, h, isa)
* i = j+1 # <<<<<<<<<<<<<<
@@ -34660,17 +34719,17 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
__pyx_L17:;
}
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":88
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":88
* self.q3sort(i, j, h, isa)
* i = j+1
* if skip < 0: # <<<<<<<<<<<<<<
* self.sa.arr[i+skip] = skip
* h = h * 2
*/
- __pyx_t_8 = (__pyx_v_skip < 0);
- if (__pyx_t_8) {
+ __pyx_t_9 = (__pyx_v_skip < 0);
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":89
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":89
* i = j+1
* if skip < 0:
* self.sa.arr[i+skip] = skip # <<<<<<<<<<<<<<
@@ -34682,7 +34741,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
}
__pyx_L19:;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":90
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":90
* if skip < 0:
* self.sa.arr[i+skip] = skip
* h = h * 2 # <<<<<<<<<<<<<<
@@ -34691,7 +34750,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
*/
__pyx_v_h = (__pyx_v_h * 2);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":91
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":91
* self.sa.arr[i+skip] = skip
* h = h * 2
* logger.debug(" Refinement took %f seconds", (monitor_cpu() - sort_start_time)) # <<<<<<<<<<<<<<
@@ -34700,54 +34759,63 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
*/
__pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__debug); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__debug); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_1 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = PyFloat_FromDouble(__pyx_v_sort_start_time); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_11 = PyNumber_Subtract(__pyx_t_1, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyFloat_FromDouble((__pyx_f_3_sa_monitor_cpu() - __pyx_v_sort_start_time)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_91));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_91));
+ PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_kp_s_91));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_91));
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_10);
- __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_11);
+ __pyx_t_11 = 0;
+ __pyx_t_11 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":94
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":94
*
* '''Step 3: read off suffix array from inverse suffix array'''
* logger.info(" Finalizing sort...") # <<<<<<<<<<<<<<
* for i from 0 <= i < N:
* j = isa.arr[i]
*/
- __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_2 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_93), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_10 = PyObject_GetAttr(__pyx_t_11, __pyx_n_s__info); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_11 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_k_tuple_93), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":95
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":95
* '''Step 3: read off suffix array from inverse suffix array'''
* logger.info(" Finalizing sort...")
* for i from 0 <= i < N: # <<<<<<<<<<<<<<
* j = isa.arr[i]
* self.sa.arr[j] = i
*/
- __pyx_t_4 = __pyx_v_N;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
+ __pyx_t_5 = __pyx_v_N;
+ for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":96
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":96
* logger.info(" Finalizing sort...")
* for i from 0 <= i < N:
* j = isa.arr[i] # <<<<<<<<<<<<<<
@@ -34756,7 +34824,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
*/
__pyx_v_j = (__pyx_v_isa->arr[__pyx_v_i]);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":97
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":97
* for i from 0 <= i < N:
* j = isa.arr[i]
* self.sa.arr[j] = i # <<<<<<<<<<<<<<
@@ -34766,42 +34834,51 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_4read_text(struct __pyx_obj_3_sa_Su
(__pyx_v_self->sa->arr[__pyx_v_j]) = __pyx_v_i;
}
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":98
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":98
* j = isa.arr[i]
* self.sa.arr[j] = i
* logger.info("Suffix array construction took %f seconds", (monitor_cpu() - start_time)) # <<<<<<<<<<<<<<
*
* def q3sort(self, int i, int j, int h, IntList isa, pad=""):
*/
- __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_2 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyFloat_FromDouble((__pyx_f_3_sa_monitor_cpu() - __pyx_v_start_time)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_10 = PyObject_GetAttr(__pyx_t_11, __pyx_n_s__info); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_12 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_11 = PyFloat_FromDouble(__pyx_v_start_time); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_1 = PyNumber_Subtract(__pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_94));
PyTuple_SET_ITEM(__pyx_t_11, 0, ((PyObject *)__pyx_kp_s_94));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_94));
- PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_10);
- __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
+ PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_1 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
+ __Pyx_XDECREF(__pyx_t_12);
__Pyx_AddTraceback("_sa.SuffixArray.read_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -34904,7 +34981,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_7q3sort(PyObject *__pyx_v_self, PyO
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":100
+/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":100
* logger.info("Suffix array construction took %f seconds", (monitor_cpu() - start_time))
*
* def q3sort(self, int i, int j, int h, IntList isa, pad=""): # <<<<<<<<<<<<<<
@@ -34934,7 +35011,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("q3sort", 0);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":107
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":107
* cdef int k, midpoint, pval, phead, ptail, tmp
*
* if j-i < -1: # <<<<<<<<<<<<<<
@@ -34944,7 +35021,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
__pyx_t_1 = ((__pyx_v_j - __pyx_v_i) < -1);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":108
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":108
*
* if j-i < -1:
* raise Exception("Unexpected condition found in q3sort: sort from %d to %d" % (i,j)) # <<<<<<<<<<<<<<
@@ -34981,7 +35058,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":109
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":109
* if j-i < -1:
* raise Exception("Unexpected condition found in q3sort: sort from %d to %d" % (i,j))
* if j-i == -1: # recursive base case -- empty interval # <<<<<<<<<<<<<<
@@ -34991,7 +35068,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
__pyx_t_1 = ((__pyx_v_j - __pyx_v_i) == -1);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":110
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":110
* raise Exception("Unexpected condition found in q3sort: sort from %d to %d" % (i,j))
* if j-i == -1: # recursive base case -- empty interval
* return # <<<<<<<<<<<<<<
@@ -35005,7 +35082,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":111
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":111
* if j-i == -1: # recursive base case -- empty interval
* return
* if (j-i == 0): # recursive base case -- singleton interval # <<<<<<<<<<<<<<
@@ -35015,7 +35092,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
__pyx_t_1 = ((__pyx_v_j - __pyx_v_i) == 0);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":112
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":112
* return
* if (j-i == 0): # recursive base case -- singleton interval
* isa.arr[self.sa.arr[i]] = i # <<<<<<<<<<<<<<
@@ -35024,7 +35101,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
*/
(__pyx_v_isa->arr[(__pyx_v_self->sa->arr[__pyx_v_i])]) = __pyx_v_i;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":113
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":113
* if (j-i == 0): # recursive base case -- singleton interval
* isa.arr[self.sa.arr[i]] = i
* self.sa.arr[i] = -1 # <<<<<<<<<<<<<<
@@ -35033,7 +35110,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
*/
(__pyx_v_self->sa->arr[__pyx_v_i]) = -1;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":114
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":114
* isa.arr[self.sa.arr[i]] = i
* self.sa.arr[i] = -1
* return # <<<<<<<<<<<<<<
@@ -35047,7 +35124,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":123
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":123
* # If the method of assigning word_id's is changed, this method
* # may need to be reconsidered as well.
* midpoint = (i+j)/2 # <<<<<<<<<<<<<<
@@ -35056,7 +35133,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
*/
__pyx_v_midpoint = __Pyx_div_long((__pyx_v_i + __pyx_v_j), 2);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":124
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":124
* # may need to be reconsidered as well.
* midpoint = (i+j)/2
* pval = isa.arr[self.sa.arr[midpoint] + h] # <<<<<<<<<<<<<<
@@ -35065,7 +35142,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
*/
__pyx_v_pval = (__pyx_v_isa->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_h)]);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":125
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":125
* midpoint = (i+j)/2
* pval = isa.arr[self.sa.arr[midpoint] + h]
* if i != midpoint: # <<<<<<<<<<<<<<
@@ -35075,7 +35152,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
__pyx_t_1 = (__pyx_v_i != __pyx_v_midpoint);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":126
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":126
* pval = isa.arr[self.sa.arr[midpoint] + h]
* if i != midpoint:
* tmp = self.sa.arr[midpoint] # <<<<<<<<<<<<<<
@@ -35084,7 +35161,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
*/
__pyx_v_tmp = (__pyx_v_self->sa->arr[__pyx_v_midpoint]);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":127
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":127
* if i != midpoint:
* tmp = self.sa.arr[midpoint]
* self.sa.arr[midpoint] = self.sa.arr[i] # <<<<<<<<<<<<<<
@@ -35093,7 +35170,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
*/
(__pyx_v_self->sa->arr[__pyx_v_midpoint]) = (__pyx_v_self->sa->arr[__pyx_v_i]);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":128
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":128
* tmp = self.sa.arr[midpoint]
* self.sa.arr[midpoint] = self.sa.arr[i]
* self.sa.arr[i] = tmp # <<<<<<<<<<<<<<
@@ -35105,7 +35182,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
}
__pyx_L6:;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":129
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":129
* self.sa.arr[midpoint] = self.sa.arr[i]
* self.sa.arr[i] = tmp
* phead = i # <<<<<<<<<<<<<<
@@ -35114,7 +35191,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
*/
__pyx_v_phead = __pyx_v_i;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":130
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":130
* self.sa.arr[i] = tmp
* phead = i
* ptail = i # <<<<<<<<<<<<<<
@@ -35123,7 +35200,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
*/
__pyx_v_ptail = __pyx_v_i;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":134
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":134
* # find the three partitions. phead marks the first element
* # of the middle partition, and ptail marks the last element
* for k from i+1 <= k < j+1: # <<<<<<<<<<<<<<
@@ -35133,7 +35210,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
__pyx_t_5 = (__pyx_v_j + 1);
for (__pyx_v_k = (__pyx_v_i + 1); __pyx_v_k < __pyx_t_5; __pyx_v_k++) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":135
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":135
* # of the middle partition, and ptail marks the last element
* for k from i+1 <= k < j+1:
* if isa.arr[self.sa.arr[k] + h] < pval: # <<<<<<<<<<<<<<
@@ -35143,7 +35220,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
__pyx_t_1 = ((__pyx_v_isa->arr[((__pyx_v_self->sa->arr[__pyx_v_k]) + __pyx_v_h)]) < __pyx_v_pval);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":136
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":136
* for k from i+1 <= k < j+1:
* if isa.arr[self.sa.arr[k] + h] < pval:
* if k > ptail+1: # <<<<<<<<<<<<<<
@@ -35153,7 +35230,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
__pyx_t_1 = (__pyx_v_k > (__pyx_v_ptail + 1));
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":137
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":137
* if isa.arr[self.sa.arr[k] + h] < pval:
* if k > ptail+1:
* tmp = self.sa.arr[phead] # <<<<<<<<<<<<<<
@@ -35162,7 +35239,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
*/
__pyx_v_tmp = (__pyx_v_self->sa->arr[__pyx_v_phead]);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":138
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":138
* if k > ptail+1:
* tmp = self.sa.arr[phead]
* self.sa.arr[phead] = self.sa.arr[k] # <<<<<<<<<<<<<<
@@ -35171,7 +35248,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
*/
(__pyx_v_self->sa->arr[__pyx_v_phead]) = (__pyx_v_self->sa->arr[__pyx_v_k]);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":139
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":139
* tmp = self.sa.arr[phead]
* self.sa.arr[phead] = self.sa.arr[k]
* self.sa.arr[k] = self.sa.arr[ptail+1] # <<<<<<<<<<<<<<
@@ -35180,7 +35257,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
*/
(__pyx_v_self->sa->arr[__pyx_v_k]) = (__pyx_v_self->sa->arr[(__pyx_v_ptail + 1)]);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":140
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":140
* self.sa.arr[phead] = self.sa.arr[k]
* self.sa.arr[k] = self.sa.arr[ptail+1]
* self.sa.arr[ptail+1] = tmp # <<<<<<<<<<<<<<
@@ -35192,7 +35269,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":142
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":142
* self.sa.arr[ptail+1] = tmp
* else: # k == ptail+1
* tmp = self.sa.arr[phead] # <<<<<<<<<<<<<<
@@ -35201,7 +35278,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
*/
__pyx_v_tmp = (__pyx_v_self->sa->arr[__pyx_v_phead]);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":143
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":143
* else: # k == ptail+1
* tmp = self.sa.arr[phead]
* self.sa.arr[phead] = self.sa.arr[k] # <<<<<<<<<<<<<<
@@ -35210,7 +35287,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
*/
(__pyx_v_self->sa->arr[__pyx_v_phead]) = (__pyx_v_self->sa->arr[__pyx_v_k]);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":144
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":144
* tmp = self.sa.arr[phead]
* self.sa.arr[phead] = self.sa.arr[k]
* self.sa.arr[k] = tmp # <<<<<<<<<<<<<<
@@ -35221,7 +35298,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
}
__pyx_L10:;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":145
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":145
* self.sa.arr[phead] = self.sa.arr[k]
* self.sa.arr[k] = tmp
* phead = phead + 1 # <<<<<<<<<<<<<<
@@ -35230,7 +35307,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
*/
__pyx_v_phead = (__pyx_v_phead + 1);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":146
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":146
* self.sa.arr[k] = tmp
* phead = phead + 1
* ptail = ptail + 1 # <<<<<<<<<<<<<<
@@ -35242,7 +35319,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":148
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":148
* ptail = ptail + 1
* else:
* if isa.arr[self.sa.arr[k] + h] == pval: # <<<<<<<<<<<<<<
@@ -35252,7 +35329,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
__pyx_t_1 = ((__pyx_v_isa->arr[((__pyx_v_self->sa->arr[__pyx_v_k]) + __pyx_v_h)]) == __pyx_v_pval);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":149
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":149
* else:
* if isa.arr[self.sa.arr[k] + h] == pval:
* if k > ptail+1: # <<<<<<<<<<<<<<
@@ -35262,7 +35339,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
__pyx_t_1 = (__pyx_v_k > (__pyx_v_ptail + 1));
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":150
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":150
* if isa.arr[self.sa.arr[k] + h] == pval:
* if k > ptail+1:
* tmp = self.sa.arr[ptail+1] # <<<<<<<<<<<<<<
@@ -35271,7 +35348,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
*/
__pyx_v_tmp = (__pyx_v_self->sa->arr[(__pyx_v_ptail + 1)]);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":151
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":151
* if k > ptail+1:
* tmp = self.sa.arr[ptail+1]
* self.sa.arr[ptail+1] = self.sa.arr[k] # <<<<<<<<<<<<<<
@@ -35280,7 +35357,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
*/
(__pyx_v_self->sa->arr[(__pyx_v_ptail + 1)]) = (__pyx_v_self->sa->arr[__pyx_v_k]);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":152
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":152
* tmp = self.sa.arr[ptail+1]
* self.sa.arr[ptail+1] = self.sa.arr[k]
* self.sa.arr[k] = tmp # <<<<<<<<<<<<<<
@@ -35292,7 +35369,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
}
__pyx_L12:;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":153
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":153
* self.sa.arr[ptail+1] = self.sa.arr[k]
* self.sa.arr[k] = tmp
* ptail = ptail + 1 # <<<<<<<<<<<<<<
@@ -35307,7 +35384,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
__pyx_L9:;
}
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":156
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":156
*
* # recursively sort smaller suffixes
* self.q3sort(i, phead-1, h, isa, pad+" ") # <<<<<<<<<<<<<<
@@ -35347,7 +35424,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":160
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":160
* # update suffixes with pivot value
* # corresponds to update_group function in Larsson & Sadakane
* for k from phead <= k < ptail+1: # <<<<<<<<<<<<<<
@@ -35357,7 +35434,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
__pyx_t_5 = (__pyx_v_ptail + 1);
for (__pyx_v_k = __pyx_v_phead; __pyx_v_k < __pyx_t_5; __pyx_v_k++) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":161
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":161
* # corresponds to update_group function in Larsson & Sadakane
* for k from phead <= k < ptail+1:
* isa.arr[self.sa.arr[k]] = ptail # <<<<<<<<<<<<<<
@@ -35367,7 +35444,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
(__pyx_v_isa->arr[(__pyx_v_self->sa->arr[__pyx_v_k])]) = __pyx_v_ptail;
}
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":162
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":162
* for k from phead <= k < ptail+1:
* isa.arr[self.sa.arr[k]] = ptail
* if phead == ptail: # <<<<<<<<<<<<<<
@@ -35377,7 +35454,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
__pyx_t_1 = (__pyx_v_phead == __pyx_v_ptail);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":163
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":163
* isa.arr[self.sa.arr[k]] = ptail
* if phead == ptail:
* self.sa.arr[phead] = -1 # <<<<<<<<<<<<<<
@@ -35389,7 +35466,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_6q3sort(struct __pyx_obj_3_sa_Suffi
}
__pyx_L15:;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":166
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":166
*
* # recursively sort larger suffixes
* self.q3sort(ptail+1, j, h, isa, pad+" ") # <<<<<<<<<<<<<<
@@ -35467,7 +35544,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_9write_text(PyObject *__pyx_v_self,
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":169
+/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":169
*
*
* def write_text(self, char* filename): # <<<<<<<<<<<<<<
@@ -35486,7 +35563,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_8write_text(struct __pyx_obj_3_sa_S
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_text", 0);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":170
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":170
*
* def write_text(self, char* filename):
* self.darray.write_text(filename) # <<<<<<<<<<<<<<
@@ -35543,7 +35620,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_11read_binary(PyObject *__pyx_v_sel
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":172
+/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":172
* self.darray.write_text(filename)
*
* def read_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -35557,7 +35634,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_binary(struct __pyx_obj_3_sa
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_binary", 0);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":174
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":174
* def read_binary(self, char* filename):
* cdef FILE *f
* f = fopen(filename, "r") # <<<<<<<<<<<<<<
@@ -35566,7 +35643,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_binary(struct __pyx_obj_3_sa
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k__r);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":175
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":175
* cdef FILE *f
* f = fopen(filename, "r")
* self.darray.read_handle(f) # <<<<<<<<<<<<<<
@@ -35575,7 +35652,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_binary(struct __pyx_obj_3_sa
*/
((struct __pyx_vtabstruct_3_sa_DataArray *)__pyx_v_self->darray->__pyx_vtab)->read_handle(__pyx_v_self->darray, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":176
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":176
* f = fopen(filename, "r")
* self.darray.read_handle(f)
* self.sa.read_handle(f) # <<<<<<<<<<<<<<
@@ -35584,7 +35661,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_binary(struct __pyx_obj_3_sa
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sa->__pyx_vtab)->read_handle(__pyx_v_self->sa, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":177
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":177
* self.darray.read_handle(f)
* self.sa.read_handle(f)
* self.ha.read_handle(f) # <<<<<<<<<<<<<<
@@ -35593,7 +35670,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_10read_binary(struct __pyx_obj_3_sa
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->ha->__pyx_vtab)->read_handle(__pyx_v_self->ha, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":178
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":178
* self.sa.read_handle(f)
* self.ha.read_handle(f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -35629,7 +35706,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_13write_binary(PyObject *__pyx_v_se
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":180
+/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":180
* fclose(f)
*
* def write_binary(self, char* filename): # <<<<<<<<<<<<<<
@@ -35643,7 +35720,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12write_binary(struct __pyx_obj_3_s
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("write_binary", 0);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":182
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":182
* def write_binary(self, char* filename):
* cdef FILE* f
* f = fopen(filename, "w") # <<<<<<<<<<<<<<
@@ -35652,7 +35729,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12write_binary(struct __pyx_obj_3_s
*/
__pyx_v_f = fopen(__pyx_v_filename, __pyx_k__w);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":183
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":183
* cdef FILE* f
* f = fopen(filename, "w")
* self.darray.write_handle(f) # <<<<<<<<<<<<<<
@@ -35661,7 +35738,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12write_binary(struct __pyx_obj_3_s
*/
((struct __pyx_vtabstruct_3_sa_DataArray *)__pyx_v_self->darray->__pyx_vtab)->write_handle(__pyx_v_self->darray, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":184
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":184
* f = fopen(filename, "w")
* self.darray.write_handle(f)
* self.sa.write_handle(f) # <<<<<<<<<<<<<<
@@ -35670,7 +35747,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12write_binary(struct __pyx_obj_3_s
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->sa->__pyx_vtab)->write_handle(__pyx_v_self->sa, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":185
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":185
* self.darray.write_handle(f)
* self.sa.write_handle(f)
* self.ha.write_handle(f) # <<<<<<<<<<<<<<
@@ -35679,7 +35756,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_12write_binary(struct __pyx_obj_3_s
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_self->ha->__pyx_vtab)->write_handle(__pyx_v_self->ha, __pyx_v_f);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":186
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":186
* self.sa.write_handle(f)
* self.ha.write_handle(f)
* fclose(f) # <<<<<<<<<<<<<<
@@ -35715,7 +35792,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_15write_enhanced(PyObject *__pyx_v_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":188
+/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":188
* fclose(f)
*
* def write_enhanced(self, char* filename): # <<<<<<<<<<<<<<
@@ -35747,7 +35824,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("write_enhanced", 0);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":189
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":189
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -35787,7 +35864,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3
__pyx_v_f = __pyx_t_4;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":190
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":190
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f:
* self.darray.write_enhanced_handle(f) # <<<<<<<<<<<<<<
@@ -35807,7 +35884,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":191
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":191
* with open(filename, "w") as f:
* self.darray.write_enhanced_handle(f)
* for a_i in self.sa: # <<<<<<<<<<<<<<
@@ -35852,7 +35929,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3
__pyx_v_a_i = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":192
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":192
* self.darray.write_enhanced_handle(f)
* for a_i in self.sa:
* f.write("%d " % a_i) # <<<<<<<<<<<<<<
@@ -35876,7 +35953,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":193
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":193
* for a_i in self.sa:
* f.write("%d " % a_i)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -35890,7 +35967,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":194
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":194
* f.write("%d " % a_i)
* f.write("\n")
* for w_i in self.ha: # <<<<<<<<<<<<<<
@@ -35935,7 +36012,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3
__pyx_v_w_i = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":195
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":195
* f.write("\n")
* for w_i in self.ha:
* f.write("%d " % w_i) # <<<<<<<<<<<<<<
@@ -35959,7 +36036,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":196
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":196
* for w_i in self.ha:
* f.write("%d " % w_i)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -35983,7 +36060,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":189
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":189
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -36081,7 +36158,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_14write_enhanced(struct __pyx_obj_3
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":198
+/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":198
* f.write("\n")
*
* cdef int __search_high(self, int word_id, int offset, int low, int high): # <<<<<<<<<<<<<<
@@ -36096,7 +36173,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_Suffix
int __pyx_t_1;
__Pyx_RefNannySetupContext("__search_high", 0);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":201
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":201
* cdef int midpoint
*
* if low >= high: # <<<<<<<<<<<<<<
@@ -36106,7 +36183,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_Suffix
__pyx_t_1 = (__pyx_v_low >= __pyx_v_high);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":202
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":202
*
* if low >= high:
* return high # <<<<<<<<<<<<<<
@@ -36119,7 +36196,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_Suffix
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":203
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":203
* if low >= high:
* return high
* midpoint = (high + low) / 2 # <<<<<<<<<<<<<<
@@ -36128,7 +36205,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_Suffix
*/
__pyx_v_midpoint = __Pyx_div_long((__pyx_v_high + __pyx_v_low), 2);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":204
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":204
* return high
* midpoint = (high + low) / 2
* if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id: # <<<<<<<<<<<<<<
@@ -36138,7 +36215,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_Suffix
__pyx_t_1 = ((__pyx_v_self->darray->data->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_offset)]) == __pyx_v_word_id);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":205
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":205
* midpoint = (high + low) / 2
* if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id:
* return self.__search_high(word_id, offset, midpoint+1, high) # <<<<<<<<<<<<<<
@@ -36151,7 +36228,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_Suffix
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":207
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":207
* return self.__search_high(word_id, offset, midpoint+1, high)
* else:
* return self.__search_high(word_id, offset, low, midpoint) # <<<<<<<<<<<<<<
@@ -36169,7 +36246,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_high(struct __pyx_obj_3_sa_Suffix
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":209
+/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":209
* return self.__search_high(word_id, offset, low, midpoint)
*
* cdef int __search_low(self, int word_id, int offset, int low, int high): # <<<<<<<<<<<<<<
@@ -36184,7 +36261,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixA
int __pyx_t_1;
__Pyx_RefNannySetupContext("__search_low", 0);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":212
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":212
* cdef int midpoint
*
* if low >= high: # <<<<<<<<<<<<<<
@@ -36194,7 +36271,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixA
__pyx_t_1 = (__pyx_v_low >= __pyx_v_high);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":213
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":213
*
* if low >= high:
* return high # <<<<<<<<<<<<<<
@@ -36207,7 +36284,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixA
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":214
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":214
* if low >= high:
* return high
* midpoint = (high + low) / 2 # <<<<<<<<<<<<<<
@@ -36216,7 +36293,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixA
*/
__pyx_v_midpoint = __Pyx_div_long((__pyx_v_high + __pyx_v_low), 2);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":215
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":215
* return high
* midpoint = (high + low) / 2
* if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id: # <<<<<<<<<<<<<<
@@ -36226,7 +36303,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixA
__pyx_t_1 = ((__pyx_v_self->darray->data->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_offset)]) == __pyx_v_word_id);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":216
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":216
* midpoint = (high + low) / 2
* if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id:
* return self.__search_low(word_id, offset, low, midpoint) # <<<<<<<<<<<<<<
@@ -36239,7 +36316,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixA
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":218
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":218
* return self.__search_low(word_id, offset, low, midpoint)
* else:
* return self.__search_low(word_id, offset, midpoint+1, high) # <<<<<<<<<<<<<<
@@ -36257,7 +36334,7 @@ static int __pyx_f_3_sa_11SuffixArray___search_low(struct __pyx_obj_3_sa_SuffixA
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":220
+/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":220
* return self.__search_low(word_id, offset, midpoint+1, high)
*
* cdef __get_range(self, int word_id, int offset, int low, int high, int midpoint): # <<<<<<<<<<<<<<
@@ -36276,7 +36353,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___get_range(struct __pyx_obj_3_sa_Su
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__get_range", 0);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":221
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":221
*
* cdef __get_range(self, int word_id, int offset, int low, int high, int midpoint):
* return (self.__search_low(word_id, offset, low, midpoint), # <<<<<<<<<<<<<<
@@ -36287,7 +36364,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___get_range(struct __pyx_obj_3_sa_Su
__pyx_t_1 = PyInt_FromLong(((struct __pyx_vtabstruct_3_sa_SuffixArray *)__pyx_v_self->__pyx_vtab)->__pyx___search_low(__pyx_v_self, __pyx_v_word_id, __pyx_v_offset, __pyx_v_low, __pyx_v_midpoint)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":222
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":222
* cdef __get_range(self, int word_id, int offset, int low, int high, int midpoint):
* return (self.__search_low(word_id, offset, low, midpoint),
* self.__search_high(word_id, offset, midpoint, high)) # <<<<<<<<<<<<<<
@@ -36322,7 +36399,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___get_range(struct __pyx_obj_3_sa_Su
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":224
+/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":224
* self.__search_high(word_id, offset, midpoint, high))
*
* cdef __lookup_helper(self, int word_id, int offset, int low, int high): # <<<<<<<<<<<<<<
@@ -36343,7 +36420,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__lookup_helper", 0);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":227
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":227
* cdef int midpoint
*
* if offset == 0: # <<<<<<<<<<<<<<
@@ -36353,7 +36430,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s
__pyx_t_1 = (__pyx_v_offset == 0);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":228
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":228
*
* if offset == 0:
* return (self.ha.arr[word_id], self.ha.arr[word_id+1]) # <<<<<<<<<<<<<<
@@ -36380,7 +36457,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":229
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":229
* if offset == 0:
* return (self.ha.arr[word_id], self.ha.arr[word_id+1])
* if low >= high: # <<<<<<<<<<<<<<
@@ -36390,7 +36467,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s
__pyx_t_1 = (__pyx_v_low >= __pyx_v_high);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":230
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":230
* return (self.ha.arr[word_id], self.ha.arr[word_id+1])
* if low >= high:
* return None # <<<<<<<<<<<<<<
@@ -36405,7 +36482,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":232
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":232
* return None
*
* midpoint = (high + low) / 2 # <<<<<<<<<<<<<<
@@ -36414,7 +36491,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s
*/
__pyx_v_midpoint = __Pyx_div_long((__pyx_v_high + __pyx_v_low), 2);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":233
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":233
*
* midpoint = (high + low) / 2
* if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id: # <<<<<<<<<<<<<<
@@ -36424,7 +36501,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s
__pyx_t_1 = ((__pyx_v_self->darray->data->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_offset)]) == __pyx_v_word_id);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":234
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":234
* midpoint = (high + low) / 2
* if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id:
* return self.__get_range(word_id, offset, low, high, midpoint) # <<<<<<<<<<<<<<
@@ -36441,7 +36518,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":235
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":235
* if self.darray.data.arr[self.sa.arr[midpoint] + offset] == word_id:
* return self.__get_range(word_id, offset, low, high, midpoint)
* if self.darray.data.arr[self.sa.arr[midpoint] + offset] > word_id: # <<<<<<<<<<<<<<
@@ -36451,7 +36528,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s
__pyx_t_1 = ((__pyx_v_self->darray->data->arr[((__pyx_v_self->sa->arr[__pyx_v_midpoint]) + __pyx_v_offset)]) > __pyx_v_word_id);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":236
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":236
* return self.__get_range(word_id, offset, low, high, midpoint)
* if self.darray.data.arr[self.sa.arr[midpoint] + offset] > word_id:
* return self.__lookup_helper(word_id, offset, low, midpoint) # <<<<<<<<<<<<<<
@@ -36468,7 +36545,7 @@ static PyObject *__pyx_f_3_sa_11SuffixArray___lookup_helper(struct __pyx_obj_3_s
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":238
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":238
* return self.__lookup_helper(word_id, offset, low, midpoint)
* else:
* return self.__lookup_helper(word_id, offset, midpoint+1, high) # <<<<<<<<<<<<<<
@@ -36572,7 +36649,7 @@ static PyObject *__pyx_pw_3_sa_11SuffixArray_17lookup(PyObject *__pyx_v_self, Py
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":240
+/* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":240
* return self.__lookup_helper(word_id, offset, midpoint+1, high)
*
* def lookup(self, word, int offset, int low, int high): # <<<<<<<<<<<<<<
@@ -36593,7 +36670,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_16lookup(struct __pyx_obj_3_sa_Suff
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("lookup", 0);
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":242
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":242
* def lookup(self, word, int offset, int low, int high):
* cdef int wordid
* if low == -1: # <<<<<<<<<<<<<<
@@ -36603,7 +36680,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_16lookup(struct __pyx_obj_3_sa_Suff
__pyx_t_1 = (__pyx_v_low == -1);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":243
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":243
* cdef int wordid
* if low == -1:
* low = 0 # <<<<<<<<<<<<<<
@@ -36615,7 +36692,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_16lookup(struct __pyx_obj_3_sa_Suff
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":244
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":244
* if low == -1:
* low = 0
* if high == -1: # <<<<<<<<<<<<<<
@@ -36625,7 +36702,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_16lookup(struct __pyx_obj_3_sa_Suff
__pyx_t_1 = (__pyx_v_high == -1);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":245
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":245
* low = 0
* if high == -1:
* high = len(self.sa) # <<<<<<<<<<<<<<
@@ -36641,7 +36718,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_16lookup(struct __pyx_obj_3_sa_Suff
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":246
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":246
* if high == -1:
* high = len(self.sa)
* if word in self.darray.word2id: # <<<<<<<<<<<<<<
@@ -36651,7 +36728,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_16lookup(struct __pyx_obj_3_sa_Suff
__pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_word, __pyx_v_self->darray->word2id, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":247
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":247
* high = len(self.sa)
* if word in self.darray.word2id:
* word_id = self.darray.word2id[word] # <<<<<<<<<<<<<<
@@ -36663,7 +36740,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_16lookup(struct __pyx_obj_3_sa_Suff
__pyx_v_word_id = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":248
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":248
* if word in self.darray.word2id:
* word_id = self.darray.word2id[word]
* return self.__lookup_helper(word_id, offset, low, high) # <<<<<<<<<<<<<<
@@ -36681,7 +36758,7 @@ static PyObject *__pyx_pf_3_sa_11SuffixArray_16lookup(struct __pyx_obj_3_sa_Suff
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":250
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":250
* return self.__lookup_helper(word_id, offset, low, high)
* else:
* return None # <<<<<<<<<<<<<<
@@ -36720,7 +36797,7 @@ static int __pyx_pw_3_sa_8TrieNode_1__cinit__(PyObject *__pyx_v_self, PyObject *
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":49
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":49
* cdef public children
*
* def __cinit__(self): # <<<<<<<<<<<<<<
@@ -36737,7 +36814,7 @@ static int __pyx_pf_3_sa_8TrieNode___cinit__(struct __pyx_obj_3_sa_TrieNode *__p
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":50
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":50
*
* def __cinit__(self):
* self.children = {} # <<<<<<<<<<<<<<
@@ -36774,7 +36851,7 @@ static PyObject *__pyx_pw_3_sa_8TrieNode_8children_1__get__(PyObject *__pyx_v_se
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":47
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":47
*
* cdef class TrieNode:
* cdef public children # <<<<<<<<<<<<<<
@@ -36863,7 +36940,7 @@ static int __pyx_pw_3_sa_16ExtendedTrieNode_1__cinit__(PyObject *__pyx_v_self, P
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__phrase,&__pyx_n_s__phrase_location,&__pyx_n_s__suffix_link,0};
PyObject* values[3] = {0,0,0};
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":57
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":57
* cdef public suffix_link
*
* def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None): # <<<<<<<<<<<<<<
@@ -36935,7 +37012,7 @@ static int __pyx_pf_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj_3_sa_Exte
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":58
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":58
*
* def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None):
* self.phrase = phrase # <<<<<<<<<<<<<<
@@ -36948,7 +37025,7 @@ static int __pyx_pf_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj_3_sa_Exte
__Pyx_DECREF(__pyx_v_self->phrase);
__pyx_v_self->phrase = __pyx_v_phrase;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":59
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":59
* def __cinit__(self, phrase=None, phrase_location=None, suffix_link=None):
* self.phrase = phrase
* self.phrase_location = phrase_location # <<<<<<<<<<<<<<
@@ -36961,7 +37038,7 @@ static int __pyx_pf_3_sa_16ExtendedTrieNode___cinit__(struct __pyx_obj_3_sa_Exte
__Pyx_DECREF(__pyx_v_self->phrase_location);
__pyx_v_self->phrase_location = __pyx_v_phrase_location;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":60
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":60
* self.phrase = phrase
* self.phrase_location = phrase_location
* self.suffix_link = suffix_link # <<<<<<<<<<<<<<
@@ -36990,7 +37067,7 @@ static PyObject *__pyx_pw_3_sa_16ExtendedTrieNode_6phrase_1__get__(PyObject *__p
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":53
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":53
*
* cdef class ExtendedTrieNode(TrieNode):
* cdef public phrase # <<<<<<<<<<<<<<
@@ -37077,7 +37154,7 @@ static PyObject *__pyx_pw_3_sa_16ExtendedTrieNode_15phrase_location_1__get__(PyO
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":54
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":54
* cdef class ExtendedTrieNode(TrieNode):
* cdef public phrase
* cdef public phrase_location # <<<<<<<<<<<<<<
@@ -37164,7 +37241,7 @@ static PyObject *__pyx_pw_3_sa_16ExtendedTrieNode_11suffix_link_1__get__(PyObjec
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":55
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":55
* cdef public phrase
* cdef public phrase_location
* cdef public suffix_link # <<<<<<<<<<<<<<
@@ -37292,7 +37369,7 @@ static int __pyx_pw_3_sa_9TrieTable_1__cinit__(PyObject *__pyx_v_self, PyObject
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":67
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":67
* cdef public int count
* cdef public root
* def __cinit__(self, extended=False): # <<<<<<<<<<<<<<
@@ -37311,7 +37388,7 @@ static int __pyx_pf_3_sa_9TrieTable___cinit__(struct __pyx_obj_3_sa_TrieTable *_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":68
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":68
* cdef public root
* def __cinit__(self, extended=False):
* self.count = 0 # <<<<<<<<<<<<<<
@@ -37320,7 +37397,7 @@ static int __pyx_pf_3_sa_9TrieTable___cinit__(struct __pyx_obj_3_sa_TrieTable *_
*/
__pyx_v_self->count = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":69
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":69
* def __cinit__(self, extended=False):
* self.count = 0
* self.extended = extended # <<<<<<<<<<<<<<
@@ -37330,7 +37407,7 @@ static int __pyx_pf_3_sa_9TrieTable___cinit__(struct __pyx_obj_3_sa_TrieTable *_
__pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_extended); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->extended = __pyx_t_1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":70
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":70
* self.count = 0
* self.extended = extended
* if extended: # <<<<<<<<<<<<<<
@@ -37340,7 +37417,7 @@ static int __pyx_pf_3_sa_9TrieTable___cinit__(struct __pyx_obj_3_sa_TrieTable *_
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_extended); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":71
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":71
* self.extended = extended
* if extended:
* self.root = ExtendedTrieNode() # <<<<<<<<<<<<<<
@@ -37358,7 +37435,7 @@ static int __pyx_pf_3_sa_9TrieTable___cinit__(struct __pyx_obj_3_sa_TrieTable *_
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":73
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":73
* self.root = ExtendedTrieNode()
* else:
* self.root = TrieNode() # <<<<<<<<<<<<<<
@@ -37397,7 +37474,7 @@ static PyObject *__pyx_pw_3_sa_9TrieTable_8extended_1__get__(PyObject *__pyx_v_s
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":64
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":64
*
* cdef class TrieTable:
* cdef public int extended # <<<<<<<<<<<<<<
@@ -37475,7 +37552,7 @@ static PyObject *__pyx_pw_3_sa_9TrieTable_5count_1__get__(PyObject *__pyx_v_self
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":65
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":65
* cdef class TrieTable:
* cdef public int extended
* cdef public int count # <<<<<<<<<<<<<<
@@ -37553,7 +37630,7 @@ static PyObject *__pyx_pw_3_sa_9TrieTable_4root_1__get__(PyObject *__pyx_v_self)
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":66
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":66
* cdef public int extended
* cdef public int count
* cdef public root # <<<<<<<<<<<<<<
@@ -37629,7 +37706,7 @@ static int __pyx_pf_3_sa_9TrieTable_4root_4__del__(struct __pyx_obj_3_sa_TrieTab
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":93
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":93
*
* # returns true if sent_id is contained
* cdef int contains(self, int sent_id): # <<<<<<<<<<<<<<
@@ -37642,7 +37719,7 @@ static int __pyx_f_3_sa_14PhraseLocation_contains(CYTHON_UNUSED struct __pyx_obj
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("contains", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":94
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":94
* # returns true if sent_id is contained
* cdef int contains(self, int sent_id):
* return 1 # <<<<<<<<<<<<<<
@@ -37674,7 +37751,7 @@ static int __pyx_pw_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v_self, PyO
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__sa_low,&__pyx_n_s__sa_high,&__pyx_n_s__arr_low,&__pyx_n_s__arr_high,&__pyx_n_s__arr,&__pyx_n_s__num_subpatterns,0};
PyObject* values[6] = {0,0,0,0,0,0};
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":97
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":97
*
* def __cinit__(self, int sa_low=-1, int sa_high=-1, int arr_low=-1, int arr_high=-1,
* arr=None, int num_subpatterns=1): # <<<<<<<<<<<<<<
@@ -37783,7 +37860,7 @@ static int __pyx_pw_3_sa_14PhraseLocation_1__cinit__(PyObject *__pyx_v_self, PyO
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":96
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":96
* return 1
*
* def __cinit__(self, int sa_low=-1, int sa_high=-1, int arr_low=-1, int arr_high=-1, # <<<<<<<<<<<<<<
@@ -37799,7 +37876,7 @@ static int __pyx_pf_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_3_sa_Phrase
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":98
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":98
* def __cinit__(self, int sa_low=-1, int sa_high=-1, int arr_low=-1, int arr_high=-1,
* arr=None, int num_subpatterns=1):
* self.sa_low = sa_low # <<<<<<<<<<<<<<
@@ -37808,7 +37885,7 @@ static int __pyx_pf_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_3_sa_Phrase
*/
__pyx_v_self->sa_low = __pyx_v_sa_low;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":99
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":99
* arr=None, int num_subpatterns=1):
* self.sa_low = sa_low
* self.sa_high = sa_high # <<<<<<<<<<<<<<
@@ -37817,7 +37894,7 @@ static int __pyx_pf_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_3_sa_Phrase
*/
__pyx_v_self->sa_high = __pyx_v_sa_high;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":100
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":100
* self.sa_low = sa_low
* self.sa_high = sa_high
* self.arr_low = arr_low # <<<<<<<<<<<<<<
@@ -37826,7 +37903,7 @@ static int __pyx_pf_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_3_sa_Phrase
*/
__pyx_v_self->arr_low = __pyx_v_arr_low;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":101
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":101
* self.sa_high = sa_high
* self.arr_low = arr_low
* self.arr_high = arr_high # <<<<<<<<<<<<<<
@@ -37835,7 +37912,7 @@ static int __pyx_pf_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_3_sa_Phrase
*/
__pyx_v_self->arr_high = __pyx_v_arr_high;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":102
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":102
* self.arr_low = arr_low
* self.arr_high = arr_high
* self.arr = arr # <<<<<<<<<<<<<<
@@ -37849,7 +37926,7 @@ static int __pyx_pf_3_sa_14PhraseLocation___cinit__(struct __pyx_obj_3_sa_Phrase
__Pyx_DECREF(((PyObject *)__pyx_v_self->arr));
__pyx_v_self->arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_v_arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":103
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":103
* self.arr_high = arr_high
* self.arr = arr
* self.num_subpatterns = num_subpatterns # <<<<<<<<<<<<<<
@@ -37929,7 +38006,7 @@ static int __pyx_pw_3_sa_7Sampler_1__cinit__(PyObject *__pyx_v_self, PyObject *_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":113
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":113
* cdef IntList sa
*
* def __cinit__(self, int sample_size, SuffixArray fsarray): # <<<<<<<<<<<<<<
@@ -37949,7 +38026,7 @@ static int __pyx_pf_3_sa_7Sampler___cinit__(struct __pyx_obj_3_sa_Sampler *__pyx
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":114
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":114
*
* def __cinit__(self, int sample_size, SuffixArray fsarray):
* self.sample_size = sample_size # <<<<<<<<<<<<<<
@@ -37958,7 +38035,7 @@ static int __pyx_pf_3_sa_7Sampler___cinit__(struct __pyx_obj_3_sa_Sampler *__pyx
*/
__pyx_v_self->sample_size = __pyx_v_sample_size;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":115
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":115
* def __cinit__(self, int sample_size, SuffixArray fsarray):
* self.sample_size = sample_size
* self.sa = fsarray.sa # <<<<<<<<<<<<<<
@@ -37971,7 +38048,7 @@ static int __pyx_pf_3_sa_7Sampler___cinit__(struct __pyx_obj_3_sa_Sampler *__pyx
__Pyx_DECREF(((PyObject *)__pyx_v_self->sa));
__pyx_v_self->sa = __pyx_v_fsarray->sa;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":116
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":116
* self.sample_size = sample_size
* self.sa = fsarray.sa
* if sample_size > 0: # <<<<<<<<<<<<<<
@@ -37981,7 +38058,7 @@ static int __pyx_pf_3_sa_7Sampler___cinit__(struct __pyx_obj_3_sa_Sampler *__pyx
__pyx_t_1 = (__pyx_v_sample_size > 0);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":117
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":117
* self.sa = fsarray.sa
* if sample_size > 0:
* logger.info("Sampling strategy: uniform, max sample size = %d", sample_size) # <<<<<<<<<<<<<<
@@ -38012,7 +38089,7 @@ static int __pyx_pf_3_sa_7Sampler___cinit__(struct __pyx_obj_3_sa_Sampler *__pyx
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":119
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":119
* logger.info("Sampling strategy: uniform, max sample size = %d", sample_size)
* else:
* logger.info("Sampling strategy: no sampling") # <<<<<<<<<<<<<<
@@ -38061,7 +38138,7 @@ static PyObject *__pyx_pw_3_sa_7Sampler_3sample(PyObject *__pyx_v_self, PyObject
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":121
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":121
* logger.info("Sampling strategy: no sampling")
*
* def sample(self, PhraseLocation phrase_location): # <<<<<<<<<<<<<<
@@ -38088,7 +38165,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("sample", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":134
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":134
* cdef int num_locations, val, j
*
* sample = IntList() # <<<<<<<<<<<<<<
@@ -38100,7 +38177,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
__pyx_v_sample = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":135
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":135
*
* sample = IntList()
* if phrase_location.arr is None: # <<<<<<<<<<<<<<
@@ -38110,7 +38187,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
__pyx_t_2 = (((PyObject *)__pyx_v_phrase_location->arr) == Py_None);
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":136
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":136
* sample = IntList()
* if phrase_location.arr is None:
* num_locations = phrase_location.sa_high - phrase_location.sa_low # <<<<<<<<<<<<<<
@@ -38119,7 +38196,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
*/
__pyx_v_num_locations = (__pyx_v_phrase_location->sa_high - __pyx_v_phrase_location->sa_low);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":137
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":137
* if phrase_location.arr is None:
* num_locations = phrase_location.sa_high - phrase_location.sa_low
* if self.sample_size == -1 or num_locations <= self.sample_size: # <<<<<<<<<<<<<<
@@ -38135,7 +38212,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
}
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":138
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":138
* num_locations = phrase_location.sa_high - phrase_location.sa_low
* if self.sample_size == -1 or num_locations <= self.sample_size:
* sample._extend_arr(self.sa.arr + phrase_location.sa_low, num_locations) # <<<<<<<<<<<<<<
@@ -38147,7 +38224,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":140
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":140
* sample._extend_arr(self.sa.arr + phrase_location.sa_low, num_locations)
* else:
* stepsize = float(num_locations)/float(self.sample_size) # <<<<<<<<<<<<<<
@@ -38160,7 +38237,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
}
__pyx_v_stepsize = (((double)__pyx_v_num_locations) / ((double)__pyx_v_self->sample_size));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":141
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":141
* else:
* stepsize = float(num_locations)/float(self.sample_size)
* i = phrase_location.sa_low # <<<<<<<<<<<<<<
@@ -38169,7 +38246,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
*/
__pyx_v_i = __pyx_v_phrase_location->sa_low;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":142
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":142
* stepsize = float(num_locations)/float(self.sample_size)
* i = phrase_location.sa_low
* while i < phrase_location.sa_high and sample.len < self.sample_size: # <<<<<<<<<<<<<<
@@ -38186,7 +38263,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
}
if (!__pyx_t_3) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":145
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":145
* '''Note: int(i) not guaranteed to have the desired
* effect, according to the python documentation'''
* if fmod(i,1.0) > 0.5: # <<<<<<<<<<<<<<
@@ -38196,7 +38273,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
__pyx_t_3 = (fmod(__pyx_v_i, 1.0) > 0.5);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":146
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":146
* effect, according to the python documentation'''
* if fmod(i,1.0) > 0.5:
* val = int(ceil(i)) # <<<<<<<<<<<<<<
@@ -38208,7 +38285,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":148
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":148
* val = int(ceil(i))
* else:
* val = int(floor(i)) # <<<<<<<<<<<<<<
@@ -38219,7 +38296,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
}
__pyx_L7:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":149
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":149
* else:
* val = int(floor(i))
* sample._append(self.sa.arr[val]) # <<<<<<<<<<<<<<
@@ -38228,7 +38305,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_sample->__pyx_vtab)->_append(__pyx_v_sample, (__pyx_v_self->sa->arr[__pyx_v_val]));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":150
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":150
* val = int(floor(i))
* sample._append(self.sa.arr[val])
* i = i + stepsize # <<<<<<<<<<<<<<
@@ -38243,7 +38320,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":152
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":152
* i = i + stepsize
* else:
* num_locations = (phrase_location.arr_high - phrase_location.arr_low) / phrase_location.num_subpatterns # <<<<<<<<<<<<<<
@@ -38261,7 +38338,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
}
__pyx_v_num_locations = __Pyx_div_int(__pyx_t_5, __pyx_v_phrase_location->num_subpatterns);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":153
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":153
* else:
* num_locations = (phrase_location.arr_high - phrase_location.arr_low) / phrase_location.num_subpatterns
* if self.sample_size == -1 or num_locations <= self.sample_size: # <<<<<<<<<<<<<<
@@ -38277,7 +38354,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
}
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":154
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":154
* num_locations = (phrase_location.arr_high - phrase_location.arr_low) / phrase_location.num_subpatterns
* if self.sample_size == -1 or num_locations <= self.sample_size:
* sample = phrase_location.arr # <<<<<<<<<<<<<<
@@ -38291,7 +38368,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":156
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":156
* sample = phrase_location.arr
* else:
* stepsize = float(num_locations)/float(self.sample_size) # <<<<<<<<<<<<<<
@@ -38304,7 +38381,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
}
__pyx_v_stepsize = (((double)__pyx_v_num_locations) / ((double)__pyx_v_self->sample_size));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":157
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":157
* else:
* stepsize = float(num_locations)/float(self.sample_size)
* i = phrase_location.arr_low # <<<<<<<<<<<<<<
@@ -38313,7 +38390,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
*/
__pyx_v_i = __pyx_v_phrase_location->arr_low;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":158
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":158
* stepsize = float(num_locations)/float(self.sample_size)
* i = phrase_location.arr_low
* while i < num_locations and sample.len < self.sample_size * phrase_location.num_subpatterns: # <<<<<<<<<<<<<<
@@ -38330,7 +38407,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
}
if (!__pyx_t_4) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":161
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":161
* '''Note: int(i) not guaranteed to have the desired
* effect, according to the python documentation'''
* if fmod(i,1.0) > 0.5: # <<<<<<<<<<<<<<
@@ -38340,7 +38417,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
__pyx_t_4 = (fmod(__pyx_v_i, 1.0) > 0.5);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":162
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":162
* effect, according to the python documentation'''
* if fmod(i,1.0) > 0.5:
* val = int(ceil(i)) # <<<<<<<<<<<<<<
@@ -38352,7 +38429,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":164
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":164
* val = int(ceil(i))
* else:
* val = int(floor(i)) # <<<<<<<<<<<<<<
@@ -38363,7 +38440,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
}
__pyx_L11:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":165
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":165
* else:
* val = int(floor(i))
* j = phrase_location.arr_low + (val*phrase_location.num_subpatterns) # <<<<<<<<<<<<<<
@@ -38372,7 +38449,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
*/
__pyx_v_j = (__pyx_v_phrase_location->arr_low + (__pyx_v_val * __pyx_v_phrase_location->num_subpatterns));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":166
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":166
* val = int(floor(i))
* j = phrase_location.arr_low + (val*phrase_location.num_subpatterns)
* sample._extend_arr(phrase_location.arr.arr + j, phrase_location.num_subpatterns) # <<<<<<<<<<<<<<
@@ -38381,7 +38458,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_sample->__pyx_vtab)->_extend_arr(__pyx_v_sample, (__pyx_v_phrase_location->arr->arr + __pyx_v_j), __pyx_v_phrase_location->num_subpatterns);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":167
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":167
* j = phrase_location.arr_low + (val*phrase_location.num_subpatterns)
* sample._extend_arr(phrase_location.arr.arr + j, phrase_location.num_subpatterns)
* i = i + stepsize # <<<<<<<<<<<<<<
@@ -38395,7 +38472,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":168
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":168
* sample._extend_arr(phrase_location.arr.arr + j, phrase_location.num_subpatterns)
* i = i + stepsize
* return sample # <<<<<<<<<<<<<<
@@ -38420,7 +38497,7 @@ static PyObject *__pyx_pf_3_sa_7Sampler_2sample(struct __pyx_obj_3_sa_Sampler *_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":180
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":180
*
*
* cdef void assign_matching(Matching* m, int* arr, int start, int step, int* sent_id_arr): # <<<<<<<<<<<<<<
@@ -38432,7 +38509,7 @@ static void __pyx_f_3_sa_assign_matching(struct __pyx_t_3_sa_Matching *__pyx_v_m
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("assign_matching", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":181
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":181
*
* cdef void assign_matching(Matching* m, int* arr, int start, int step, int* sent_id_arr):
* m.arr = arr # <<<<<<<<<<<<<<
@@ -38441,7 +38518,7 @@ static void __pyx_f_3_sa_assign_matching(struct __pyx_t_3_sa_Matching *__pyx_v_m
*/
__pyx_v_m->arr = __pyx_v_arr;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":182
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":182
* cdef void assign_matching(Matching* m, int* arr, int start, int step, int* sent_id_arr):
* m.arr = arr
* m.start = start # <<<<<<<<<<<<<<
@@ -38450,7 +38527,7 @@ static void __pyx_f_3_sa_assign_matching(struct __pyx_t_3_sa_Matching *__pyx_v_m
*/
__pyx_v_m->start = __pyx_v_start;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":183
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":183
* m.arr = arr
* m.start = start
* m.end = start + step # <<<<<<<<<<<<<<
@@ -38459,7 +38536,7 @@ static void __pyx_f_3_sa_assign_matching(struct __pyx_t_3_sa_Matching *__pyx_v_m
*/
__pyx_v_m->end = (__pyx_v_start + __pyx_v_step);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":184
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":184
* m.start = start
* m.end = start + step
* m.sent_id = sent_id_arr[arr[start]] # <<<<<<<<<<<<<<
@@ -38468,7 +38545,7 @@ static void __pyx_f_3_sa_assign_matching(struct __pyx_t_3_sa_Matching *__pyx_v_m
*/
__pyx_v_m->sent_id = (__pyx_v_sent_id_arr[(__pyx_v_arr[__pyx_v_start])]);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":185
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":185
* m.end = start + step
* m.sent_id = sent_id_arr[arr[start]]
* m.size = step # <<<<<<<<<<<<<<
@@ -38480,7 +38557,7 @@ static void __pyx_f_3_sa_assign_matching(struct __pyx_t_3_sa_Matching *__pyx_v_m
__Pyx_RefNannyFinishContext();
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":188
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":188
*
*
* cdef int* append_combined_matching(int* arr, Matching* loc1, Matching* loc2, # <<<<<<<<<<<<<<
@@ -38497,7 +38574,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx
int __pyx_t_2;
__Pyx_RefNannySetupContext("append_combined_matching", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":192
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":192
* cdef int i, new_len
*
* new_len = result_len[0] + num_subpatterns # <<<<<<<<<<<<<<
@@ -38506,7 +38583,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx
*/
__pyx_v_new_len = ((__pyx_v_result_len[0]) + __pyx_v_num_subpatterns);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":193
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":193
*
* new_len = result_len[0] + num_subpatterns
* arr = <int*> realloc(arr, new_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -38515,7 +38592,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx
*/
__pyx_v_arr = ((int *)realloc(__pyx_v_arr, (__pyx_v_new_len * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":195
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":195
* arr = <int*> realloc(arr, new_len*sizeof(int))
*
* for i from 0 <= i < loc1.size: # <<<<<<<<<<<<<<
@@ -38525,7 +38602,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx
__pyx_t_1 = __pyx_v_loc1->size;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":196
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":196
*
* for i from 0 <= i < loc1.size:
* arr[result_len[0]+i] = loc1.arr[loc1.start+i] # <<<<<<<<<<<<<<
@@ -38535,7 +38612,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx
(__pyx_v_arr[((__pyx_v_result_len[0]) + __pyx_v_i)]) = (__pyx_v_loc1->arr[(__pyx_v_loc1->start + __pyx_v_i)]);
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":197
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":197
* for i from 0 <= i < loc1.size:
* arr[result_len[0]+i] = loc1.arr[loc1.start+i]
* if num_subpatterns > loc1.size: # <<<<<<<<<<<<<<
@@ -38545,7 +38622,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx
__pyx_t_2 = (__pyx_v_num_subpatterns > __pyx_v_loc1->size);
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":198
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":198
* arr[result_len[0]+i] = loc1.arr[loc1.start+i]
* if num_subpatterns > loc1.size:
* arr[new_len-1] = loc2.arr[loc2.end-1] # <<<<<<<<<<<<<<
@@ -38557,7 +38634,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":199
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":199
* if num_subpatterns > loc1.size:
* arr[new_len-1] = loc2.arr[loc2.end-1]
* result_len[0] = new_len # <<<<<<<<<<<<<<
@@ -38566,7 +38643,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx
*/
(__pyx_v_result_len[0]) = __pyx_v_new_len;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":200
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":200
* arr[new_len-1] = loc2.arr[loc2.end-1]
* result_len[0] = new_len
* return arr # <<<<<<<<<<<<<<
@@ -38582,7 +38659,7 @@ static int *__pyx_f_3_sa_append_combined_matching(int *__pyx_v_arr, struct __pyx
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":203
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":203
*
*
* cdef int* extend_arr(int* arr, int* arr_len, int* appendix, int appendix_len): # <<<<<<<<<<<<<<
@@ -38596,7 +38673,7 @@ static int *__pyx_f_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr_len, int
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("extend_arr", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":206
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":206
* cdef int new_len
*
* new_len = arr_len[0] + appendix_len # <<<<<<<<<<<<<<
@@ -38605,7 +38682,7 @@ static int *__pyx_f_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr_len, int
*/
__pyx_v_new_len = ((__pyx_v_arr_len[0]) + __pyx_v_appendix_len);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":207
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":207
*
* new_len = arr_len[0] + appendix_len
* arr = <int*> realloc(arr, new_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -38614,7 +38691,7 @@ static int *__pyx_f_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr_len, int
*/
__pyx_v_arr = ((int *)realloc(__pyx_v_arr, (__pyx_v_new_len * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":208
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":208
* new_len = arr_len[0] + appendix_len
* arr = <int*> realloc(arr, new_len*sizeof(int))
* memcpy(arr+arr_len[0], appendix, appendix_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -38623,7 +38700,7 @@ static int *__pyx_f_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr_len, int
*/
memcpy((__pyx_v_arr + (__pyx_v_arr_len[0])), __pyx_v_appendix, (__pyx_v_appendix_len * (sizeof(int))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":209
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":209
* arr = <int*> realloc(arr, new_len*sizeof(int))
* memcpy(arr+arr_len[0], appendix, appendix_len*sizeof(int))
* arr_len[0] = new_len # <<<<<<<<<<<<<<
@@ -38632,7 +38709,7 @@ static int *__pyx_f_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr_len, int
*/
(__pyx_v_arr_len[0]) = __pyx_v_new_len;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":210
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":210
* memcpy(arr+arr_len[0], appendix, appendix_len*sizeof(int))
* arr_len[0] = new_len
* return arr # <<<<<<<<<<<<<<
@@ -38648,7 +38725,7 @@ static int *__pyx_f_3_sa_extend_arr(int *__pyx_v_arr, int *__pyx_v_arr_len, int
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":212
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":212
* return arr
*
* cdef int median(int low, int high, int step): # <<<<<<<<<<<<<<
@@ -38665,7 +38742,7 @@ static int __pyx_f_3_sa_median(int __pyx_v_low, int __pyx_v_high, int __pyx_v_st
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("median", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":213
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":213
*
* cdef int median(int low, int high, int step):
* return low + (((high - low)/step)/2)*step # <<<<<<<<<<<<<<
@@ -38694,7 +38771,7 @@ static int __pyx_f_3_sa_median(int __pyx_v_low, int __pyx_v_high, int __pyx_v_st
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":216
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":216
*
*
* cdef void find_comparable_matchings(int low, int high, int* arr, int step, int loc, int* loc_minus, int* loc_plus): # <<<<<<<<<<<<<<
@@ -38709,7 +38786,7 @@ static void __pyx_f_3_sa_find_comparable_matchings(int __pyx_v_low, int __pyx_v_
int __pyx_t_3;
__Pyx_RefNannySetupContext("find_comparable_matchings", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":220
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":220
* # in which all matchings have the same first index as the one
* # starting at loc
* loc_plus[0] = loc + step # <<<<<<<<<<<<<<
@@ -38718,7 +38795,7 @@ static void __pyx_f_3_sa_find_comparable_matchings(int __pyx_v_low, int __pyx_v_
*/
(__pyx_v_loc_plus[0]) = (__pyx_v_loc + __pyx_v_step);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":221
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":221
* # starting at loc
* loc_plus[0] = loc + step
* while loc_plus[0] < high and arr[loc_plus[0]] == arr[loc]: # <<<<<<<<<<<<<<
@@ -38735,7 +38812,7 @@ static void __pyx_f_3_sa_find_comparable_matchings(int __pyx_v_low, int __pyx_v_
}
if (!__pyx_t_3) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":222
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":222
* loc_plus[0] = loc + step
* while loc_plus[0] < high and arr[loc_plus[0]] == arr[loc]:
* loc_plus[0] = loc_plus[0] + step # <<<<<<<<<<<<<<
@@ -38745,7 +38822,7 @@ static void __pyx_f_3_sa_find_comparable_matchings(int __pyx_v_low, int __pyx_v_
(__pyx_v_loc_plus[0]) = ((__pyx_v_loc_plus[0]) + __pyx_v_step);
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":223
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":223
* while loc_plus[0] < high and arr[loc_plus[0]] == arr[loc]:
* loc_plus[0] = loc_plus[0] + step
* loc_minus[0] = loc # <<<<<<<<<<<<<<
@@ -38754,7 +38831,7 @@ static void __pyx_f_3_sa_find_comparable_matchings(int __pyx_v_low, int __pyx_v_
*/
(__pyx_v_loc_minus[0]) = __pyx_v_loc;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":224
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":224
* loc_plus[0] = loc_plus[0] + step
* loc_minus[0] = loc
* while loc_minus[0]-step >= low and arr[loc_minus[0]-step] == arr[loc]: # <<<<<<<<<<<<<<
@@ -38771,7 +38848,7 @@ static void __pyx_f_3_sa_find_comparable_matchings(int __pyx_v_low, int __pyx_v_
}
if (!__pyx_t_2) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":225
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":225
* loc_minus[0] = loc
* while loc_minus[0]-step >= low and arr[loc_minus[0]-step] == arr[loc]:
* loc_minus[0] = loc_minus[0] - step # <<<<<<<<<<<<<<
@@ -38815,7 +38892,7 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__alignment,&__pyx_n_s__by_slack_factor,&__pyx_n_s__category,&__pyx_n_s__max_chunks,&__pyx_n_s__max_initial_size,&__pyx_n_s__max_length,&__pyx_n_s__max_nonterminals,&__pyx_n_s__max_target_chunks,&__pyx_n_s__max_target_length,&__pyx_n_s__min_gap_size,&__pyx_n_s__precompute_file,&__pyx_n_s_70,&__pyx_n_s__precompute_rank,&__pyx_n_s_103,&__pyx_n_s_104,&__pyx_n_s_71,&__pyx_n_s__train_min_gap_size,&__pyx_n_s__tight_phrases,&__pyx_n_s__use_baeza_yates,&__pyx_n_s__use_collocations,&__pyx_n_s__use_index,0};
PyObject* values[21] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":295
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":296
* char* category="[X]",
* # maximum number of contiguous chunks of terminal symbols in RHS of a rule. If None, defaults to max_nonterminals+1
* max_chunks=None, # <<<<<<<<<<<<<<
@@ -38824,7 +38901,7 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
*/
values[3] = ((PyObject *)Py_None);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":303
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":304
* unsigned max_nonterminals=2,
* # maximum number of contiguous chunks of terminal symbols in target-side RHS of a rule. If None, defaults to max_nonterminals+1
* max_target_chunks=None, # <<<<<<<<<<<<<<
@@ -38833,7 +38910,7 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
*/
values[7] = ((PyObject *)Py_None);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":305
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":306
* max_target_chunks=None,
* # maximum number of target side symbols (both T and NT) allowed in a rule. If None, defaults to max_initial_size
* max_target_length=None, # <<<<<<<<<<<<<<
@@ -38842,7 +38919,7 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
*/
values[8] = ((PyObject *)Py_None);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":309
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":310
* unsigned min_gap_size=2,
* # filename of file containing precomputed collocations
* precompute_file=None, # <<<<<<<<<<<<<<
@@ -38985,7 +39062,7 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -39016,10 +39093,10 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
}
__pyx_v_alignment = ((struct __pyx_obj_3_sa_Alignment *)values[0]);
if (values[1]) {
- __pyx_v_by_slack_factor = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_by_slack_factor == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_by_slack_factor = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_by_slack_factor == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":291
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":292
* Alignment alignment,
* # parameter for double-binary search; doesn't seem to matter much
* float by_slack_factor=1.0, # <<<<<<<<<<<<<<
@@ -39029,49 +39106,49 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
__pyx_v_by_slack_factor = ((float)1.0);
}
if (values[2]) {
- __pyx_v_category = PyBytes_AsString(values[2]); if (unlikely((!__pyx_v_category) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_category = PyBytes_AsString(values[2]); if (unlikely((!__pyx_v_category) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_category = ((char *)__pyx_k_105);
}
__pyx_v_max_chunks = values[3];
if (values[4]) {
- __pyx_v_max_initial_size = __Pyx_PyInt_AsUnsignedInt(values[4]); if (unlikely((__pyx_v_max_initial_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_max_initial_size = __Pyx_PyInt_AsUnsignedInt(values[4]); if (unlikely((__pyx_v_max_initial_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_max_initial_size = ((unsigned int)10);
}
if (values[5]) {
- __pyx_v_max_length = __Pyx_PyInt_AsUnsignedInt(values[5]); if (unlikely((__pyx_v_max_length == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_max_length = __Pyx_PyInt_AsUnsignedInt(values[5]); if (unlikely((__pyx_v_max_length == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_max_length = ((unsigned int)5);
}
if (values[6]) {
- __pyx_v_max_nonterminals = __Pyx_PyInt_AsUnsignedInt(values[6]); if (unlikely((__pyx_v_max_nonterminals == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_max_nonterminals = __Pyx_PyInt_AsUnsignedInt(values[6]); if (unlikely((__pyx_v_max_nonterminals == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_max_nonterminals = ((unsigned int)2);
}
__pyx_v_max_target_chunks = values[7];
__pyx_v_max_target_length = values[8];
if (values[9]) {
- __pyx_v_min_gap_size = __Pyx_PyInt_AsUnsignedInt(values[9]); if (unlikely((__pyx_v_min_gap_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_min_gap_size = __Pyx_PyInt_AsUnsignedInt(values[9]); if (unlikely((__pyx_v_min_gap_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_min_gap_size = ((unsigned int)2);
}
__pyx_v_precompute_file = values[10];
if (values[11]) {
- __pyx_v_precompute_secondary_rank = __Pyx_PyInt_AsUnsignedInt(values[11]); if (unlikely((__pyx_v_precompute_secondary_rank == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_precompute_secondary_rank = __Pyx_PyInt_AsUnsignedInt(values[11]); if (unlikely((__pyx_v_precompute_secondary_rank == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_precompute_secondary_rank = ((unsigned int)20);
}
if (values[12]) {
- __pyx_v_precompute_rank = __Pyx_PyInt_AsUnsignedInt(values[12]); if (unlikely((__pyx_v_precompute_rank == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_precompute_rank = __Pyx_PyInt_AsUnsignedInt(values[12]); if (unlikely((__pyx_v_precompute_rank == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_precompute_rank = ((unsigned int)100);
}
if (values[13]) {
- __pyx_v_require_aligned_terminal = __Pyx_PyObject_IsTrue(values[13]); if (unlikely((__pyx_v_require_aligned_terminal == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_require_aligned_terminal = __Pyx_PyObject_IsTrue(values[13]); if (unlikely((__pyx_v_require_aligned_terminal == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":315
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":316
* unsigned precompute_rank=100,
* # require extracted rules to have at least one aligned word
* bint require_aligned_terminal=True, # <<<<<<<<<<<<<<
@@ -39081,10 +39158,10 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
__pyx_v_require_aligned_terminal = ((int)1);
}
if (values[14]) {
- __pyx_v_require_aligned_chunks = __Pyx_PyObject_IsTrue(values[14]); if (unlikely((__pyx_v_require_aligned_chunks == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_require_aligned_chunks = __Pyx_PyObject_IsTrue(values[14]); if (unlikely((__pyx_v_require_aligned_chunks == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":317
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":318
* bint require_aligned_terminal=True,
* # require each contiguous chunk of extracted rules to have at least one aligned word
* bint require_aligned_chunks=False, # <<<<<<<<<<<<<<
@@ -39094,20 +39171,20 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
__pyx_v_require_aligned_chunks = ((int)0);
}
if (values[15]) {
- __pyx_v_train_max_initial_size = __Pyx_PyInt_AsUnsignedInt(values[15]); if (unlikely((__pyx_v_train_max_initial_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_train_max_initial_size = __Pyx_PyInt_AsUnsignedInt(values[15]); if (unlikely((__pyx_v_train_max_initial_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_train_max_initial_size = ((unsigned int)10);
}
if (values[16]) {
- __pyx_v_train_min_gap_size = __Pyx_PyInt_AsUnsignedInt(values[16]); if (unlikely((__pyx_v_train_min_gap_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_train_min_gap_size = __Pyx_PyInt_AsUnsignedInt(values[16]); if (unlikely((__pyx_v_train_min_gap_size == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
__pyx_v_train_min_gap_size = ((unsigned int)2);
}
if (values[17]) {
- __pyx_v_tight_phrases = __Pyx_PyObject_IsTrue(values[17]); if (unlikely((__pyx_v_tight_phrases == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_tight_phrases = __Pyx_PyObject_IsTrue(values[17]); if (unlikely((__pyx_v_tight_phrases == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":323
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":324
* unsigned train_min_gap_size=2,
* # False if phrases should be loose (better but slower), True otherwise
* bint tight_phrases=True, # <<<<<<<<<<<<<<
@@ -39117,10 +39194,10 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
__pyx_v_tight_phrases = ((int)1);
}
if (values[18]) {
- __pyx_v_use_baeza_yates = __Pyx_PyObject_IsTrue(values[18]); if (unlikely((__pyx_v_use_baeza_yates == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_use_baeza_yates = __Pyx_PyObject_IsTrue(values[18]); if (unlikely((__pyx_v_use_baeza_yates == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":325
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":326
* bint tight_phrases=True,
* # True to require use of double-binary alg, false otherwise
* bint use_baeza_yates=True, # <<<<<<<<<<<<<<
@@ -39130,10 +39207,10 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
__pyx_v_use_baeza_yates = ((int)1);
}
if (values[19]) {
- __pyx_v_use_collocations = __Pyx_PyObject_IsTrue(values[19]); if (unlikely((__pyx_v_use_collocations == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_use_collocations = __Pyx_PyObject_IsTrue(values[19]); if (unlikely((__pyx_v_use_collocations == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":327
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":328
* bint use_baeza_yates=True,
* # True to enable used of precomputed collocations
* bint use_collocations=True, # <<<<<<<<<<<<<<
@@ -39143,10 +39220,10 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
__pyx_v_use_collocations = ((int)1);
}
if (values[20]) {
- __pyx_v_use_index = __Pyx_PyObject_IsTrue(values[20]); if (unlikely((__pyx_v_use_index == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_use_index = __Pyx_PyObject_IsTrue(values[20]); if (unlikely((__pyx_v_use_index == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
} else {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":329
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":330
* bint use_collocations=True,
* # True to enable use of precomputed inverted indices
* bint use_index=True): # <<<<<<<<<<<<<<
@@ -39158,13 +39235,13 @@ static int __pyx_pw_3_sa_23HieroCachingRuleFactory_1__cinit__(PyObject *__pyx_v_
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 21, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 21, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alignment), __pyx_ptype_3_sa_Alignment, 1, "alignment", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alignment), __pyx_ptype_3_sa_Alignment, 1, "alignment", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(((struct __pyx_obj_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_alignment, __pyx_v_by_slack_factor, __pyx_v_category, __pyx_v_max_chunks, __pyx_v_max_initial_size, __pyx_v_max_length, __pyx_v_max_nonterminals, __pyx_v_max_target_chunks, __pyx_v_max_target_length, __pyx_v_min_gap_size, __pyx_v_precompute_file, __pyx_v_precompute_secondary_rank, __pyx_v_precompute_rank, __pyx_v_require_aligned_terminal, __pyx_v_require_aligned_chunks, __pyx_v_train_max_initial_size, __pyx_v_train_min_gap_size, __pyx_v_tight_phrases, __pyx_v_use_baeza_yates, __pyx_v_use_collocations, __pyx_v_use_index);
goto __pyx_L0;
__pyx_L1_error:;
@@ -39186,7 +39263,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9__cinit___lambda1(PyOb
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":405
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":406
* self.phrases_f = defaultdict(int)
* self.phrases_e = defaultdict(int)
* self.phrases_fe = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<<
@@ -39205,14 +39282,14 @@ static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("lambda1", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyInt_Type))));
__Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
@@ -39246,7 +39323,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9__cinit___1lambda2(PyO
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":406
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":407
* self.phrases_e = defaultdict(int)
* self.phrases_fe = defaultdict(lambda: defaultdict(int))
* self.phrases_al = defaultdict(lambda: defaultdict(tuple)) # <<<<<<<<<<<<<<
@@ -39265,14 +39342,14 @@ static PyObject *__pyx_lambda_funcdef_lambda2(CYTHON_UNUSED PyObject *__pyx_self
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("lambda2", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)((PyObject*)(&PyTuple_Type))));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyTuple_Type))));
__Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyTuple_Type))));
- __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
@@ -39306,7 +39383,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9__cinit___2lambda3(PyO
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":411
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":412
* self.bilex_f = defaultdict(int)
* self.bilex_e = defaultdict(int)
* self.bilex_fe = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<<
@@ -39325,14 +39402,14 @@ static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("lambda3", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyInt_Type))));
__Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
@@ -39354,7 +39431,7 @@ static PyObject *__pyx_lambda_funcdef_lambda3(CYTHON_UNUSED PyObject *__pyx_self
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":287
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":288
* cdef bilex_fe
*
* def __cinit__(self, # <<<<<<<<<<<<<<
@@ -39375,21 +39452,21 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":335
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":336
* respectively. This is because Chiang's model does not require
* them to be the same, therefore we don't either.'''
* self.rules = TrieTable(True) # cache # <<<<<<<<<<<<<<
* self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation())
* if alignment is None:
*/
- __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_TrieTable)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_TrieTable)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__Pyx_GIVEREF(__pyx_t_1);
@@ -39398,20 +39475,20 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_v_self->rules = ((struct __pyx_obj_3_sa_TrieTable *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":336
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":337
* them to be the same, therefore we don't either.'''
* self.rules = TrieTable(True) # cache
* self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) # <<<<<<<<<<<<<<
* if alignment is None:
* raise Exception("Must specify an alignment object")
*/
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_GIVEREF(__pyx_t_2);
@@ -39420,7 +39497,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_v_self->rules->root = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":337
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":338
* self.rules = TrieTable(True) # cache
* self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation())
* if alignment is None: # <<<<<<<<<<<<<<
@@ -39430,23 +39507,23 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_t_3 = (((PyObject *)__pyx_v_alignment) == Py_None);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":338
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":339
* self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation())
* if alignment is None:
* raise Exception("Must specify an alignment object") # <<<<<<<<<<<<<<
* self.alignment = alignment
*
*/
- __pyx_t_2 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_107), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_107), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L3;
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":339
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":340
* if alignment is None:
* raise Exception("Must specify an alignment object")
* self.alignment = alignment # <<<<<<<<<<<<<<
@@ -39459,7 +39536,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__Pyx_DECREF(((PyObject *)__pyx_v_self->alignment));
__pyx_v_self->alignment = __pyx_v_alignment;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":343
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":344
* # grammar parameters and settings
* # NOTE: setting max_nonterminals > 2 is not currently supported in Hiero
* self.max_length = max_length # <<<<<<<<<<<<<<
@@ -39468,7 +39545,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->max_length = __pyx_v_max_length;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":344
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":345
* # NOTE: setting max_nonterminals > 2 is not currently supported in Hiero
* self.max_length = max_length
* self.max_nonterminals = max_nonterminals # <<<<<<<<<<<<<<
@@ -39477,7 +39554,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->max_nonterminals = __pyx_v_max_nonterminals;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":345
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":346
* self.max_length = max_length
* self.max_nonterminals = max_nonterminals
* self.max_initial_size = max_initial_size # <<<<<<<<<<<<<<
@@ -39486,7 +39563,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->max_initial_size = __pyx_v_max_initial_size;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":346
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":347
* self.max_nonterminals = max_nonterminals
* self.max_initial_size = max_initial_size
* self.train_max_initial_size = train_max_initial_size # <<<<<<<<<<<<<<
@@ -39495,7 +39572,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->train_max_initial_size = __pyx_v_train_max_initial_size;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":347
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":348
* self.max_initial_size = max_initial_size
* self.train_max_initial_size = train_max_initial_size
* self.min_gap_size = min_gap_size # <<<<<<<<<<<<<<
@@ -39504,7 +39581,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->min_gap_size = __pyx_v_min_gap_size;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":348
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":349
* self.train_max_initial_size = train_max_initial_size
* self.min_gap_size = min_gap_size
* self.train_min_gap_size = train_min_gap_size # <<<<<<<<<<<<<<
@@ -39513,7 +39590,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->train_min_gap_size = __pyx_v_train_min_gap_size;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":349
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":350
* self.min_gap_size = min_gap_size
* self.train_min_gap_size = train_min_gap_size
* self.category = sym_fromstring(category, False) # <<<<<<<<<<<<<<
@@ -39522,7 +39599,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->category = __pyx_f_3_sa_sym_fromstring(__pyx_v_category, 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":351
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":352
* self.category = sym_fromstring(category, False)
*
* if max_chunks is None: # <<<<<<<<<<<<<<
@@ -39532,7 +39609,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_t_3 = (__pyx_v_max_chunks == Py_None);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":352
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":353
*
* if max_chunks is None:
* self.max_chunks = self.max_nonterminals + 1 # <<<<<<<<<<<<<<
@@ -39544,19 +39621,19 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":354
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":355
* self.max_chunks = self.max_nonterminals + 1
* else:
* self.max_chunks = max_chunks # <<<<<<<<<<<<<<
*
* if max_target_chunks is None:
*/
- __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_max_chunks); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_max_chunks); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->max_chunks = __pyx_t_4;
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":356
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":357
* self.max_chunks = max_chunks
*
* if max_target_chunks is None: # <<<<<<<<<<<<<<
@@ -39566,7 +39643,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_t_3 = (__pyx_v_max_target_chunks == Py_None);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":357
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":358
*
* if max_target_chunks is None:
* self.max_target_chunks = self.max_nonterminals + 1 # <<<<<<<<<<<<<<
@@ -39578,19 +39655,19 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":359
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":360
* self.max_target_chunks = self.max_nonterminals + 1
* else:
* self.max_target_chunks = max_target_chunks # <<<<<<<<<<<<<<
*
* if max_target_length is None:
*/
- __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_max_target_chunks); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_max_target_chunks); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->max_target_chunks = __pyx_t_4;
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":361
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":362
* self.max_target_chunks = max_target_chunks
*
* if max_target_length is None: # <<<<<<<<<<<<<<
@@ -39600,7 +39677,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_t_3 = (__pyx_v_max_target_length == Py_None);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":362
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":363
*
* if max_target_length is None:
* self.max_target_length = max_initial_size # <<<<<<<<<<<<<<
@@ -39612,26 +39689,26 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":364
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":365
* self.max_target_length = max_initial_size
* else:
* self.max_target_length = max_target_length # <<<<<<<<<<<<<<
*
* # algorithmic parameters and settings
*/
- __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_max_target_length); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_max_target_length); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->max_target_length = __pyx_t_4;
}
__pyx_L6:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":367
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":368
*
* # algorithmic parameters and settings
* self.precomputed_collocations = {} # <<<<<<<<<<<<<<
* self.precomputed_index = {}
* self.use_index = use_index
*/
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
__Pyx_GIVEREF(((PyObject *)__pyx_t_2));
__Pyx_GOTREF(__pyx_v_self->precomputed_collocations);
@@ -39639,14 +39716,14 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_v_self->precomputed_collocations = ((PyObject *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":368
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":369
* # algorithmic parameters and settings
* self.precomputed_collocations = {}
* self.precomputed_index = {} # <<<<<<<<<<<<<<
* self.use_index = use_index
* self.use_collocations = use_collocations
*/
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
__Pyx_GIVEREF(((PyObject *)__pyx_t_2));
__Pyx_GOTREF(__pyx_v_self->precomputed_index);
@@ -39654,7 +39731,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_v_self->precomputed_index = ((PyObject *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":369
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":370
* self.precomputed_collocations = {}
* self.precomputed_index = {}
* self.use_index = use_index # <<<<<<<<<<<<<<
@@ -39663,7 +39740,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->use_index = __pyx_v_use_index;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":370
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":371
* self.precomputed_index = {}
* self.use_index = use_index
* self.use_collocations = use_collocations # <<<<<<<<<<<<<<
@@ -39672,14 +39749,14 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->use_collocations = __pyx_v_use_collocations;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":371
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":372
* self.use_index = use_index
* self.use_collocations = use_collocations
* self.max_rank = {} # <<<<<<<<<<<<<<
* self.precompute_file = precompute_file
* self.precompute_rank = precompute_rank
*/
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
__Pyx_GIVEREF(((PyObject *)__pyx_t_2));
__Pyx_GOTREF(__pyx_v_self->max_rank);
@@ -39687,7 +39764,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_v_self->max_rank = ((PyObject *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":372
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":373
* self.use_collocations = use_collocations
* self.max_rank = {}
* self.precompute_file = precompute_file # <<<<<<<<<<<<<<
@@ -39700,7 +39777,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__Pyx_DECREF(__pyx_v_self->precompute_file);
__pyx_v_self->precompute_file = __pyx_v_precompute_file;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":373
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":374
* self.max_rank = {}
* self.precompute_file = precompute_file
* self.precompute_rank = precompute_rank # <<<<<<<<<<<<<<
@@ -39709,7 +39786,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->precompute_rank = __pyx_v_precompute_rank;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":374
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":375
* self.precompute_file = precompute_file
* self.precompute_rank = precompute_rank
* self.precompute_secondary_rank = precompute_secondary_rank # <<<<<<<<<<<<<<
@@ -39718,7 +39795,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->precompute_secondary_rank = __pyx_v_precompute_secondary_rank;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":375
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":376
* self.precompute_rank = precompute_rank
* self.precompute_secondary_rank = precompute_secondary_rank
* self.use_baeza_yates = use_baeza_yates # <<<<<<<<<<<<<<
@@ -39727,7 +39804,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->use_baeza_yates = __pyx_v_use_baeza_yates;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":376
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":377
* self.precompute_secondary_rank = precompute_secondary_rank
* self.use_baeza_yates = use_baeza_yates
* self.by_slack_factor = by_slack_factor # <<<<<<<<<<<<<<
@@ -39736,7 +39813,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->by_slack_factor = __pyx_v_by_slack_factor;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":377
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":378
* self.use_baeza_yates = use_baeza_yates
* self.by_slack_factor = by_slack_factor
* self.tight_phrases = tight_phrases # <<<<<<<<<<<<<<
@@ -39745,7 +39822,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->tight_phrases = __pyx_v_tight_phrases;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":379
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":380
* self.tight_phrases = tight_phrases
*
* if require_aligned_chunks: # <<<<<<<<<<<<<<
@@ -39754,7 +39831,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
if (__pyx_v_require_aligned_chunks) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":381
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":382
* if require_aligned_chunks:
* # one condition is a stronger version of the other.
* self.require_aligned_chunks = self.require_aligned_terminal = True # <<<<<<<<<<<<<<
@@ -39766,7 +39843,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
goto __pyx_L7;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":382
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":383
* # one condition is a stronger version of the other.
* self.require_aligned_chunks = self.require_aligned_terminal = True
* elif require_aligned_terminal: # <<<<<<<<<<<<<<
@@ -39775,7 +39852,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
if (__pyx_v_require_aligned_terminal) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":383
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":384
* self.require_aligned_chunks = self.require_aligned_terminal = True
* elif require_aligned_terminal:
* self.require_aligned_chunks = False # <<<<<<<<<<<<<<
@@ -39784,7 +39861,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->require_aligned_chunks = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":384
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":385
* elif require_aligned_terminal:
* self.require_aligned_chunks = False
* self.require_aligned_terminal = True # <<<<<<<<<<<<<<
@@ -39796,7 +39873,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":386
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":387
* self.require_aligned_terminal = True
* else:
* self.require_aligned_chunks = self.require_aligned_terminal = False # <<<<<<<<<<<<<<
@@ -39808,7 +39885,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
}
__pyx_L7:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":389
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":390
*
* # diagnostics
* self.prev_norm_prefix = () # <<<<<<<<<<<<<<
@@ -39821,17 +39898,17 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__Pyx_DECREF(__pyx_v_self->prev_norm_prefix);
__pyx_v_self->prev_norm_prefix = ((PyObject *)__pyx_empty_tuple);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":391
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":392
* self.prev_norm_prefix = ()
*
* self.findexes = IntList(initial_len=10) # <<<<<<<<<<<<<<
* self.findexes1 = IntList(initial_len=10)
*
*/
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
- if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__initial_len), __pyx_int_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__initial_len), __pyx_int_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__Pyx_GIVEREF(__pyx_t_1);
@@ -39840,17 +39917,17 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_v_self->findexes = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":392
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":393
*
* self.findexes = IntList(initial_len=10)
* self.findexes1 = IntList(initial_len=10) # <<<<<<<<<<<<<<
*
* # Online stats
*/
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_int_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_int_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_GIVEREF(__pyx_t_2);
@@ -39859,7 +39936,7 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_v_self->findexes1 = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":397
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":398
*
* # True after data is added
* self.online = False # <<<<<<<<<<<<<<
@@ -39868,21 +39945,21 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
*/
__pyx_v_self->online = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":400
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":401
*
* # Keep track of everything that can be sampled:
* self.samples_f = defaultdict(int) # <<<<<<<<<<<<<<
*
* # Phrase counts
*/
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)(&PyInt_Type))));
__Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
@@ -39892,21 +39969,21 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_v_self->samples_f = __pyx_t_5;
__pyx_t_5 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":403
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":404
*
* # Phrase counts
* self.phrases_f = defaultdict(int) # <<<<<<<<<<<<<<
* self.phrases_e = defaultdict(int)
* self.phrases_fe = defaultdict(lambda: defaultdict(int))
*/
- __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)(&PyInt_Type))));
__Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
@@ -39916,21 +39993,21 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_v_self->phrases_f = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":404
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":405
* # Phrase counts
* self.phrases_f = defaultdict(int)
* self.phrases_e = defaultdict(int) # <<<<<<<<<<<<<<
* self.phrases_fe = defaultdict(lambda: defaultdict(int))
* self.phrases_al = defaultdict(lambda: defaultdict(tuple))
*/
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)(&PyInt_Type))));
__Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
@@ -39940,23 +40017,23 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_v_self->phrases_e = __pyx_t_5;
__pyx_t_5 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":405
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":406
* self.phrases_f = defaultdict(int)
* self.phrases_e = defaultdict(int)
* self.phrases_fe = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<<
* self.phrases_al = defaultdict(lambda: defaultdict(tuple))
*
*/
- __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9__cinit___lambda1, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9__cinit___lambda1, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
@@ -39966,23 +40043,23 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_v_self->phrases_fe = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":406
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":407
* self.phrases_e = defaultdict(int)
* self.phrases_fe = defaultdict(lambda: defaultdict(int))
* self.phrases_al = defaultdict(lambda: defaultdict(tuple)) # <<<<<<<<<<<<<<
*
* # Bilexical counts
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9__cinit___1lambda2, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9__cinit___1lambda2, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
@@ -39992,21 +40069,21 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_v_self->phrases_al = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":409
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":410
*
* # Bilexical counts
* self.bilex_f = defaultdict(int) # <<<<<<<<<<<<<<
* self.bilex_e = defaultdict(int)
* self.bilex_fe = defaultdict(lambda: defaultdict(int))
*/
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)((PyObject*)(&PyInt_Type))));
__Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
@@ -40016,21 +40093,21 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_v_self->bilex_f = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":410
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":411
* # Bilexical counts
* self.bilex_f = defaultdict(int)
* self.bilex_e = defaultdict(int) # <<<<<<<<<<<<<<
* self.bilex_fe = defaultdict(lambda: defaultdict(int))
*
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)((PyObject*)(&PyInt_Type))));
__Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
@@ -40040,23 +40117,23 @@ static int __pyx_pf_3_sa_23HieroCachingRuleFactory___cinit__(struct __pyx_obj_3_
__pyx_v_self->bilex_e = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":411
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":412
* self.bilex_f = defaultdict(int)
* self.bilex_e = defaultdict(int)
* self.bilex_fe = defaultdict(lambda: defaultdict(int)) # <<<<<<<<<<<<<<
*
* def configure(self, SuffixArray fsarray, DataArray edarray,
*/
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9__cinit___2lambda3, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9__cinit___2lambda3, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
@@ -40112,21 +40189,21 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_3configure(PyObject *__
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__edarray)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sampler)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scorer)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "configure") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "configure") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
goto __pyx_L5_argtuple_error;
@@ -40143,16 +40220,16 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_3configure(PyObject *__
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("configure", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.configure", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fsarray), __pyx_ptype_3_sa_SuffixArray, 1, "fsarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edarray), __pyx_ptype_3_sa_DataArray, 1, "edarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sampler), __pyx_ptype_3_sa_Sampler, 1, "sampler", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_scorer), __pyx_ptype_3_sa_Scorer, 1, "scorer", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fsarray), __pyx_ptype_3_sa_SuffixArray, 1, "fsarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_edarray), __pyx_ptype_3_sa_DataArray, 1, "edarray", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sampler), __pyx_ptype_3_sa_Sampler, 1, "sampler", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_scorer), __pyx_ptype_3_sa_Scorer, 1, "scorer", 0))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_r = __pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(((struct __pyx_obj_3_sa_HieroCachingRuleFactory *)__pyx_v_self), __pyx_v_fsarray, __pyx_v_edarray, __pyx_v_sampler, __pyx_v_scorer);
goto __pyx_L0;
__pyx_L1_error:;
@@ -40162,7 +40239,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_3configure(PyObject *__
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":413
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":414
* self.bilex_fe = defaultdict(lambda: defaultdict(int))
*
* def configure(self, SuffixArray fsarray, DataArray edarray, # <<<<<<<<<<<<<<
@@ -40180,7 +40257,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("configure", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":418
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":419
* Here we also use it to precompute the most expensive intersections
* in the corpus quickly.'''
* self.fsa = fsarray # <<<<<<<<<<<<<<
@@ -40193,7 +40270,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx
__Pyx_DECREF(((PyObject *)__pyx_v_self->fsa));
__pyx_v_self->fsa = __pyx_v_fsarray;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":419
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":420
* in the corpus quickly.'''
* self.fsa = fsarray
* self.fda = fsarray.darray # <<<<<<<<<<<<<<
@@ -40206,7 +40283,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx
__Pyx_DECREF(((PyObject *)__pyx_v_self->fda));
__pyx_v_self->fda = __pyx_v_fsarray->darray;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":420
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":421
* self.fsa = fsarray
* self.fda = fsarray.darray
* self.eda = edarray # <<<<<<<<<<<<<<
@@ -40219,7 +40296,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx
__Pyx_DECREF(((PyObject *)__pyx_v_self->eda));
__pyx_v_self->eda = __pyx_v_edarray;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":421
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":422
* self.fda = fsarray.darray
* self.eda = edarray
* self.fid2symid = self.set_idmap(self.fda) # <<<<<<<<<<<<<<
@@ -40228,17 +40305,17 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx
*/
__pyx_t_1 = ((PyObject *)__pyx_v_self->fda);
__Pyx_INCREF(__pyx_t_1);
- __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->set_idmap(__pyx_v_self, ((struct __pyx_obj_3_sa_DataArray *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->set_idmap(__pyx_v_self, ((struct __pyx_obj_3_sa_DataArray *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_self->fid2symid);
__Pyx_DECREF(((PyObject *)__pyx_v_self->fid2symid));
__pyx_v_self->fid2symid = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":422
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":423
* self.eda = edarray
* self.fid2symid = self.set_idmap(self.fda)
* self.eid2symid = self.set_idmap(self.eda) # <<<<<<<<<<<<<<
@@ -40247,31 +40324,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx
*/
__pyx_t_2 = ((PyObject *)__pyx_v_self->eda);
__Pyx_INCREF(__pyx_t_2);
- __pyx_t_1 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->set_idmap(__pyx_v_self, ((struct __pyx_obj_3_sa_DataArray *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->set_idmap(__pyx_v_self, ((struct __pyx_obj_3_sa_DataArray *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->eid2symid);
__Pyx_DECREF(((PyObject *)__pyx_v_self->eid2symid));
__pyx_v_self->eid2symid = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":423
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":424
* self.fid2symid = self.set_idmap(self.fda)
* self.eid2symid = self.set_idmap(self.eda)
* self.precompute() # <<<<<<<<<<<<<<
* self.sampler = sampler
* self.scorer = scorer
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__precompute); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__precompute); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":424
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":425
* self.eid2symid = self.set_idmap(self.eda)
* self.precompute()
* self.sampler = sampler # <<<<<<<<<<<<<<
@@ -40284,7 +40361,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx
__Pyx_DECREF(((PyObject *)__pyx_v_self->sampler));
__pyx_v_self->sampler = __pyx_v_sampler;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":425
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":426
* self.precompute()
* self.sampler = sampler
* self.scorer = scorer # <<<<<<<<<<<<<<
@@ -40310,7 +40387,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_2configure(struct __pyx
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":427
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":428
* self.scorer = scorer
*
* cdef set_idmap(self, DataArray darray): # <<<<<<<<<<<<<<
@@ -40335,7 +40412,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_set_idmap(CYTHON_UNUSED
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set_idmap", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":431
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":432
* cdef IntList idmap
*
* N = len(darray.id2word) # <<<<<<<<<<<<<<
@@ -40344,30 +40421,30 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_set_idmap(CYTHON_UNUSED
*/
__pyx_t_1 = __pyx_v_darray->id2word;
__Pyx_INCREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_N = __pyx_t_2;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":432
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":433
*
* N = len(darray.id2word)
* idmap = IntList(initial_len=N) # <<<<<<<<<<<<<<
* for word_id from 0 <= word_id < N:
* new_word_id = sym_fromstring(darray.id2word[word_id], True)
*/
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_t_3 = PyInt_FromLong(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(__pyx_v_N); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__pyx_v_idmap = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":433
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":434
* N = len(darray.id2word)
* idmap = IntList(initial_len=N)
* for word_id from 0 <= word_id < N: # <<<<<<<<<<<<<<
@@ -40377,20 +40454,20 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_set_idmap(CYTHON_UNUSED
__pyx_t_4 = __pyx_v_N;
for (__pyx_v_word_id = 0; __pyx_v_word_id < __pyx_t_4; __pyx_v_word_id++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":434
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":435
* idmap = IntList(initial_len=N)
* for word_id from 0 <= word_id < N:
* new_word_id = sym_fromstring(darray.id2word[word_id], True) # <<<<<<<<<<<<<<
* idmap.arr[word_id] = new_word_id
* return idmap
*/
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_darray->id2word, __pyx_v_word_id, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_darray->id2word, __pyx_v_word_id, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyBytes_AsString(__pyx_t_3); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyBytes_AsString(__pyx_t_3); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_new_word_id = __pyx_f_3_sa_sym_fromstring(__pyx_t_5, 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":435
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":436
* for word_id from 0 <= word_id < N:
* new_word_id = sym_fromstring(darray.id2word[word_id], True)
* idmap.arr[word_id] = new_word_id # <<<<<<<<<<<<<<
@@ -40400,7 +40477,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_set_idmap(CYTHON_UNUSED
(__pyx_v_idmap->arr[__pyx_v_word_id]) = __pyx_v_new_word_id;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":436
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":437
* new_word_id = sym_fromstring(darray.id2word[word_id], True)
* idmap.arr[word_id] = new_word_id
* return idmap # <<<<<<<<<<<<<<
@@ -40437,7 +40514,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_5pattern2phrase(PyObjec
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":439
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":440
*
*
* def pattern2phrase(self, pattern): # <<<<<<<<<<<<<<
@@ -40465,7 +40542,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("pattern2phrase", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":441
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":442
* def pattern2phrase(self, pattern):
* # pattern is a tuple, which we must convert to a hiero Phrase
* result = () # <<<<<<<<<<<<<<
@@ -40475,7 +40552,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct
__Pyx_INCREF(((PyObject *)__pyx_empty_tuple));
__pyx_v_result = __pyx_empty_tuple;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":442
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":443
* # pattern is a tuple, which we must convert to a hiero Phrase
* result = ()
* arity = 0 # <<<<<<<<<<<<<<
@@ -40485,7 +40562,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct
__Pyx_INCREF(__pyx_int_0);
__pyx_v_arity = __pyx_int_0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":443
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":444
* result = ()
* arity = 0
* for word_id in pattern: # <<<<<<<<<<<<<<
@@ -40496,7 +40573,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct
__pyx_t_1 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
__pyx_t_3 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -40504,23 +40581,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct
if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_3(__pyx_t_1);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -40530,74 +40607,74 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct
__pyx_v_word_id = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":444
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":445
* arity = 0
* for word_id in pattern:
* if word_id == -1: # <<<<<<<<<<<<<<
* arity = arity + 1
* new_id = sym_setindex(self.category, arity)
*/
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":445
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":446
* for word_id in pattern:
* if word_id == -1:
* arity = arity + 1 # <<<<<<<<<<<<<<
* new_id = sym_setindex(self.category, arity)
* else:
*/
- __pyx_t_4 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_v_arity);
__pyx_v_arity = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":446
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":447
* if word_id == -1:
* arity = arity + 1
* new_id = sym_setindex(self.category, arity) # <<<<<<<<<<<<<<
* else:
* new_id = sym_fromstring(self.fda.id2word[word_id], True)
*/
- __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_arity); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_arity); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_new_id = __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_t_6);
goto __pyx_L5;
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":448
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":449
* new_id = sym_setindex(self.category, arity)
* else:
* new_id = sym_fromstring(self.fda.id2word[word_id], True) # <<<<<<<<<<<<<<
* result = result + (new_id,)
* return Phrase(result)
*/
- __pyx_t_4 = PyObject_GetItem(__pyx_v_self->fda->id2word, __pyx_v_word_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetItem(__pyx_v_self->fda->id2word, __pyx_v_word_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = PyBytes_AsString(__pyx_t_4); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyBytes_AsString(__pyx_t_4); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_new_id = __pyx_f_3_sa_sym_fromstring(__pyx_t_7, 1);
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":449
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":450
* else:
* new_id = sym_fromstring(self.fda.id2word[word_id], True)
* result = result + (new_id,) # <<<<<<<<<<<<<<
* return Phrase(result)
*
*/
- __pyx_t_4 = PyInt_FromLong(__pyx_v_new_id); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_v_new_id); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_result), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_result), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
__Pyx_DECREF(((PyObject *)__pyx_v_result));
@@ -40606,7 +40683,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":450
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":451
* new_id = sym_fromstring(self.fda.id2word[word_id], True)
* result = result + (new_id,)
* return Phrase(result) # <<<<<<<<<<<<<<
@@ -40614,12 +40691,12 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_4pattern2phrase(struct
* def pattern2phrase_plus(self, pattern):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_result));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result));
__Pyx_GIVEREF(((PyObject *)__pyx_v_result));
- __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__pyx_r = __pyx_t_4;
@@ -40654,7 +40731,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_7pattern2phrase_plus(Py
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":452
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":453
* return Phrase(result)
*
* def pattern2phrase_plus(self, pattern): # <<<<<<<<<<<<<<
@@ -40684,19 +40761,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("pattern2phrase_plus", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":455
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":456
* # returns a list containing both the pattern, and pattern
* # suffixed/prefixed with the NT category.
* patterns = [] # <<<<<<<<<<<<<<
* result = ()
* arity = 0
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_patterns = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":456
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":457
* # suffixed/prefixed with the NT category.
* patterns = []
* result = () # <<<<<<<<<<<<<<
@@ -40706,7 +40783,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st
__Pyx_INCREF(((PyObject *)__pyx_empty_tuple));
__pyx_v_result = __pyx_empty_tuple;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":457
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":458
* patterns = []
* result = ()
* arity = 0 # <<<<<<<<<<<<<<
@@ -40716,7 +40793,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st
__Pyx_INCREF(__pyx_int_0);
__pyx_v_arity = __pyx_int_0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":458
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":459
* result = ()
* arity = 0
* for word_id in pattern: # <<<<<<<<<<<<<<
@@ -40727,7 +40804,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st
__pyx_t_1 = __pyx_v_pattern; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
__pyx_t_3 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_pattern); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -40735,23 +40812,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st
if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_3(__pyx_t_1);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -40761,74 +40838,74 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st
__pyx_v_word_id = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":459
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":460
* arity = 0
* for word_id in pattern:
* if word_id == -1: # <<<<<<<<<<<<<<
* arity = arity + 1
* new_id = sym_setindex(self.category, arity)
*/
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_v_word_id, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":460
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":461
* for word_id in pattern:
* if word_id == -1:
* arity = arity + 1 # <<<<<<<<<<<<<<
* new_id = sym_setindex(self.category, arity)
* else:
*/
- __pyx_t_4 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(__pyx_v_arity, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_v_arity);
__pyx_v_arity = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":461
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":462
* if word_id == -1:
* arity = arity + 1
* new_id = sym_setindex(self.category, arity) # <<<<<<<<<<<<<<
* else:
* new_id = sym_fromstring(self.fda.id2word[word_id], True)
*/
- __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_arity); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_arity); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_new_id = __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_t_6);
goto __pyx_L5;
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":463
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":464
* new_id = sym_setindex(self.category, arity)
* else:
* new_id = sym_fromstring(self.fda.id2word[word_id], True) # <<<<<<<<<<<<<<
* result = result + (new_id,)
* patterns.append(Phrase(result))
*/
- __pyx_t_4 = PyObject_GetItem(__pyx_v_self->fda->id2word, __pyx_v_word_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetItem(__pyx_v_self->fda->id2word, __pyx_v_word_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = PyBytes_AsString(__pyx_t_4); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyBytes_AsString(__pyx_t_4); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_new_id = __pyx_f_3_sa_sym_fromstring(__pyx_t_7, 1);
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":464
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":465
* else:
* new_id = sym_fromstring(self.fda.id2word[word_id], True)
* result = result + (new_id,) # <<<<<<<<<<<<<<
* patterns.append(Phrase(result))
* patterns.append(Phrase(result + (sym_setindex(self.category, 1),)))
*/
- __pyx_t_4 = PyInt_FromLong(__pyx_v_new_id); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_v_new_id); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_result), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_result), ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
__Pyx_DECREF(((PyObject *)__pyx_v_result));
@@ -40837,81 +40914,81 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_6pattern2phrase_plus(st
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":465
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":466
* new_id = sym_fromstring(self.fda.id2word[word_id], True)
* result = result + (new_id,)
* patterns.append(Phrase(result)) # <<<<<<<<<<<<<<
* patterns.append(Phrase(result + (sym_setindex(self.category, 1),)))
* patterns.append(Phrase((sym_setindex(self.category, 1),) + result))
*/
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_result));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result));
__Pyx_GIVEREF(((PyObject *)__pyx_v_result));
- __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_9 = PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":466
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":467
* result = result + (new_id,)
* patterns.append(Phrase(result))
* patterns.append(Phrase(result + (sym_setindex(self.category, 1),))) # <<<<<<<<<<<<<<
* patterns.append(Phrase((sym_setindex(self.category, 1),) + result))
* return patterns
*/
- __pyx_t_4 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_result), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_result), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4));
__Pyx_GIVEREF(((PyObject *)__pyx_t_4));
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_9 = PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":467
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":468
* patterns.append(Phrase(result))
* patterns.append(Phrase(result + (sym_setindex(self.category, 1),)))
* patterns.append(Phrase((sym_setindex(self.category, 1),) + result)) # <<<<<<<<<<<<<<
* return patterns
*
*/
- __pyx_t_4 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_v_result)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_v_result)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4));
__Pyx_GIVEREF(((PyObject *)__pyx_t_4));
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_9 = PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyList_Append(__pyx_v_patterns, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":468
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":469
* patterns.append(Phrase(result + (sym_setindex(self.category, 1),)))
* patterns.append(Phrase((sym_setindex(self.category, 1),) + result))
* return patterns # <<<<<<<<<<<<<<
@@ -40952,7 +41029,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9precompute(PyObject *_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":470
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":471
* return patterns
*
* def precompute(self): # <<<<<<<<<<<<<<
@@ -40986,7 +41063,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("precompute", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":473
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":474
* cdef Precomputation pre
*
* if self.precompute_file is not None: # <<<<<<<<<<<<<<
@@ -40996,61 +41073,64 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__pyx_t_1 = (__pyx_v_self->precompute_file != Py_None);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":474
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":475
*
* if self.precompute_file is not None:
* start_time = monitor_cpu() # <<<<<<<<<<<<<<
* logger.info("Reading precomputed data from file %s... ", self.precompute_file)
* pre = Precomputation(from_binary=self.precompute_file)
*/
- __pyx_t_2 = PyFloat_FromDouble(__pyx_f_3_sa_monitor_cpu()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_v_start_time = __pyx_t_2;
- __pyx_t_2 = 0;
+ __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_v_start_time = __pyx_t_3;
+ __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":475
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":476
* if self.precompute_file is not None:
* start_time = monitor_cpu()
* logger.info("Reading precomputed data from file %s... ", self.precompute_file) # <<<<<<<<<<<<<<
* pre = Precomputation(from_binary=self.precompute_file)
* # check parameters of precomputation -- some are critical and some are not
*/
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_108));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_108));
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_108));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_108));
__Pyx_INCREF(__pyx_v_self->precompute_file);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->precompute_file);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->precompute_file);
__Pyx_GIVEREF(__pyx_v_self->precompute_file);
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":476
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":477
* start_time = monitor_cpu()
* logger.info("Reading precomputed data from file %s... ", self.precompute_file)
* pre = Precomputation(from_binary=self.precompute_file) # <<<<<<<<<<<<<<
* # check parameters of precomputation -- some are critical and some are not
* if pre.max_nonterminals != self.max_nonterminals:
*/
- __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
- if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__from_binary), __pyx_v_self->precompute_file) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Precomputation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__from_binary), __pyx_v_self->precompute_file) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Precomputation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_v_pre = ((struct __pyx_obj_3_sa_Precomputation *)__pyx_t_2);
- __pyx_t_2 = 0;
+ __pyx_v_pre = ((struct __pyx_obj_3_sa_Precomputation *)__pyx_t_3);
+ __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":478
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":479
* pre = Precomputation(from_binary=self.precompute_file)
* # check parameters of precomputation -- some are critical and some are not
* if pre.max_nonterminals != self.max_nonterminals: # <<<<<<<<<<<<<<
@@ -41060,43 +41140,43 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__pyx_t_1 = (__pyx_v_pre->max_nonterminals != __pyx_v_self->max_nonterminals);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":479
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":480
* # check parameters of precomputation -- some are critical and some are not
* if pre.max_nonterminals != self.max_nonterminals:
* logger.warn("Precomputation done with max nonterminals %d, decoder uses %d", pre.max_nonterminals, self.max_nonterminals) # <<<<<<<<<<<<<<
* if pre.max_length != self.max_length:
* logger.warn("Precomputation done with max terminals %d, decoder uses %d", pre.max_length, self.max_length)
*/
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__warn); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__warn); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyInt_FromLong(__pyx_v_pre->max_nonterminals); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyInt_FromLong(__pyx_v_self->max_nonterminals); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyInt_FromLong(__pyx_v_pre->max_nonterminals); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_v_self->max_nonterminals); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_109));
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_109));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_109));
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_2 = 0;
+ PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
__pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":480
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":481
* if pre.max_nonterminals != self.max_nonterminals:
* logger.warn("Precomputation done with max nonterminals %d, decoder uses %d", pre.max_nonterminals, self.max_nonterminals)
* if pre.max_length != self.max_length: # <<<<<<<<<<<<<<
@@ -41106,43 +41186,43 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__pyx_t_1 = (__pyx_v_pre->max_length != __pyx_v_self->max_length);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":481
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":482
* logger.warn("Precomputation done with max nonterminals %d, decoder uses %d", pre.max_nonterminals, self.max_nonterminals)
* if pre.max_length != self.max_length:
* logger.warn("Precomputation done with max terminals %d, decoder uses %d", pre.max_length, self.max_length) # <<<<<<<<<<<<<<
* if pre.train_max_initial_size != self.train_max_initial_size:
* raise Exception("Precomputation done with max initial size %d, decoder uses %d" % (pre.train_max_initial_size, self.train_max_initial_size))
*/
- __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__warn); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__warn); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyInt_FromLong(__pyx_v_pre->max_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyInt_FromLong(__pyx_v_self->max_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = PyInt_FromLong(__pyx_v_pre->max_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = PyInt_FromLong(__pyx_v_self->max_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_110));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_110));
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_110));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_110));
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_3 = 0;
+ __pyx_t_2 = 0;
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L5;
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":482
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":483
* if pre.max_length != self.max_length:
* logger.warn("Precomputation done with max terminals %d, decoder uses %d", pre.max_length, self.max_length)
* if pre.train_max_initial_size != self.train_max_initial_size: # <<<<<<<<<<<<<<
@@ -41152,44 +41232,44 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__pyx_t_1 = (__pyx_v_pre->train_max_initial_size != __pyx_v_self->train_max_initial_size);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":483
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":484
* logger.warn("Precomputation done with max terminals %d, decoder uses %d", pre.max_length, self.max_length)
* if pre.train_max_initial_size != self.train_max_initial_size:
* raise Exception("Precomputation done with max initial size %d, decoder uses %d" % (pre.train_max_initial_size, self.train_max_initial_size)) # <<<<<<<<<<<<<<
* if pre.train_min_gap_size != self.train_min_gap_size:
* raise Exception("Precomputation done with min gap size %d, decoder uses %d" % (pre.train_min_gap_size, self.train_min_gap_size))
*/
- __pyx_t_4 = PyInt_FromLong(__pyx_v_pre->train_max_initial_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_v_pre->train_max_initial_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = PyInt_FromLong(__pyx_v_self->train_max_initial_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(__pyx_v_self->train_max_initial_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
__pyx_t_4 = 0;
- __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_111), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+ __pyx_t_3 = 0;
+ __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_111), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_3));
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_2));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_3));
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
+ __pyx_t_3 = 0;
+ __pyx_t_3 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L6;
}
__pyx_L6:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":484
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":485
* if pre.train_max_initial_size != self.train_max_initial_size:
* raise Exception("Precomputation done with max initial size %d, decoder uses %d" % (pre.train_max_initial_size, self.train_max_initial_size))
* if pre.train_min_gap_size != self.train_min_gap_size: # <<<<<<<<<<<<<<
@@ -41199,44 +41279,44 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__pyx_t_1 = (__pyx_v_pre->train_min_gap_size != __pyx_v_self->train_min_gap_size);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":485
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":486
* raise Exception("Precomputation done with max initial size %d, decoder uses %d" % (pre.train_max_initial_size, self.train_max_initial_size))
* if pre.train_min_gap_size != self.train_min_gap_size:
* raise Exception("Precomputation done with min gap size %d, decoder uses %d" % (pre.train_min_gap_size, self.train_min_gap_size)) # <<<<<<<<<<<<<<
* if self.use_index:
* logger.info("Converting %d hash keys on precomputed inverted index... ", len(pre.precomputed_index))
*/
- __pyx_t_2 = PyInt_FromLong(__pyx_v_pre->train_min_gap_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyInt_FromLong(__pyx_v_self->train_min_gap_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(__pyx_v_pre->train_min_gap_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = PyInt_FromLong(__pyx_v_self->train_min_gap_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_2 = 0;
+ __pyx_t_3 = 0;
__pyx_t_5 = 0;
- __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_112), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_112), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_5));
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5));
__Pyx_GIVEREF(((PyObject *)__pyx_t_5));
__pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(((PyObject *)__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_filename = __pyx_f[8]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L7;
}
__pyx_L7:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":486
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":487
* if pre.train_min_gap_size != self.train_min_gap_size:
* raise Exception("Precomputation done with min gap size %d, decoder uses %d" % (pre.train_min_gap_size, self.train_min_gap_size))
* if self.use_index: # <<<<<<<<<<<<<<
@@ -41245,39 +41325,39 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
*/
if (__pyx_v_self->use_index) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":487
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":488
* raise Exception("Precomputation done with min gap size %d, decoder uses %d" % (pre.train_min_gap_size, self.train_min_gap_size))
* if self.use_index:
* logger.info("Converting %d hash keys on precomputed inverted index... ", len(pre.precomputed_index)) # <<<<<<<<<<<<<<
* for pattern, arr in pre.precomputed_index.iteritems():
* phrases = self.pattern2phrase_plus(pattern)
*/
- __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__info); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__info); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = __pyx_v_pre->precomputed_index;
__Pyx_INCREF(__pyx_t_5);
- __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_113));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_113));
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_113));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_113));
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":488
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":489
* if self.use_index:
* logger.info("Converting %d hash keys on precomputed inverted index... ", len(pre.precomputed_index))
* for pattern, arr in pre.precomputed_index.iteritems(): # <<<<<<<<<<<<<<
@@ -41287,49 +41367,49 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__pyx_t_6 = 0;
if (unlikely(__pyx_v_pre->precomputed_index == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_pre->precomputed_index, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_dict_iterator(__pyx_v_pre->precomputed_index, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_7), (&__pyx_t_8)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
- __pyx_t_5 = __pyx_t_2;
- __pyx_t_2 = 0;
+ __pyx_t_5 = __pyx_t_3;
+ __pyx_t_3 = 0;
while (1) {
- __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_7, &__pyx_t_6, &__pyx_t_2, &__pyx_t_4, NULL, __pyx_t_8);
+ __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_7, &__pyx_t_6, &__pyx_t_3, &__pyx_t_4, NULL, __pyx_t_8);
if (unlikely(__pyx_t_9 == 0)) break;
- if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_v_pattern);
- __pyx_v_pattern = __pyx_t_2;
- __pyx_t_2 = 0;
+ __pyx_v_pattern = __pyx_t_3;
+ __pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_v_arr);
__pyx_v_arr = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":489
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":490
* logger.info("Converting %d hash keys on precomputed inverted index... ", len(pre.precomputed_index))
* for pattern, arr in pre.precomputed_index.iteritems():
* phrases = self.pattern2phrase_plus(pattern) # <<<<<<<<<<<<<<
* for phrase in phrases:
* self.precomputed_index[phrase] = arr
*/
- __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__pattern2phrase_plus); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__pattern2phrase_plus); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_pattern);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_pattern);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_pattern);
__Pyx_GIVEREF(__pyx_v_pattern);
- __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_v_phrases);
- __pyx_v_phrases = __pyx_t_3;
- __pyx_t_3 = 0;
+ __pyx_v_phrases = __pyx_t_2;
+ __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":490
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":491
* for pattern, arr in pre.precomputed_index.iteritems():
* phrases = self.pattern2phrase_plus(pattern)
* for phrase in phrases: # <<<<<<<<<<<<<<
@@ -41337,60 +41417,60 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
* if self.use_collocations:
*/
if (PyList_CheckExact(__pyx_v_phrases) || PyTuple_CheckExact(__pyx_v_phrases)) {
- __pyx_t_3 = __pyx_v_phrases; __Pyx_INCREF(__pyx_t_3); __pyx_t_10 = 0;
+ __pyx_t_2 = __pyx_v_phrases; __Pyx_INCREF(__pyx_t_2); __pyx_t_10 = 0;
__pyx_t_11 = NULL;
} else {
- __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_phrases); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext;
+ __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_phrases); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_11 = Py_TYPE(__pyx_t_2)->tp_iternext;
}
for (;;) {
- if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_3)) {
- if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_3)) break;
+ if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_2)) {
+ if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_3)) {
- if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
+ } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_2)) {
+ if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_2); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
- __pyx_t_2 = __pyx_t_11(__pyx_t_3);
- if (unlikely(!__pyx_t_2)) {
+ __pyx_t_3 = __pyx_t_11(__pyx_t_2);
+ if (unlikely(!__pyx_t_3)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
- __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_GOTREF(__pyx_t_3);
}
__Pyx_XDECREF(__pyx_v_phrase);
- __pyx_v_phrase = __pyx_t_2;
- __pyx_t_2 = 0;
+ __pyx_v_phrase = __pyx_t_3;
+ __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":491
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":492
* phrases = self.pattern2phrase_plus(pattern)
* for phrase in phrases:
* self.precomputed_index[phrase] = arr # <<<<<<<<<<<<<<
* if self.use_collocations:
* logger.info("Converting %d hash keys on precomputed collocations... ", len(pre.precomputed_collocations))
*/
- if (PyObject_SetItem(__pyx_v_self->precomputed_index, __pyx_v_phrase, __pyx_v_arr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_v_self->precomputed_index, __pyx_v_phrase, __pyx_v_arr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
goto __pyx_L8;
}
__pyx_L8:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":492
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":493
* for phrase in phrases:
* self.precomputed_index[phrase] = arr
* if self.use_collocations: # <<<<<<<<<<<<<<
@@ -41399,39 +41479,39 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
*/
if (__pyx_v_self->use_collocations) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":493
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":494
* self.precomputed_index[phrase] = arr
* if self.use_collocations:
* logger.info("Converting %d hash keys on precomputed collocations... ", len(pre.precomputed_collocations)) # <<<<<<<<<<<<<<
* for pattern, arr in pre.precomputed_collocations.iteritems():
* phrase = self.pattern2phrase(pattern)
*/
- __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = __pyx_v_pre->precomputed_collocations;
__Pyx_INCREF(__pyx_t_5);
- __pyx_t_7 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_114));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_114));
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_114));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_114));
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":494
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":495
* if self.use_collocations:
* logger.info("Converting %d hash keys on precomputed collocations... ", len(pre.precomputed_collocations))
* for pattern, arr in pre.precomputed_collocations.iteritems(): # <<<<<<<<<<<<<<
@@ -41441,101 +41521,104 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8precompute(struct __py
__pyx_t_7 = 0;
if (unlikely(__pyx_v_pre->precomputed_collocations == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_pre->precomputed_collocations, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_6), (&__pyx_t_8)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_dict_iterator(__pyx_v_pre->precomputed_collocations, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_6), (&__pyx_t_8)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
- __pyx_t_5 = __pyx_t_2;
- __pyx_t_2 = 0;
+ __pyx_t_5 = __pyx_t_3;
+ __pyx_t_3 = 0;
while (1) {
- __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_6, &__pyx_t_7, &__pyx_t_2, &__pyx_t_3, NULL, __pyx_t_8);
+ __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_6, &__pyx_t_7, &__pyx_t_3, &__pyx_t_2, NULL, __pyx_t_8);
if (unlikely(__pyx_t_9 == 0)) break;
- if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_v_pattern);
- __pyx_v_pattern = __pyx_t_2;
- __pyx_t_2 = 0;
- __Pyx_XDECREF(__pyx_v_arr);
- __pyx_v_arr = __pyx_t_3;
+ __pyx_v_pattern = __pyx_t_3;
__pyx_t_3 = 0;
+ __Pyx_XDECREF(__pyx_v_arr);
+ __pyx_v_arr = __pyx_t_2;
+ __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":495
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":496
* logger.info("Converting %d hash keys on precomputed collocations... ", len(pre.precomputed_collocations))
* for pattern, arr in pre.precomputed_collocations.iteritems():
* phrase = self.pattern2phrase(pattern) # <<<<<<<<<<<<<<
* self.precomputed_collocations[phrase] = arr
* stop_time = monitor_cpu()
*/
- __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__pattern2phrase); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__pattern2phrase); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_pattern);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_pattern);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_pattern);
__Pyx_GIVEREF(__pyx_v_pattern);
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_v_phrase);
__pyx_v_phrase = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":496
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":497
* for pattern, arr in pre.precomputed_collocations.iteritems():
* phrase = self.pattern2phrase(pattern)
* self.precomputed_collocations[phrase] = arr # <<<<<<<<<<<<<<
* stop_time = monitor_cpu()
* logger.info("Processing precomputations took %f seconds", stop_time - start_time)
*/
- if (PyObject_SetItem(__pyx_v_self->precomputed_collocations, __pyx_v_phrase, __pyx_v_arr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_v_self->precomputed_collocations, __pyx_v_phrase, __pyx_v_arr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
goto __pyx_L13;
}
__pyx_L13:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":497
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":498
* phrase = self.pattern2phrase(pattern)
* self.precomputed_collocations[phrase] = arr
* stop_time = monitor_cpu() # <<<<<<<<<<<<<<
* logger.info("Processing precomputations took %f seconds", stop_time - start_time)
*
*/
- __pyx_t_5 = PyFloat_FromDouble(__pyx_f_3_sa_monitor_cpu()); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_v_stop_time = __pyx_t_5;
- __pyx_t_5 = 0;
+ __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_v_stop_time = __pyx_t_4;
+ __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":498
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":499
* self.precomputed_collocations[phrase] = arr
* stop_time = monitor_cpu()
* logger.info("Processing precomputations took %f seconds", stop_time - start_time) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__info); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyNumber_Subtract(__pyx_v_stop_time, __pyx_v_start_time); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyNumber_Subtract(__pyx_v_stop_time, __pyx_v_start_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_115));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_115));
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_kp_s_115));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_115));
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L3;
}
__pyx_L3:;
@@ -41573,7 +41656,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_11get_precomputed_collo
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":501
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":502
*
*
* def get_precomputed_collocation(self, phrase): # <<<<<<<<<<<<<<
@@ -41595,29 +41678,29 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_10get_precomputed_collo
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_precomputed_collocation", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":502
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":503
*
* def get_precomputed_collocation(self, phrase):
* if phrase in self.precomputed_collocations: # <<<<<<<<<<<<<<
* arr = self.precomputed_collocations[phrase]
* return PhraseLocation(arr=arr, arr_low=0, arr_high=len(arr), num_subpatterns=phrase.arity()+1)
*/
- __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_phrase, __pyx_v_self->precomputed_collocations, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = (__Pyx_PySequence_Contains(__pyx_v_phrase, __pyx_v_self->precomputed_collocations, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":503
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":504
* def get_precomputed_collocation(self, phrase):
* if phrase in self.precomputed_collocations:
* arr = self.precomputed_collocations[phrase] # <<<<<<<<<<<<<<
* return PhraseLocation(arr=arr, arr_low=0, arr_high=len(arr), num_subpatterns=phrase.arity()+1)
* return None
*/
- __pyx_t_2 = PyObject_GetItem(__pyx_v_self->precomputed_collocations, __pyx_v_phrase); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetItem(__pyx_v_self->precomputed_collocations, __pyx_v_phrase); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_arr = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":504
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":505
* if phrase in self.precomputed_collocations:
* arr = self.precomputed_collocations[phrase]
* return PhraseLocation(arr=arr, arr_low=0, arr_high=len(arr), num_subpatterns=phrase.arity()+1) # <<<<<<<<<<<<<<
@@ -41625,26 +41708,26 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_10get_precomputed_collo
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
- if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__arr), __pyx_v_arr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__arr_low), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__arr), __pyx_v_arr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__arr_low), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__arr_high), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__arr_high), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_GetAttr(__pyx_v_phrase, __pyx_n_s__arity); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetAttr(__pyx_v_phrase, __pyx_n_s__arity); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__num_subpatterns), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__num_subpatterns), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_r = __pyx_t_4;
@@ -41654,7 +41737,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_10get_precomputed_collo
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":505
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":506
* arr = self.precomputed_collocations[phrase]
* return PhraseLocation(arr=arr, arr_low=0, arr_high=len(arr), num_subpatterns=phrase.arity()+1)
* return None # <<<<<<<<<<<<<<
@@ -41681,7 +41764,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_10get_precomputed_collo
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":508
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":509
*
*
* cdef int* baeza_yates_helper(self, int low1, int high1, int* arr1, int step1, # <<<<<<<<<<<<<<
@@ -41727,7 +41810,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("baeza_yates_helper", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":521
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":522
* cdef Matching loc1, loc2
*
* result = <int*> malloc(0*sizeof(int*)) # <<<<<<<<<<<<<<
@@ -41736,7 +41819,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_result = ((int *)malloc((0 * (sizeof(int *)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":523
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":524
* result = <int*> malloc(0*sizeof(int*))
*
* d_first = 0 # <<<<<<<<<<<<<<
@@ -41745,7 +41828,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_d_first = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":524
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":525
*
* d_first = 0
* if high1 - low1 > high2 - low2: # <<<<<<<<<<<<<<
@@ -41755,7 +41838,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_1 = ((__pyx_v_high1 - __pyx_v_low1) > (__pyx_v_high2 - __pyx_v_low2));
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":525
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":526
* d_first = 0
* if high1 - low1 > high2 - low2:
* d_first = 1 # <<<<<<<<<<<<<<
@@ -41767,7 +41850,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":529
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":530
* # First, check to see if we are at any of the recursive base cases
* # Case 1: one of the sets is empty
* if low1 >= high1 or low2 >= high2: # <<<<<<<<<<<<<<
@@ -41783,7 +41866,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":530
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":531
* # Case 1: one of the sets is empty
* if low1 >= high1 or low2 >= high2:
* return result # <<<<<<<<<<<<<<
@@ -41796,7 +41879,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":533
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":534
*
* # Case 2: sets are non-overlapping
* assign_matching(&loc1, arr1, high1-step1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -41805,7 +41888,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_f_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, (__pyx_v_high1 - __pyx_v_step1), __pyx_v_step1, __pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":534
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":535
* # Case 2: sets are non-overlapping
* assign_matching(&loc1, arr1, high1-step1, step1, self.fda.sent_id.arr)
* assign_matching(&loc2, arr2, low2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -41814,7 +41897,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_low2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":535
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":536
* assign_matching(&loc1, arr1, high1-step1, step1, self.fda.sent_id.arr)
* assign_matching(&loc2, arr2, low2, step2, self.fda.sent_id.arr)
* if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == -1: # <<<<<<<<<<<<<<
@@ -41824,7 +41907,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) == -1);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":536
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":537
* assign_matching(&loc2, arr2, low2, step2, self.fda.sent_id.arr)
* if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == -1:
* return result # <<<<<<<<<<<<<<
@@ -41837,7 +41920,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":538
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":539
* return result
*
* assign_matching(&loc1, arr1, low1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -41846,7 +41929,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_f_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_low1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":539
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":540
*
* assign_matching(&loc1, arr1, low1, step1, self.fda.sent_id.arr)
* assign_matching(&loc2, arr2, high2-step2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -41855,7 +41938,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, (__pyx_v_high2 - __pyx_v_step2), __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":540
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":541
* assign_matching(&loc1, arr1, low1, step1, self.fda.sent_id.arr)
* assign_matching(&loc2, arr2, high2-step2, step2, self.fda.sent_id.arr)
* if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == 1: # <<<<<<<<<<<<<<
@@ -41865,7 +41948,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) == 1);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":541
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":542
* assign_matching(&loc2, arr2, high2-step2, step2, self.fda.sent_id.arr)
* if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == 1:
* return result # <<<<<<<<<<<<<<
@@ -41878,7 +41961,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
__pyx_L6:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":545
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":546
* # Case 3: query set and data set do not meet size mismatch constraints;
* # We use mergesort instead in this case
* qsetsize = (high1-low1) / step1 # <<<<<<<<<<<<<<
@@ -41888,15 +41971,15 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_4 = (__pyx_v_high1 - __pyx_v_low1);
if (unlikely(__pyx_v_step1 == 0)) {
PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
else if (sizeof(int) == sizeof(long) && unlikely(__pyx_v_step1 == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_4))) {
PyErr_Format(PyExc_OverflowError, "value too large to perform division");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_v_qsetsize = __Pyx_div_int(__pyx_t_4, __pyx_v_step1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":546
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":547
* # We use mergesort instead in this case
* qsetsize = (high1-low1) / step1
* dsetsize = (high2-low2) / step2 # <<<<<<<<<<<<<<
@@ -41906,15 +41989,15 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_4 = (__pyx_v_high2 - __pyx_v_low2);
if (unlikely(__pyx_v_step2 == 0)) {
PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
else if (sizeof(int) == sizeof(long) && unlikely(__pyx_v_step2 == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_t_4))) {
PyErr_Format(PyExc_OverflowError, "value too large to perform division");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_v_dsetsize = __Pyx_div_int(__pyx_t_4, __pyx_v_step2);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":547
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":548
* qsetsize = (high1-low1) / step1
* dsetsize = (high2-low2) / step2
* if d_first: # <<<<<<<<<<<<<<
@@ -41923,7 +42006,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
if (__pyx_v_d_first) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":548
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":549
* dsetsize = (high2-low2) / step2
* if d_first:
* tmp = qsetsize # <<<<<<<<<<<<<<
@@ -41932,7 +42015,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_tmp = __pyx_v_qsetsize;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":549
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":550
* if d_first:
* tmp = qsetsize
* qsetsize = dsetsize # <<<<<<<<<<<<<<
@@ -41941,7 +42024,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_qsetsize = __pyx_v_dsetsize;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":550
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":551
* tmp = qsetsize
* qsetsize = dsetsize
* dsetsize = tmp # <<<<<<<<<<<<<<
@@ -41953,7 +42036,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
__pyx_L7:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":552
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":553
* dsetsize = tmp
*
* if self.by_slack_factor * qsetsize * log(dsetsize) / log(2) > dsetsize: # <<<<<<<<<<<<<<
@@ -41964,12 +42047,12 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_6 = log(2.0);
if (unlikely(__pyx_t_6 == 0)) {
PyErr_Format(PyExc_ZeroDivisionError, "float division");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_t_3 = ((__pyx_t_5 / __pyx_t_6) > __pyx_v_dsetsize);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":553
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":554
*
* if self.by_slack_factor * qsetsize * log(dsetsize) / log(2) > dsetsize:
* free(result) # <<<<<<<<<<<<<<
@@ -41978,7 +42061,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
free(__pyx_v_result);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":554
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":555
* if self.by_slack_factor * qsetsize * log(dsetsize) / log(2) > dsetsize:
* free(result)
* return self.merge_helper(low1, high1, arr1, step1, low2, high2, arr2, step2, offset_by_one, len_last, num_subpatterns, result_len) # <<<<<<<<<<<<<<
@@ -41991,7 +42074,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
__pyx_L8:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":558
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":559
* # binary search. There are two flavors, depending on
* # whether the queryset or dataset is first
* if d_first: # <<<<<<<<<<<<<<
@@ -42000,7 +42083,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
if (__pyx_v_d_first) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":559
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":560
* # whether the queryset or dataset is first
* if d_first:
* med2 = median(low2, high2, step2) # <<<<<<<<<<<<<<
@@ -42009,7 +42092,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med2 = __pyx_f_3_sa_median(__pyx_v_low2, __pyx_v_high2, __pyx_v_step2);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":560
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":561
* if d_first:
* med2 = median(low2, high2, step2)
* assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -42018,7 +42101,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_med2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":562
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":563
* assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr)
*
* search_low = low1 # <<<<<<<<<<<<<<
@@ -42027,7 +42110,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_search_low = __pyx_v_low1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":563
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":564
*
* search_low = low1
* search_high = high1 # <<<<<<<<<<<<<<
@@ -42036,7 +42119,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_search_high = __pyx_v_high1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":564
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":565
* search_low = low1
* search_high = high1
* while search_low < search_high: # <<<<<<<<<<<<<<
@@ -42047,7 +42130,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = (__pyx_v_search_low < __pyx_v_search_high);
if (!__pyx_t_3) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":565
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":566
* search_high = high1
* while search_low < search_high:
* med1 = median(search_low, search_high, step1) # <<<<<<<<<<<<<<
@@ -42056,7 +42139,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med1 = __pyx_f_3_sa_median(__pyx_v_search_low, __pyx_v_search_high, __pyx_v_step1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":566
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":567
* while search_low < search_high:
* med1 = median(search_low, search_high, step1)
* find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus) # <<<<<<<<<<<<<<
@@ -42065,7 +42148,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_f_3_sa_find_comparable_matchings(__pyx_v_low1, __pyx_v_high1, __pyx_v_arr1, __pyx_v_step1, __pyx_v_med1, (&__pyx_v_med1_minus), (&__pyx_v_med1_plus));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":567
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":568
* med1 = median(search_low, search_high, step1)
* find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus)
* comparison = self.compare_matchings_set(med1_minus, med1_plus, arr1, step1, &loc2, offset_by_one, len_last) # <<<<<<<<<<<<<<
@@ -42074,7 +42157,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_comparison = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings_set(__pyx_v_self, __pyx_v_med1_minus, __pyx_v_med1_plus, __pyx_v_arr1, __pyx_v_step1, (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":570
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":571
* if comparison == -1:
* search_low = med1_plus
* elif comparison == 1: # <<<<<<<<<<<<<<
@@ -42083,7 +42166,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
switch (__pyx_v_comparison) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":568
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":569
* find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus)
* comparison = self.compare_matchings_set(med1_minus, med1_plus, arr1, step1, &loc2, offset_by_one, len_last)
* if comparison == -1: # <<<<<<<<<<<<<<
@@ -42092,7 +42175,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
case -1:
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":569
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":570
* comparison = self.compare_matchings_set(med1_minus, med1_plus, arr1, step1, &loc2, offset_by_one, len_last)
* if comparison == -1:
* search_low = med1_plus # <<<<<<<<<<<<<<
@@ -42102,7 +42185,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_v_search_low = __pyx_v_med1_plus;
break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":570
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":571
* if comparison == -1:
* search_low = med1_plus
* elif comparison == 1: # <<<<<<<<<<<<<<
@@ -42111,7 +42194,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
case 1:
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":571
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":572
* search_low = med1_plus
* elif comparison == 1:
* search_high = med1_minus # <<<<<<<<<<<<<<
@@ -42122,7 +42205,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
break;
default:
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":573
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":574
* search_high = med1_minus
* else:
* break # <<<<<<<<<<<<<<
@@ -42138,7 +42221,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":575
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":576
* break
* else:
* med1 = median(low1, high1, step1) # <<<<<<<<<<<<<<
@@ -42147,7 +42230,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med1 = __pyx_f_3_sa_median(__pyx_v_low1, __pyx_v_high1, __pyx_v_step1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":576
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":577
* else:
* med1 = median(low1, high1, step1)
* find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus) # <<<<<<<<<<<<<<
@@ -42156,7 +42239,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_f_3_sa_find_comparable_matchings(__pyx_v_low1, __pyx_v_high1, __pyx_v_arr1, __pyx_v_step1, __pyx_v_med1, (&__pyx_v_med1_minus), (&__pyx_v_med1_plus));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":578
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":579
* find_comparable_matchings(low1, high1, arr1, step1, med1, &med1_minus, &med1_plus)
*
* search_low = low2 # <<<<<<<<<<<<<<
@@ -42165,7 +42248,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_search_low = __pyx_v_low2;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":579
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":580
*
* search_low = low2
* search_high = high2 # <<<<<<<<<<<<<<
@@ -42174,7 +42257,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_search_high = __pyx_v_high2;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":580
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":581
* search_low = low2
* search_high = high2
* while search_low < search_high: # <<<<<<<<<<<<<<
@@ -42185,7 +42268,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = (__pyx_v_search_low < __pyx_v_search_high);
if (!__pyx_t_3) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":581
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":582
* search_high = high2
* while search_low < search_high:
* med2 = median(search_low, search_high, step2) # <<<<<<<<<<<<<<
@@ -42194,7 +42277,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med2 = __pyx_f_3_sa_median(__pyx_v_search_low, __pyx_v_search_high, __pyx_v_step2);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":582
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":583
* while search_low < search_high:
* med2 = median(search_low, search_high, step2)
* assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -42203,7 +42286,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_med2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":583
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":584
* med2 = median(search_low, search_high, step2)
* assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr)
* comparison = self.compare_matchings_set(med1_minus, med1_plus, arr1, step1, &loc2, offset_by_one, len_last) # <<<<<<<<<<<<<<
@@ -42212,7 +42295,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_comparison = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings_set(__pyx_v_self, __pyx_v_med1_minus, __pyx_v_med1_plus, __pyx_v_arr1, __pyx_v_step1, (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":586
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":587
* if comparison == -1:
* search_high = med2
* elif comparison == 1: # <<<<<<<<<<<<<<
@@ -42221,7 +42304,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
switch (__pyx_v_comparison) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":584
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":585
* assign_matching(&loc2, arr2, med2, step2, self.fda.sent_id.arr)
* comparison = self.compare_matchings_set(med1_minus, med1_plus, arr1, step1, &loc2, offset_by_one, len_last)
* if comparison == -1: # <<<<<<<<<<<<<<
@@ -42230,7 +42313,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
case -1:
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":585
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":586
* comparison = self.compare_matchings_set(med1_minus, med1_plus, arr1, step1, &loc2, offset_by_one, len_last)
* if comparison == -1:
* search_high = med2 # <<<<<<<<<<<<<<
@@ -42240,7 +42323,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_v_search_high = __pyx_v_med2;
break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":586
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":587
* if comparison == -1:
* search_high = med2
* elif comparison == 1: # <<<<<<<<<<<<<<
@@ -42249,7 +42332,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
case 1:
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":587
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":588
* search_high = med2
* elif comparison == 1:
* search_low = med2 + step2 # <<<<<<<<<<<<<<
@@ -42260,7 +42343,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
break;
default:
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":589
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":590
* search_low = med2 + step2
* else:
* break # <<<<<<<<<<<<<<
@@ -42275,7 +42358,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
__pyx_L9:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":591
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":592
* break
*
* med_result_len = 0 # <<<<<<<<<<<<<<
@@ -42284,7 +42367,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med_result_len = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":592
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":593
*
* med_result_len = 0
* med_result = <int*> malloc(0*sizeof(int*)) # <<<<<<<<<<<<<<
@@ -42293,7 +42376,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med_result = ((int *)malloc((0 * (sizeof(int *)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":593
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":594
* med_result_len = 0
* med_result = <int*> malloc(0*sizeof(int*))
* if search_high > search_low: # <<<<<<<<<<<<<<
@@ -42303,7 +42386,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = (__pyx_v_search_high > __pyx_v_search_low);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":599
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":600
* # want to store the bindings for all of those elements. We can
* # subsequently throw all of them away.
* med2_minus = med2 # <<<<<<<<<<<<<<
@@ -42312,7 +42395,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med2_minus = __pyx_v_med2;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":600
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":601
* # subsequently throw all of them away.
* med2_minus = med2
* med2_plus = med2 + step2 # <<<<<<<<<<<<<<
@@ -42321,7 +42404,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med2_plus = (__pyx_v_med2 + __pyx_v_step2);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":601
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":602
* med2_minus = med2
* med2_plus = med2 + step2
* i1 = med1_minus # <<<<<<<<<<<<<<
@@ -42330,7 +42413,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_i1 = __pyx_v_med1_minus;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":602
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":603
* med2_plus = med2 + step2
* i1 = med1_minus
* while i1 < med1_plus: # <<<<<<<<<<<<<<
@@ -42341,7 +42424,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = (__pyx_v_i1 < __pyx_v_med1_plus);
if (!__pyx_t_3) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":603
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":604
* i1 = med1_minus
* while i1 < med1_plus:
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -42350,7 +42433,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_f_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":604
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":605
* while i1 < med1_plus:
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr)
* while med2_minus-step2 >= low2: # <<<<<<<<<<<<<<
@@ -42361,7 +42444,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = ((__pyx_v_med2_minus - __pyx_v_step2) >= __pyx_v_low2);
if (!__pyx_t_3) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":605
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":606
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr)
* while med2_minus-step2 >= low2:
* assign_matching(&loc2, arr2, med2_minus-step2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -42370,7 +42453,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, (__pyx_v_med2_minus - __pyx_v_step2), __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":606
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":607
* while med2_minus-step2 >= low2:
* assign_matching(&loc2, arr2, med2_minus-step2, step2, self.fda.sent_id.arr)
* if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) < 1: # <<<<<<<<<<<<<<
@@ -42380,7 +42463,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) < 1);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":607
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":608
* assign_matching(&loc2, arr2, med2_minus-step2, step2, self.fda.sent_id.arr)
* if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) < 1:
* med2_minus = med2_minus - step2 # <<<<<<<<<<<<<<
@@ -42392,7 +42475,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":609
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":610
* med2_minus = med2_minus - step2
* else:
* break # <<<<<<<<<<<<<<
@@ -42405,7 +42488,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
__pyx_L18_break:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":610
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":611
* else:
* break
* i2 = med2_minus # <<<<<<<<<<<<<<
@@ -42414,7 +42497,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_i2 = __pyx_v_med2_minus;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":611
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":612
* break
* i2 = med2_minus
* while i2 < high2: # <<<<<<<<<<<<<<
@@ -42425,7 +42508,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = (__pyx_v_i2 < __pyx_v_high2);
if (!__pyx_t_3) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":612
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":613
* i2 = med2_minus
* while i2 < high2:
* assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -42434,7 +42517,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_i2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":613
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":614
* while i2 < high2:
* assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr)
* comparison = self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) # <<<<<<<<<<<<<<
@@ -42443,7 +42526,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_comparison = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":614
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":615
* assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr)
* comparison = self.compare_matchings(&loc1, &loc2, offset_by_one, len_last)
* if comparison == 0: # <<<<<<<<<<<<<<
@@ -42453,7 +42536,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = (__pyx_v_comparison == 0);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":616
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":617
* if comparison == 0:
* pass
* med_result = append_combined_matching(med_result, &loc1, &loc2, offset_by_one, num_subpatterns, &med_result_len) # <<<<<<<<<<<<<<
@@ -42465,7 +42548,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
__pyx_L22:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":617
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":618
* pass
* med_result = append_combined_matching(med_result, &loc1, &loc2, offset_by_one, num_subpatterns, &med_result_len)
* if comparison == -1: # <<<<<<<<<<<<<<
@@ -42475,7 +42558,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = (__pyx_v_comparison == -1);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":618
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":619
* med_result = append_combined_matching(med_result, &loc1, &loc2, offset_by_one, num_subpatterns, &med_result_len)
* if comparison == -1:
* break # <<<<<<<<<<<<<<
@@ -42487,7 +42570,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
__pyx_L23:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":619
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":620
* if comparison == -1:
* break
* i2 = i2 + step2 # <<<<<<<<<<<<<<
@@ -42498,7 +42581,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
__pyx_L21_break:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":620
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":621
* break
* i2 = i2 + step2
* if i2 > med2_plus: # <<<<<<<<<<<<<<
@@ -42508,7 +42591,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = (__pyx_v_i2 > __pyx_v_med2_plus);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":621
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":622
* i2 = i2 + step2
* if i2 > med2_plus:
* med2_plus = i2 # <<<<<<<<<<<<<<
@@ -42520,7 +42603,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
__pyx_L24:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":622
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":623
* if i2 > med2_plus:
* med2_plus = i2
* i1 = i1 + step1 # <<<<<<<<<<<<<<
@@ -42530,7 +42613,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_v_i1 = (__pyx_v_i1 + __pyx_v_step1);
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":624
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":625
* i1 = i1 + step1
*
* tmp = med1_minus # <<<<<<<<<<<<<<
@@ -42539,7 +42622,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_tmp = __pyx_v_med1_minus;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":625
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":626
*
* tmp = med1_minus
* med1_minus = med1_plus # <<<<<<<<<<<<<<
@@ -42548,7 +42631,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med1_minus = __pyx_v_med1_plus;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":626
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":627
* tmp = med1_minus
* med1_minus = med1_plus
* med1_plus = tmp # <<<<<<<<<<<<<<
@@ -42560,7 +42643,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":629
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":630
* else:
* # No match; need to figure out the point of division in D and Q
* med2_minus = med2 # <<<<<<<<<<<<<<
@@ -42569,7 +42652,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med2_minus = __pyx_v_med2;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":630
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":631
* # No match; need to figure out the point of division in D and Q
* med2_minus = med2
* med2_plus = med2 # <<<<<<<<<<<<<<
@@ -42578,7 +42661,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med2_plus = __pyx_v_med2;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":631
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":632
* med2_minus = med2
* med2_plus = med2
* if d_first: # <<<<<<<<<<<<<<
@@ -42587,7 +42670,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
if (__pyx_v_d_first) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":632
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":633
* med2_plus = med2
* if d_first:
* med2_minus = med2_minus + step2 # <<<<<<<<<<<<<<
@@ -42596,7 +42679,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med2_minus = (__pyx_v_med2_minus + __pyx_v_step2);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":633
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":634
* if d_first:
* med2_minus = med2_minus + step2
* if comparison == -1: # <<<<<<<<<<<<<<
@@ -42606,7 +42689,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = (__pyx_v_comparison == -1);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":634
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":635
* med2_minus = med2_minus + step2
* if comparison == -1:
* med1_minus = med1_plus # <<<<<<<<<<<<<<
@@ -42618,7 +42701,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
__pyx_L26:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":635
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":636
* if comparison == -1:
* med1_minus = med1_plus
* if comparison == 1: # <<<<<<<<<<<<<<
@@ -42628,7 +42711,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = (__pyx_v_comparison == 1);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":636
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":637
* med1_minus = med1_plus
* if comparison == 1:
* med1_plus = med1_minus # <<<<<<<<<<<<<<
@@ -42643,7 +42726,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":638
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":639
* med1_plus = med1_minus
* else:
* tmp = med1_minus # <<<<<<<<<<<<<<
@@ -42652,7 +42735,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_tmp = __pyx_v_med1_minus;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":639
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":640
* else:
* tmp = med1_minus
* med1_minus = med1_plus # <<<<<<<<<<<<<<
@@ -42661,7 +42744,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med1_minus = __pyx_v_med1_plus;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":640
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":641
* tmp = med1_minus
* med1_minus = med1_plus
* med1_plus = tmp # <<<<<<<<<<<<<<
@@ -42670,7 +42753,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med1_plus = __pyx_v_tmp;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":641
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":642
* med1_minus = med1_plus
* med1_plus = tmp
* if comparison == 1: # <<<<<<<<<<<<<<
@@ -42680,7 +42763,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
__pyx_t_3 = (__pyx_v_comparison == 1);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":642
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":643
* med1_plus = tmp
* if comparison == 1:
* med2_minus = med2_minus + step2 # <<<<<<<<<<<<<<
@@ -42689,7 +42772,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_med2_minus = (__pyx_v_med2_minus + __pyx_v_step2);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":643
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":644
* if comparison == 1:
* med2_minus = med2_minus + step2
* med2_plus = med2_plus + step2 # <<<<<<<<<<<<<<
@@ -42705,7 +42788,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
}
__pyx_L14:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":645
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":646
* med2_plus = med2_plus + step2
*
* low_result_len = 0 # <<<<<<<<<<<<<<
@@ -42714,7 +42797,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_low_result_len = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":646
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":647
*
* low_result_len = 0
* low_result = self.baeza_yates_helper(low1, med1_plus, arr1, step1, low2, med2_plus, arr2, step2, offset_by_one, len_last, num_subpatterns, &low_result_len) # <<<<<<<<<<<<<<
@@ -42723,7 +42806,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_low_result = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->baeza_yates_helper(__pyx_v_self, __pyx_v_low1, __pyx_v_med1_plus, __pyx_v_arr1, __pyx_v_step1, __pyx_v_low2, __pyx_v_med2_plus, __pyx_v_arr2, __pyx_v_step2, __pyx_v_offset_by_one, __pyx_v_len_last, __pyx_v_num_subpatterns, (&__pyx_v_low_result_len));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":647
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":648
* low_result_len = 0
* low_result = self.baeza_yates_helper(low1, med1_plus, arr1, step1, low2, med2_plus, arr2, step2, offset_by_one, len_last, num_subpatterns, &low_result_len)
* high_result_len = 0 # <<<<<<<<<<<<<<
@@ -42732,7 +42815,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_high_result_len = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":648
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":649
* low_result = self.baeza_yates_helper(low1, med1_plus, arr1, step1, low2, med2_plus, arr2, step2, offset_by_one, len_last, num_subpatterns, &low_result_len)
* high_result_len = 0
* high_result = self.baeza_yates_helper(med1_minus, high1, arr1, step1, med2_minus, high2, arr2, step2, offset_by_one, len_last, num_subpatterns, &high_result_len) # <<<<<<<<<<<<<<
@@ -42741,7 +42824,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_high_result = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->baeza_yates_helper(__pyx_v_self, __pyx_v_med1_minus, __pyx_v_high1, __pyx_v_arr1, __pyx_v_step1, __pyx_v_med2_minus, __pyx_v_high2, __pyx_v_arr2, __pyx_v_step2, __pyx_v_offset_by_one, __pyx_v_len_last, __pyx_v_num_subpatterns, (&__pyx_v_high_result_len));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":650
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":651
* high_result = self.baeza_yates_helper(med1_minus, high1, arr1, step1, med2_minus, high2, arr2, step2, offset_by_one, len_last, num_subpatterns, &high_result_len)
*
* result = extend_arr(result, result_len, low_result, low_result_len) # <<<<<<<<<<<<<<
@@ -42750,7 +42833,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_result = __pyx_f_3_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_low_result, __pyx_v_low_result_len);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":651
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":652
*
* result = extend_arr(result, result_len, low_result, low_result_len)
* result = extend_arr(result, result_len, med_result, med_result_len) # <<<<<<<<<<<<<<
@@ -42759,7 +42842,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_result = __pyx_f_3_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_med_result, __pyx_v_med_result_len);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":652
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":653
* result = extend_arr(result, result_len, low_result, low_result_len)
* result = extend_arr(result, result_len, med_result, med_result_len)
* result = extend_arr(result, result_len, high_result, high_result_len) # <<<<<<<<<<<<<<
@@ -42768,7 +42851,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
__pyx_v_result = __pyx_f_3_sa_extend_arr(__pyx_v_result, __pyx_v_result_len, __pyx_v_high_result, __pyx_v_high_result_len);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":653
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":654
* result = extend_arr(result, result_len, med_result, med_result_len)
* result = extend_arr(result, result_len, high_result, high_result_len)
* free(low_result) # <<<<<<<<<<<<<<
@@ -42777,7 +42860,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
free(__pyx_v_low_result);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":654
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":655
* result = extend_arr(result, result_len, high_result, high_result_len)
* free(low_result)
* free(med_result) # <<<<<<<<<<<<<<
@@ -42786,7 +42869,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
free(__pyx_v_med_result);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":655
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":656
* free(low_result)
* free(med_result)
* free(high_result) # <<<<<<<<<<<<<<
@@ -42795,7 +42878,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
*/
free(__pyx_v_high_result);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":657
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":658
* free(high_result)
*
* return result # <<<<<<<<<<<<<<
@@ -42815,7 +42898,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_baeza_yates_helper(struct __p
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":661
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":662
*
*
* cdef long compare_matchings_set(self, int i1_minus, int i1_plus, int* arr1, int step1, # <<<<<<<<<<<<<<
@@ -42834,7 +42917,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
int __pyx_t_1;
__Pyx_RefNannySetupContext("compare_matchings_set", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":672
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":673
* cdef Matching* loc1
*
* loc1 = &l1_stack # <<<<<<<<<<<<<<
@@ -42843,7 +42926,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
*/
__pyx_v_loc1 = (&__pyx_v_l1_stack);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":674
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":675
* loc1 = &l1_stack
*
* i1 = i1_minus # <<<<<<<<<<<<<<
@@ -42852,7 +42935,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
*/
__pyx_v_i1 = __pyx_v_i1_minus;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":675
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":676
*
* i1 = i1_minus
* while i1 < i1_plus: # <<<<<<<<<<<<<<
@@ -42863,7 +42946,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
__pyx_t_1 = (__pyx_v_i1 < __pyx_v_i1_plus);
if (!__pyx_t_1) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":676
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":677
* i1 = i1_minus
* while i1 < i1_plus:
* assign_matching(loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -42872,7 +42955,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
*/
__pyx_f_3_sa_assign_matching(__pyx_v_loc1, __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":677
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":678
* while i1 < i1_plus:
* assign_matching(loc1, arr1, i1, step1, self.fda.sent_id.arr)
* comparison = self.compare_matchings(loc1, loc2, offset_by_one, len_last) # <<<<<<<<<<<<<<
@@ -42881,7 +42964,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
*/
__pyx_v_comparison = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, __pyx_v_loc1, __pyx_v_loc2, __pyx_v_offset_by_one, __pyx_v_len_last);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":678
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":679
* assign_matching(loc1, arr1, i1, step1, self.fda.sent_id.arr)
* comparison = self.compare_matchings(loc1, loc2, offset_by_one, len_last)
* if comparison == 0: # <<<<<<<<<<<<<<
@@ -42891,7 +42974,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
__pyx_t_1 = (__pyx_v_comparison == 0);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":679
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":680
* comparison = self.compare_matchings(loc1, loc2, offset_by_one, len_last)
* if comparison == 0:
* prev_comparison = 0 # <<<<<<<<<<<<<<
@@ -42900,7 +42983,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
*/
__pyx_v_prev_comparison = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":680
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":681
* if comparison == 0:
* prev_comparison = 0
* break # <<<<<<<<<<<<<<
@@ -42911,7 +42994,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
goto __pyx_L5;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":681
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":682
* prev_comparison = 0
* break
* elif i1 == i1_minus: # <<<<<<<<<<<<<<
@@ -42921,7 +43004,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
__pyx_t_1 = (__pyx_v_i1 == __pyx_v_i1_minus);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":682
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":683
* break
* elif i1 == i1_minus:
* prev_comparison = comparison # <<<<<<<<<<<<<<
@@ -42933,7 +43016,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":684
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":685
* prev_comparison = comparison
* else:
* if comparison != prev_comparison: # <<<<<<<<<<<<<<
@@ -42943,7 +43026,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
__pyx_t_1 = (__pyx_v_comparison != __pyx_v_prev_comparison);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":685
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":686
* else:
* if comparison != prev_comparison:
* prev_comparison = 0 # <<<<<<<<<<<<<<
@@ -42952,7 +43035,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
*/
__pyx_v_prev_comparison = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":686
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":687
* if comparison != prev_comparison:
* prev_comparison = 0
* break # <<<<<<<<<<<<<<
@@ -42966,7 +43049,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":687
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":688
* prev_comparison = 0
* break
* i1 = i1 + step1 # <<<<<<<<<<<<<<
@@ -42977,7 +43060,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
}
__pyx_L4_break:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":688
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":689
* break
* i1 = i1 + step1
* return prev_comparison # <<<<<<<<<<<<<<
@@ -42993,7 +43076,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings_set(struct
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":691
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":692
*
*
* cdef long compare_matchings(self, Matching* loc1, Matching* loc2, int offset_by_one, int len_last): # <<<<<<<<<<<<<<
@@ -43011,7 +43094,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
int __pyx_t_4;
__Pyx_RefNannySetupContext("compare_matchings", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":694
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":695
* cdef int i
*
* if loc1.sent_id > loc2.sent_id: # <<<<<<<<<<<<<<
@@ -43021,7 +43104,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
__pyx_t_1 = (__pyx_v_loc1->sent_id > __pyx_v_loc2->sent_id);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":695
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":696
*
* if loc1.sent_id > loc2.sent_id:
* return 1 # <<<<<<<<<<<<<<
@@ -43034,7 +43117,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":696
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":697
* if loc1.sent_id > loc2.sent_id:
* return 1
* if loc2.sent_id > loc1.sent_id: # <<<<<<<<<<<<<<
@@ -43044,7 +43127,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
__pyx_t_1 = (__pyx_v_loc2->sent_id > __pyx_v_loc1->sent_id);
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":697
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":698
* return 1
* if loc2.sent_id > loc1.sent_id:
* return -1 # <<<<<<<<<<<<<<
@@ -43057,7 +43140,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":699
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":700
* return -1
*
* if loc1.size == 1 and loc2.size == 1: # <<<<<<<<<<<<<<
@@ -43073,7 +43156,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
}
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":700
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":701
*
* if loc1.size == 1 and loc2.size == 1:
* if loc2.arr[loc2.start] - loc1.arr[loc1.start] <= self.train_min_gap_size: # <<<<<<<<<<<<<<
@@ -43083,7 +43166,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
__pyx_t_3 = (((__pyx_v_loc2->arr[__pyx_v_loc2->start]) - (__pyx_v_loc1->arr[__pyx_v_loc1->start])) <= __pyx_v_self->train_min_gap_size);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":701
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":702
* if loc1.size == 1 and loc2.size == 1:
* if loc2.arr[loc2.start] - loc1.arr[loc1.start] <= self.train_min_gap_size:
* return 1 # <<<<<<<<<<<<<<
@@ -43098,7 +43181,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
goto __pyx_L5;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":703
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":704
* return 1
*
* elif offset_by_one: # <<<<<<<<<<<<<<
@@ -43107,7 +43190,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
*/
if (__pyx_v_offset_by_one) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":704
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":705
*
* elif offset_by_one:
* for i from 1 <= i < loc1.size: # <<<<<<<<<<<<<<
@@ -43117,7 +43200,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
__pyx_t_4 = __pyx_v_loc1->size;
for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":705
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":706
* elif offset_by_one:
* for i from 1 <= i < loc1.size:
* if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i-1]: # <<<<<<<<<<<<<<
@@ -43127,7 +43210,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
__pyx_t_3 = ((__pyx_v_loc1->arr[(__pyx_v_loc1->start + __pyx_v_i)]) > (__pyx_v_loc2->arr[((__pyx_v_loc2->start + __pyx_v_i) - 1)]));
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":706
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":707
* for i from 1 <= i < loc1.size:
* if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i-1]:
* return 1 # <<<<<<<<<<<<<<
@@ -43140,7 +43223,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
}
__pyx_L9:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":707
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":708
* if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i-1]:
* return 1
* if loc1.arr[loc1.start+i] < loc2.arr[loc2.start+i-1]: # <<<<<<<<<<<<<<
@@ -43150,7 +43233,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
__pyx_t_3 = ((__pyx_v_loc1->arr[(__pyx_v_loc1->start + __pyx_v_i)]) < (__pyx_v_loc2->arr[((__pyx_v_loc2->start + __pyx_v_i) - 1)]));
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":708
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":709
* return 1
* if loc1.arr[loc1.start+i] < loc2.arr[loc2.start+i-1]:
* return -1 # <<<<<<<<<<<<<<
@@ -43167,7 +43250,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":711
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":712
*
* else:
* if loc1.arr[loc1.start]+1 > loc2.arr[loc2.start]: # <<<<<<<<<<<<<<
@@ -43177,7 +43260,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
__pyx_t_3 = (((__pyx_v_loc1->arr[__pyx_v_loc1->start]) + 1) > (__pyx_v_loc2->arr[__pyx_v_loc2->start]));
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":712
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":713
* else:
* if loc1.arr[loc1.start]+1 > loc2.arr[loc2.start]:
* return 1 # <<<<<<<<<<<<<<
@@ -43190,7 +43273,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
}
__pyx_L11:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":713
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":714
* if loc1.arr[loc1.start]+1 > loc2.arr[loc2.start]:
* return 1
* if loc1.arr[loc1.start]+1 < loc2.arr[loc2.start]: # <<<<<<<<<<<<<<
@@ -43200,7 +43283,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
__pyx_t_3 = (((__pyx_v_loc1->arr[__pyx_v_loc1->start]) + 1) < (__pyx_v_loc2->arr[__pyx_v_loc2->start]));
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":714
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":715
* return 1
* if loc1.arr[loc1.start]+1 < loc2.arr[loc2.start]:
* return -1 # <<<<<<<<<<<<<<
@@ -43213,7 +43296,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
}
__pyx_L12:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":716
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":717
* return -1
*
* for i from 1 <= i < loc1.size: # <<<<<<<<<<<<<<
@@ -43223,7 +43306,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
__pyx_t_4 = __pyx_v_loc1->size;
for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":717
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":718
*
* for i from 1 <= i < loc1.size:
* if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i]: # <<<<<<<<<<<<<<
@@ -43233,7 +43316,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
__pyx_t_3 = ((__pyx_v_loc1->arr[(__pyx_v_loc1->start + __pyx_v_i)]) > (__pyx_v_loc2->arr[(__pyx_v_loc2->start + __pyx_v_i)]));
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":718
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":719
* for i from 1 <= i < loc1.size:
* if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i]:
* return 1 # <<<<<<<<<<<<<<
@@ -43246,7 +43329,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
}
__pyx_L15:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":719
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":720
* if loc1.arr[loc1.start+i] > loc2.arr[loc2.start+i]:
* return 1
* if loc1.arr[loc1.start+i] < loc2.arr[loc2.start+i]: # <<<<<<<<<<<<<<
@@ -43256,7 +43339,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
__pyx_t_3 = ((__pyx_v_loc1->arr[(__pyx_v_loc1->start + __pyx_v_i)]) < (__pyx_v_loc2->arr[(__pyx_v_loc2->start + __pyx_v_i)]));
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":720
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":721
* return 1
* if loc1.arr[loc1.start+i] < loc2.arr[loc2.start+i]:
* return -1 # <<<<<<<<<<<<<<
@@ -43272,7 +43355,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":722
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":723
* return -1
*
* if loc2.arr[loc2.end-1] + len_last - loc1.arr[loc1.start] > self.train_max_initial_size: # <<<<<<<<<<<<<<
@@ -43282,7 +43365,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
__pyx_t_3 = ((((__pyx_v_loc2->arr[(__pyx_v_loc2->end - 1)]) + __pyx_v_len_last) - (__pyx_v_loc1->arr[__pyx_v_loc1->start])) > __pyx_v_self->train_max_initial_size);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":723
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":724
*
* if loc2.arr[loc2.end-1] + len_last - loc1.arr[loc1.start] > self.train_max_initial_size:
* return -1 # <<<<<<<<<<<<<<
@@ -43295,7 +43378,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
}
__pyx_L17:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":724
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":725
* if loc2.arr[loc2.end-1] + len_last - loc1.arr[loc1.start] > self.train_max_initial_size:
* return -1
* return 0 # <<<<<<<<<<<<<<
@@ -43311,7 +43394,7 @@ static long __pyx_f_3_sa_23HieroCachingRuleFactory_compare_matchings(struct __py
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":727
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":728
*
*
* cdef int* merge_helper(self, int low1, int high1, int* arr1, int step1, # <<<<<<<<<<<<<<
@@ -43335,7 +43418,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
int __pyx_t_3;
__Pyx_RefNannySetupContext("merge_helper", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":735
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":736
* cdef Matching loc1, loc2
*
* result_len[0] = 0 # <<<<<<<<<<<<<<
@@ -43344,7 +43427,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
*/
(__pyx_v_result_len[0]) = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":736
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":737
*
* result_len[0] = 0
* result = <int*> malloc(0*sizeof(int)) # <<<<<<<<<<<<<<
@@ -43353,7 +43436,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
*/
__pyx_v_result = ((int *)malloc((0 * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":738
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":739
* result = <int*> malloc(0*sizeof(int))
*
* i1 = low1 # <<<<<<<<<<<<<<
@@ -43362,7 +43445,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
*/
__pyx_v_i1 = __pyx_v_low1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":739
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":740
*
* i1 = low1
* i2 = low2 # <<<<<<<<<<<<<<
@@ -43371,7 +43454,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
*/
__pyx_v_i2 = __pyx_v_low2;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":740
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":741
* i1 = low1
* i2 = low2
* while i1 < high1 and i2 < high2: # <<<<<<<<<<<<<<
@@ -43388,7 +43471,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
}
if (!__pyx_t_3) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":743
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":744
*
* # First, pop all unneeded loc2's off the stack
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -43397,7 +43480,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
*/
__pyx_f_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":744
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":745
* # First, pop all unneeded loc2's off the stack
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr)
* while i2 < high2: # <<<<<<<<<<<<<<
@@ -43408,7 +43491,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
__pyx_t_3 = (__pyx_v_i2 < __pyx_v_high2);
if (!__pyx_t_3) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":745
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":746
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr)
* while i2 < high2:
* assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -43417,7 +43500,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
*/
__pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_i2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":746
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":747
* while i2 < high2:
* assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr)
* if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == 1: # <<<<<<<<<<<<<<
@@ -43427,7 +43510,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
__pyx_t_3 = (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last) == 1);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":747
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":748
* assign_matching(&loc2, arr2, i2, step2, self.fda.sent_id.arr)
* if self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) == 1:
* i2 = i2 + step2 # <<<<<<<<<<<<<<
@@ -43439,7 +43522,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":749
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":750
* i2 = i2 + step2
* else:
* break # <<<<<<<<<<<<<<
@@ -43452,7 +43535,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
}
__pyx_L6_break:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":752
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":753
*
* # Next: process all loc1's with the same starting val
* j1 = i1 # <<<<<<<<<<<<<<
@@ -43461,7 +43544,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
*/
__pyx_v_j1 = __pyx_v_i1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":753
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":754
* # Next: process all loc1's with the same starting val
* j1 = i1
* while i1 < high1 and arr1[j1] == arr1[i1]: # <<<<<<<<<<<<<<
@@ -43478,7 +43561,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
}
if (!__pyx_t_2) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":754
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":755
* j1 = i1
* while i1 < high1 and arr1[j1] == arr1[i1]:
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -43487,7 +43570,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
*/
__pyx_f_3_sa_assign_matching((&__pyx_v_loc1), __pyx_v_arr1, __pyx_v_i1, __pyx_v_step1, __pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":755
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":756
* while i1 < high1 and arr1[j1] == arr1[i1]:
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr)
* j2 = i2 # <<<<<<<<<<<<<<
@@ -43496,7 +43579,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
*/
__pyx_v_j2 = __pyx_v_i2;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":756
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":757
* assign_matching(&loc1, arr1, i1, step1, self.fda.sent_id.arr)
* j2 = i2
* while j2 < high2: # <<<<<<<<<<<<<<
@@ -43507,7 +43590,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
__pyx_t_2 = (__pyx_v_j2 < __pyx_v_high2);
if (!__pyx_t_2) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":757
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":758
* j2 = i2
* while j2 < high2:
* assign_matching(&loc2, arr2, j2, step2, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -43516,7 +43599,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
*/
__pyx_f_3_sa_assign_matching((&__pyx_v_loc2), __pyx_v_arr2, __pyx_v_j2, __pyx_v_step2, __pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":758
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":759
* while j2 < high2:
* assign_matching(&loc2, arr2, j2, step2, self.fda.sent_id.arr)
* comparison = self.compare_matchings(&loc1, &loc2, offset_by_one, len_last) # <<<<<<<<<<<<<<
@@ -43525,7 +43608,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
*/
__pyx_v_comparison = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->compare_matchings(__pyx_v_self, (&__pyx_v_loc1), (&__pyx_v_loc2), __pyx_v_offset_by_one, __pyx_v_len_last);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":759
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":760
* assign_matching(&loc2, arr2, j2, step2, self.fda.sent_id.arr)
* comparison = self.compare_matchings(&loc1, &loc2, offset_by_one, len_last)
* if comparison == 0: # <<<<<<<<<<<<<<
@@ -43535,7 +43618,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
__pyx_t_2 = (__pyx_v_comparison == 0);
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":760
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":761
* comparison = self.compare_matchings(&loc1, &loc2, offset_by_one, len_last)
* if comparison == 0:
* result = append_combined_matching(result, &loc1, &loc2, offset_by_one, num_subpatterns, result_len) # <<<<<<<<<<<<<<
@@ -43547,7 +43630,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
}
__pyx_L12:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":761
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":762
* if comparison == 0:
* result = append_combined_matching(result, &loc1, &loc2, offset_by_one, num_subpatterns, result_len)
* if comparison == 1: # <<<<<<<<<<<<<<
@@ -43560,7 +43643,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
}
__pyx_L13:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":763
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":764
* if comparison == 1:
* pass
* if comparison == -1: # <<<<<<<<<<<<<<
@@ -43570,7 +43653,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
__pyx_t_2 = (__pyx_v_comparison == -1);
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":764
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":765
* pass
* if comparison == -1:
* break # <<<<<<<<<<<<<<
@@ -43582,7 +43665,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":766
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":767
* break
* else:
* j2 = j2 + step2 # <<<<<<<<<<<<<<
@@ -43595,7 +43678,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
}
__pyx_L11_break:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":767
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":768
* else:
* j2 = j2 + step2
* i1 = i1 + step1 # <<<<<<<<<<<<<<
@@ -43606,7 +43689,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
}
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":768
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":769
* j2 = j2 + step2
* i1 = i1 + step1
* return result # <<<<<<<<<<<<<<
@@ -43622,7 +43705,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_merge_helper(struct __pyx_obj
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":771
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":772
*
*
* cdef void sort_phrase_loc(self, IntList arr, PhraseLocation loc, Phrase phrase): # <<<<<<<<<<<<<<
@@ -43644,26 +43727,26 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("sort_phrase_loc", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":776
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":777
* cdef IntList result
*
* if phrase in self.precomputed_index: # <<<<<<<<<<<<<<
* loc.arr = self.precomputed_index[phrase]
* else:
*/
- __pyx_t_1 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_v_phrase), __pyx_v_self->precomputed_index, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_v_phrase), __pyx_v_self->precomputed_index, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_1) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":777
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":778
*
* if phrase in self.precomputed_index:
* loc.arr = self.precomputed_index[phrase] # <<<<<<<<<<<<<<
* else:
* loc.arr = IntList(initial_len=loc.sa_high-loc.sa_low)
*/
- __pyx_t_2 = PyObject_GetItem(__pyx_v_self->precomputed_index, ((PyObject *)__pyx_v_phrase)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetItem(__pyx_v_self->precomputed_index, ((PyObject *)__pyx_v_phrase)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_loc->arr);
__Pyx_DECREF(((PyObject *)__pyx_v_loc->arr));
@@ -43673,20 +43756,20 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":779
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":780
* loc.arr = self.precomputed_index[phrase]
* else:
* loc.arr = IntList(initial_len=loc.sa_high-loc.sa_low) # <<<<<<<<<<<<<<
* veb = VEB(arr.len)
* for i from loc.sa_low <= i < loc.sa_high:
*/
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __pyx_t_3 = PyInt_FromLong((__pyx_v_loc->sa_high - __pyx_v_loc->sa_low)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong((__pyx_v_loc->sa_high - __pyx_v_loc->sa_low)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__Pyx_GIVEREF(__pyx_t_3);
@@ -43695,27 +43778,27 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_
__pyx_v_loc->arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":780
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":781
* else:
* loc.arr = IntList(initial_len=loc.sa_high-loc.sa_low)
* veb = VEB(arr.len) # <<<<<<<<<<<<<<
* for i from loc.sa_low <= i < loc.sa_high:
* veb._insert(arr.arr[i])
*/
- __pyx_t_3 = PyInt_FromLong(__pyx_v_arr->len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromLong(__pyx_v_arr->len); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_VEB)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_VEB)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_v_veb = ((struct __pyx_obj_3_sa_VEB *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":781
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":782
* loc.arr = IntList(initial_len=loc.sa_high-loc.sa_low)
* veb = VEB(arr.len)
* for i from loc.sa_low <= i < loc.sa_high: # <<<<<<<<<<<<<<
@@ -43725,7 +43808,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_
__pyx_t_4 = __pyx_v_loc->sa_high;
for (__pyx_v_i = __pyx_v_loc->sa_low; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":782
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":783
* veb = VEB(arr.len)
* for i from loc.sa_low <= i < loc.sa_high:
* veb._insert(arr.arr[i]) # <<<<<<<<<<<<<<
@@ -43735,7 +43818,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_
((struct __pyx_vtabstruct_3_sa_VEB *)__pyx_v_veb->__pyx_vtab)->_insert(__pyx_v_veb, (__pyx_v_arr->arr[__pyx_v_i]));
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":783
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":784
* for i from loc.sa_low <= i < loc.sa_high:
* veb._insert(arr.arr[i])
* i = veb.veb.min_val # <<<<<<<<<<<<<<
@@ -43744,7 +43827,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_
*/
__pyx_v_i = __pyx_v_veb->veb->min_val;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":784
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":785
* veb._insert(arr.arr[i])
* i = veb.veb.min_val
* for j from 0 <= j < loc.sa_high-loc.sa_low: # <<<<<<<<<<<<<<
@@ -43754,7 +43837,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_
__pyx_t_4 = (__pyx_v_loc->sa_high - __pyx_v_loc->sa_low);
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":785
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":786
* i = veb.veb.min_val
* for j from 0 <= j < loc.sa_high-loc.sa_low:
* loc.arr.arr[j] = i # <<<<<<<<<<<<<<
@@ -43763,7 +43846,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_
*/
(__pyx_v_loc->arr->arr[__pyx_v_j]) = __pyx_v_i;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":786
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":787
* for j from 0 <= j < loc.sa_high-loc.sa_low:
* loc.arr.arr[j] = i
* i = veb._findsucc(i) # <<<<<<<<<<<<<<
@@ -43775,7 +43858,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":787
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":788
* loc.arr.arr[j] = i
* i = veb._findsucc(i)
* loc.arr_low = 0 # <<<<<<<<<<<<<<
@@ -43784,7 +43867,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_
*/
__pyx_v_loc->arr_low = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":788
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":789
* i = veb._findsucc(i)
* loc.arr_low = 0
* loc.arr_high = loc.arr.len # <<<<<<<<<<<<<<
@@ -43803,7 +43886,7 @@ static void __pyx_f_3_sa_23HieroCachingRuleFactory_sort_phrase_loc(struct __pyx_
__Pyx_RefNannyFinishContext();
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":791
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":792
*
*
* cdef intersect_helper(self, Phrase prefix, Phrase suffix, # <<<<<<<<<<<<<<
@@ -43840,7 +43923,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("intersect_helper", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":798
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":799
* cdef int* result_ptr
*
* result_len = 0 # <<<<<<<<<<<<<<
@@ -43849,21 +43932,21 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
*/
__pyx_v_result_len = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":800
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":801
* result_len = 0
*
* if sym_isvar(suffix[0]): # <<<<<<<<<<<<<<
* offset_by_one = 1
* else:
*/
- __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_suffix), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_suffix), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_3 = __pyx_f_3_sa_sym_isvar(__pyx_t_2);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":801
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":802
*
* if sym_isvar(suffix[0]):
* offset_by_one = 1 # <<<<<<<<<<<<<<
@@ -43875,7 +43958,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":803
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":804
* offset_by_one = 1
* else:
* offset_by_one = 0 # <<<<<<<<<<<<<<
@@ -43886,34 +43969,34 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":805
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":806
* offset_by_one = 0
*
* len_last = len(suffix.getchunk(suffix.arity())) # <<<<<<<<<<<<<<
*
* if prefix_loc.arr is None:
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_suffix), __pyx_n_s__getchunk); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_suffix), __pyx_n_s__getchunk); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_suffix), __pyx_n_s__arity); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_suffix), __pyx_n_s__arity); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 805; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_len_last = __pyx_t_6;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":807
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":808
* len_last = len(suffix.getchunk(suffix.arity()))
*
* if prefix_loc.arr is None: # <<<<<<<<<<<<<<
@@ -43923,7 +44006,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
__pyx_t_7 = (((PyObject *)__pyx_v_prefix_loc->arr) == Py_None);
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":808
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":809
*
* if prefix_loc.arr is None:
* self.sort_phrase_loc(self.fsa.sa, prefix_loc, prefix) # <<<<<<<<<<<<<<
@@ -43938,7 +44021,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":809
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":810
* if prefix_loc.arr is None:
* self.sort_phrase_loc(self.fsa.sa, prefix_loc, prefix)
* arr1 = prefix_loc.arr # <<<<<<<<<<<<<<
@@ -43948,7 +44031,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
__Pyx_INCREF(((PyObject *)__pyx_v_prefix_loc->arr));
__pyx_v_arr1 = __pyx_v_prefix_loc->arr;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":810
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":811
* self.sort_phrase_loc(self.fsa.sa, prefix_loc, prefix)
* arr1 = prefix_loc.arr
* low1 = prefix_loc.arr_low # <<<<<<<<<<<<<<
@@ -43957,7 +44040,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
*/
__pyx_v_low1 = __pyx_v_prefix_loc->arr_low;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":811
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":812
* arr1 = prefix_loc.arr
* low1 = prefix_loc.arr_low
* high1 = prefix_loc.arr_high # <<<<<<<<<<<<<<
@@ -43966,7 +44049,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
*/
__pyx_v_high1 = __pyx_v_prefix_loc->arr_high;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":812
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":813
* low1 = prefix_loc.arr_low
* high1 = prefix_loc.arr_high
* step1 = prefix_loc.num_subpatterns # <<<<<<<<<<<<<<
@@ -43975,7 +44058,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
*/
__pyx_v_step1 = __pyx_v_prefix_loc->num_subpatterns;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":814
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":815
* step1 = prefix_loc.num_subpatterns
*
* if suffix_loc.arr is None: # <<<<<<<<<<<<<<
@@ -43985,7 +44068,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
__pyx_t_7 = (((PyObject *)__pyx_v_suffix_loc->arr) == Py_None);
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":815
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":816
*
* if suffix_loc.arr is None:
* self.sort_phrase_loc(self.fsa.sa, suffix_loc, suffix) # <<<<<<<<<<<<<<
@@ -44000,7 +44083,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":816
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":817
* if suffix_loc.arr is None:
* self.sort_phrase_loc(self.fsa.sa, suffix_loc, suffix)
* arr2 = suffix_loc.arr # <<<<<<<<<<<<<<
@@ -44010,7 +44093,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
__Pyx_INCREF(((PyObject *)__pyx_v_suffix_loc->arr));
__pyx_v_arr2 = __pyx_v_suffix_loc->arr;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":817
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":818
* self.sort_phrase_loc(self.fsa.sa, suffix_loc, suffix)
* arr2 = suffix_loc.arr
* low2 = suffix_loc.arr_low # <<<<<<<<<<<<<<
@@ -44019,7 +44102,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
*/
__pyx_v_low2 = __pyx_v_suffix_loc->arr_low;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":818
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":819
* arr2 = suffix_loc.arr
* low2 = suffix_loc.arr_low
* high2 = suffix_loc.arr_high # <<<<<<<<<<<<<<
@@ -44028,7 +44111,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
*/
__pyx_v_high2 = __pyx_v_suffix_loc->arr_high;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":819
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":820
* low2 = suffix_loc.arr_low
* high2 = suffix_loc.arr_high
* step2 = suffix_loc.num_subpatterns # <<<<<<<<<<<<<<
@@ -44037,26 +44120,26 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
*/
__pyx_v_step2 = __pyx_v_suffix_loc->num_subpatterns;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":821
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":822
* step2 = suffix_loc.num_subpatterns
*
* num_subpatterns = prefix.arity()+1 # <<<<<<<<<<<<<<
*
* if algorithm == MERGE:
*/
- __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_prefix), __pyx_n_s__arity); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_v_prefix), __pyx_n_s__arity); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_5); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_num_subpatterns = __pyx_t_3;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":823
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":824
* num_subpatterns = prefix.arity()+1
*
* if algorithm == MERGE: # <<<<<<<<<<<<<<
@@ -44066,7 +44149,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
__pyx_t_7 = (__pyx_v_algorithm == __pyx_v_3_sa_MERGE);
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":826
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":827
* result_ptr = self.merge_helper(low1, high1, arr1.arr, step1,
* low2, high2, arr2.arr, step2,
* offset_by_one, len_last, num_subpatterns, &result_len) # <<<<<<<<<<<<<<
@@ -44078,7 +44161,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":830
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":831
* result_ptr = self.baeza_yates_helper(low1, high1, arr1.arr, step1,
* low2, high2, arr2.arr, step2,
* offset_by_one, len_last, num_subpatterns, &result_len) # <<<<<<<<<<<<<<
@@ -44089,7 +44172,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
}
__pyx_L6:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":832
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":833
* offset_by_one, len_last, num_subpatterns, &result_len)
*
* if result_len == 0: # <<<<<<<<<<<<<<
@@ -44099,7 +44182,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
__pyx_t_7 = (__pyx_v_result_len == 0);
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":833
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":834
*
* if result_len == 0:
* free(result_ptr) # <<<<<<<<<<<<<<
@@ -44108,7 +44191,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
*/
free(__pyx_v_result_ptr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":834
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":835
* if result_len == 0:
* free(result_ptr)
* return None # <<<<<<<<<<<<<<
@@ -44123,19 +44206,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":836
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":837
* return None
* else:
* result = IntList() # <<<<<<<<<<<<<<
* free(result.arr)
* result.arr = result_ptr
*/
- __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_v_result = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_5);
__pyx_t_5 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":837
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":838
* else:
* result = IntList()
* free(result.arr) # <<<<<<<<<<<<<<
@@ -44144,7 +44227,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
*/
free(__pyx_v_result->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":838
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":839
* result = IntList()
* free(result.arr)
* result.arr = result_ptr # <<<<<<<<<<<<<<
@@ -44153,7 +44236,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
*/
__pyx_v_result->arr = __pyx_v_result_ptr;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":839
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":840
* free(result.arr)
* result.arr = result_ptr
* result.len = result_len # <<<<<<<<<<<<<<
@@ -44162,7 +44245,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
*/
__pyx_v_result->len = __pyx_v_result_len;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":840
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":841
* result.arr = result_ptr
* result.len = result_len
* result.size = result_len # <<<<<<<<<<<<<<
@@ -44171,7 +44254,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
*/
__pyx_v_result->size = __pyx_v_result_len;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":841
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":842
* result.len = result_len
* result.size = result_len
* return PhraseLocation(arr_low=0, arr_high=result_len, arr=result, num_subpatterns=num_subpatterns) # <<<<<<<<<<<<<<
@@ -44179,19 +44262,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
* cdef loc2str(self, PhraseLocation loc):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_5));
- if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__arr_low), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = PyInt_FromLong(__pyx_v_result_len); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__arr_low), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_v_result_len); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__arr_high), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__arr_high), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__arr), ((PyObject *)__pyx_v_result)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = PyInt_FromLong(__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__arr), ((PyObject *)__pyx_v_result)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__num_subpatterns), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__num_subpatterns), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
__pyx_r = __pyx_t_4;
@@ -44217,7 +44300,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_intersect_helper(struct
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":843
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":844
* return PhraseLocation(arr_low=0, arr_high=result_len, arr=result, num_subpatterns=num_subpatterns)
*
* cdef loc2str(self, PhraseLocation loc): # <<<<<<<<<<<<<<
@@ -44240,7 +44323,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("loc2str", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":845
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":846
* cdef loc2str(self, PhraseLocation loc):
* cdef int i, j
* result = "{" # <<<<<<<<<<<<<<
@@ -44250,7 +44333,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st
__Pyx_INCREF(((PyObject *)__pyx_kp_s_116));
__pyx_v_result = ((PyObject *)__pyx_kp_s_116);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":846
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":847
* cdef int i, j
* result = "{"
* i = 0 # <<<<<<<<<<<<<<
@@ -44259,7 +44342,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st
*/
__pyx_v_i = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":847
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":848
* result = "{"
* i = 0
* while i < loc.arr_high: # <<<<<<<<<<<<<<
@@ -44270,20 +44353,20 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st
__pyx_t_1 = (__pyx_v_i < __pyx_v_loc->arr_high);
if (!__pyx_t_1) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":848
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":849
* i = 0
* while i < loc.arr_high:
* result = result + "(" # <<<<<<<<<<<<<<
* for j from i <= j < i + loc.num_subpatterns:
* result = result + ("%d " %loc.arr[j])
*/
- __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_117)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_117)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_v_result);
__pyx_v_result = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":849
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":850
* while i < loc.arr_high:
* result = result + "("
* for j from i <= j < i + loc.num_subpatterns: # <<<<<<<<<<<<<<
@@ -44293,19 +44376,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st
__pyx_t_3 = (__pyx_v_i + __pyx_v_loc->num_subpatterns);
for (__pyx_v_j = __pyx_v_i; __pyx_v_j < __pyx_t_3; __pyx_v_j++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":850
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":851
* result = result + "("
* for j from i <= j < i + loc.num_subpatterns:
* result = result + ("%d " %loc.arr[j]) # <<<<<<<<<<<<<<
* result = result + ")"
* i = i + loc.num_subpatterns
*/
- __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_loc->arr), __pyx_v_j, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_loc->arr), __pyx_v_j, sizeof(int), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_v_result);
@@ -44313,20 +44396,20 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st
__pyx_t_2 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":851
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":852
* for j from i <= j < i + loc.num_subpatterns:
* result = result + ("%d " %loc.arr[j])
* result = result + ")" # <<<<<<<<<<<<<<
* i = i + loc.num_subpatterns
* result = result + "}"
*/
- __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_59)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_59)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_v_result);
__pyx_v_result = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":852
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":853
* result = result + ("%d " %loc.arr[j])
* result = result + ")"
* i = i + loc.num_subpatterns # <<<<<<<<<<<<<<
@@ -44336,20 +44419,20 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st
__pyx_v_i = (__pyx_v_i + __pyx_v_loc->num_subpatterns);
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":853
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":854
* result = result + ")"
* i = i + loc.num_subpatterns
* result = result + "}" # <<<<<<<<<<<<<<
* return result
*
*/
- __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_118)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_118)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_v_result);
__pyx_v_result = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":854
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":855
* i = i + loc.num_subpatterns
* result = result + "}"
* return result # <<<<<<<<<<<<<<
@@ -44375,7 +44458,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_loc2str(CYTHON_UNUSED st
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":856
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":857
* return result
*
* cdef PhraseLocation intersect(self, prefix_node, suffix_node, Phrase phrase): # <<<<<<<<<<<<<<
@@ -44401,81 +44484,81 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("intersect", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":860
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":861
* cdef PhraseLocation prefix_loc, suffix_loc, result
*
* prefix = prefix_node.phrase # <<<<<<<<<<<<<<
* suffix = suffix_node.phrase
* prefix_loc = prefix_node.phrase_location
*/
- __pyx_t_1 = PyObject_GetAttr(__pyx_v_prefix_node, __pyx_n_s__phrase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(__pyx_v_prefix_node, __pyx_n_s__phrase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_Phrase))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_Phrase))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_prefix = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":861
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":862
*
* prefix = prefix_node.phrase
* suffix = suffix_node.phrase # <<<<<<<<<<<<<<
* prefix_loc = prefix_node.phrase_location
* suffix_loc = suffix_node.phrase_location
*/
- __pyx_t_1 = PyObject_GetAttr(__pyx_v_suffix_node, __pyx_n_s__phrase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(__pyx_v_suffix_node, __pyx_n_s__phrase); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_Phrase))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_Phrase))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_suffix = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":862
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":863
* prefix = prefix_node.phrase
* suffix = suffix_node.phrase
* prefix_loc = prefix_node.phrase_location # <<<<<<<<<<<<<<
* suffix_loc = suffix_node.phrase_location
*
*/
- __pyx_t_1 = PyObject_GetAttr(__pyx_v_prefix_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(__pyx_v_prefix_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_prefix_loc = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":863
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":864
* suffix = suffix_node.phrase
* prefix_loc = prefix_node.phrase_location
* suffix_loc = suffix_node.phrase_location # <<<<<<<<<<<<<<
*
* result = self.get_precomputed_collocation(phrase)
*/
- __pyx_t_1 = PyObject_GetAttr(__pyx_v_suffix_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(__pyx_v_suffix_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_suffix_loc = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":865
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":866
* suffix_loc = suffix_node.phrase_location
*
* result = self.get_precomputed_collocation(phrase) # <<<<<<<<<<<<<<
* if result is not None:
* intersect_method = "precomputed"
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_119); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s_119); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_v_phrase));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_phrase));
__Pyx_GIVEREF(((PyObject *)__pyx_v_phrase));
- __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 866; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_result = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":866
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":867
*
* result = self.get_precomputed_collocation(phrase)
* if result is not None: # <<<<<<<<<<<<<<
@@ -44485,7 +44568,7 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact
__pyx_t_4 = (((PyObject *)__pyx_v_result) != Py_None);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":867
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":868
* result = self.get_precomputed_collocation(phrase)
* if result is not None:
* intersect_method = "precomputed" # <<<<<<<<<<<<<<
@@ -44498,7 +44581,7 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":869
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":870
* intersect_method = "precomputed"
*
* if result is None: # <<<<<<<<<<<<<<
@@ -44508,7 +44591,7 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact
__pyx_t_4 = (((PyObject *)__pyx_v_result) == Py_None);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":870
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":871
*
* if result is None:
* if self.use_baeza_yates: # <<<<<<<<<<<<<<
@@ -44517,21 +44600,21 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact
*/
if (__pyx_v_self->use_baeza_yates) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":871
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":872
* if result is None:
* if self.use_baeza_yates:
* result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, BAEZA_YATES) # <<<<<<<<<<<<<<
* intersect_method="double binary"
* else:
*/
- __pyx_t_3 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->intersect_helper(__pyx_v_self, __pyx_v_prefix, __pyx_v_suffix, __pyx_v_prefix_loc, __pyx_v_suffix_loc, __pyx_v_3_sa_BAEZA_YATES); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->intersect_helper(__pyx_v_self, __pyx_v_prefix, __pyx_v_suffix, __pyx_v_prefix_loc, __pyx_v_suffix_loc, __pyx_v_3_sa_BAEZA_YATES); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_v_result));
__pyx_v_result = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":872
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":873
* if self.use_baeza_yates:
* result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, BAEZA_YATES)
* intersect_method="double binary" # <<<<<<<<<<<<<<
@@ -44545,21 +44628,21 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":874
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":875
* intersect_method="double binary"
* else:
* result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, MERGE) # <<<<<<<<<<<<<<
* intersect_method="merge"
* return result
*/
- __pyx_t_3 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->intersect_helper(__pyx_v_self, __pyx_v_prefix, __pyx_v_suffix, __pyx_v_prefix_loc, __pyx_v_suffix_loc, __pyx_v_3_sa_MERGE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->intersect_helper(__pyx_v_self, __pyx_v_prefix, __pyx_v_suffix, __pyx_v_prefix_loc, __pyx_v_suffix_loc, __pyx_v_3_sa_MERGE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_v_result));
__pyx_v_result = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":875
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":876
* else:
* result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, MERGE)
* intersect_method="merge" # <<<<<<<<<<<<<<
@@ -44575,7 +44658,7 @@ static struct __pyx_obj_3_sa_PhraseLocation *__pyx_f_3_sa_23HieroCachingRuleFact
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":876
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":877
* result = self.intersect_helper(prefix, suffix, prefix_loc, suffix_loc, MERGE)
* intersect_method="merge"
* return result # <<<<<<<<<<<<<<
@@ -44637,16 +44720,16 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_13advance(PyObject *__p
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__res)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "advance") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "advance") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
@@ -44661,7 +44744,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_13advance(PyObject *__p
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 878; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("advance", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.advance", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -44672,7 +44755,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_13advance(PyObject *__p
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":878
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":879
* return result
*
* def advance(self, frontier, res, fwords): # <<<<<<<<<<<<<<
@@ -44713,19 +44796,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("advance", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":880
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":881
* def advance(self, frontier, res, fwords):
* cdef unsigned na
* nf = [] # <<<<<<<<<<<<<<
* for (toskip, (i, alt, pathlen)) in frontier:
* spanlen = fwords[i][alt][2]
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_nf = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":881
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":882
* cdef unsigned na
* nf = []
* for (toskip, (i, alt, pathlen)) in frontier: # <<<<<<<<<<<<<<
@@ -44736,7 +44819,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
__pyx_t_1 = __pyx_v_frontier; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
__pyx_t_3 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_frontier); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_frontier); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -44744,23 +44827,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_3(__pyx_t_1);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -44776,7 +44859,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -44789,14 +44872,14 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
- __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
@@ -44804,7 +44887,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
__Pyx_GOTREF(__pyx_t_5);
index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L6_unpacking_done;
@@ -44812,7 +44895,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L6_unpacking_done:;
}
__Pyx_XDECREF(__pyx_v_toskip);
@@ -44828,7 +44911,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -44844,15 +44927,15 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
__Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(__pyx_t_10);
#else
- __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_10 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_11 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_8 = Py_TYPE(__pyx_t_11)->tp_iternext;
@@ -44862,7 +44945,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
__Pyx_GOTREF(__pyx_t_9);
index = 2; __pyx_t_10 = __pyx_t_8(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L7_unpacking_failed;
__Pyx_GOTREF(__pyx_t_10);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_11), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_11), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
goto __pyx_L8_unpacking_done;
@@ -44870,7 +44953,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 881; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L8_unpacking_done:;
}
__Pyx_XDECREF(__pyx_v_i);
@@ -44883,45 +44966,45 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
__pyx_v_pathlen = __pyx_t_10;
__pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":882
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":883
* nf = []
* for (toskip, (i, alt, pathlen)) in frontier:
* spanlen = fwords[i][alt][2] # <<<<<<<<<<<<<<
* if (toskip == 0):
* res.append((i, alt, pathlen))
*/
- __pyx_t_4 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = PyObject_GetItem(__pyx_t_4, __pyx_v_alt); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_GetItem(__pyx_t_4, __pyx_v_alt); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF(__pyx_v_spanlen);
__pyx_v_spanlen = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":883
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":884
* for (toskip, (i, alt, pathlen)) in frontier:
* spanlen = fwords[i][alt][2]
* if (toskip == 0): # <<<<<<<<<<<<<<
* res.append((i, alt, pathlen))
* ni = i + spanlen
*/
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_toskip, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_v_toskip, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_12) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":884
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":885
* spanlen = fwords[i][alt][2]
* if (toskip == 0):
* res.append((i, alt, pathlen)) # <<<<<<<<<<<<<<
* ni = i + spanlen
* if (ni < len(fwords) and (pathlen + 1) < self.max_initial_size):
*/
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_i);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_i);
@@ -44932,7 +45015,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
__Pyx_INCREF(__pyx_v_pathlen);
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_pathlen);
__Pyx_GIVEREF(__pyx_v_pathlen);
- __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_res, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Append(__pyx_v_res, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
@@ -44940,42 +45023,42 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
}
__pyx_L9:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":885
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":886
* if (toskip == 0):
* res.append((i, alt, pathlen))
* ni = i + spanlen # <<<<<<<<<<<<<<
* if (ni < len(fwords) and (pathlen + 1) < self.max_initial_size):
* for na in range(len(fwords[ni])):
*/
- __pyx_t_6 = PyNumber_Add(__pyx_v_i, __pyx_v_spanlen); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Add(__pyx_v_i, __pyx_v_spanlen); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_v_ni);
__pyx_v_ni = __pyx_t_6;
__pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":886
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":887
* res.append((i, alt, pathlen))
* ni = i + spanlen
* if (ni < len(fwords) and (pathlen + 1) < self.max_initial_size): # <<<<<<<<<<<<<<
* for na in range(len(fwords[ni])):
* nf.append((toskip - 1, (ni, na, pathlen + 1)))
*/
- __pyx_t_13 = PyObject_Length(__pyx_v_fwords); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_Length(__pyx_v_fwords); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_ni, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_v_ni, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_12) {
- __pyx_t_4 = PyNumber_Add(__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = PyInt_FromLong(__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyInt_FromLong(__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_15 = __pyx_t_14;
} else {
@@ -44983,34 +45066,34 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
}
if (__pyx_t_15) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":887
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":888
* ni = i + spanlen
* if (ni < len(fwords) and (pathlen + 1) < self.max_initial_size):
* for na in range(len(fwords[ni])): # <<<<<<<<<<<<<<
* nf.append((toskip - 1, (ni, na, pathlen + 1)))
* if (len(nf) > 0):
*/
- __pyx_t_5 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ni); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ni); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_13 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 887; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_13; __pyx_t_16+=1) {
__pyx_v_na = __pyx_t_16;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":888
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":889
* if (ni < len(fwords) and (pathlen + 1) < self.max_initial_size):
* for na in range(len(fwords[ni])):
* nf.append((toskip - 1, (ni, na, pathlen + 1))) # <<<<<<<<<<<<<<
* if (len(nf) > 0):
* return self.advance(nf, res, fwords)
*/
- __pyx_t_5 = PyNumber_Subtract(__pyx_v_toskip, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyNumber_Subtract(__pyx_v_toskip, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PyLong_FromUnsignedLong(__pyx_v_na); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyLong_FromUnsignedLong(__pyx_v_na); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = PyNumber_Add(__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_INCREF(__pyx_v_ni);
PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_ni);
@@ -45021,7 +45104,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_6 = 0;
__pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
@@ -45029,7 +45112,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
__Pyx_GIVEREF(((PyObject *)__pyx_t_10));
__pyx_t_5 = 0;
__pyx_t_10 = 0;
- __pyx_t_17 = PyList_Append(__pyx_v_nf, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PyList_Append(__pyx_v_nf, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
}
goto __pyx_L10;
@@ -45038,18 +45121,18 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":889
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":890
* for na in range(len(fwords[ni])):
* nf.append((toskip - 1, (ni, na, pathlen + 1)))
* if (len(nf) > 0): # <<<<<<<<<<<<<<
* return self.advance(nf, res, fwords)
* else:
*/
- __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_v_nf)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_v_nf)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_15 = (__pyx_t_2 > 0);
if (__pyx_t_15) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":890
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":891
* nf.append((toskip - 1, (ni, na, pathlen + 1)))
* if (len(nf) > 0):
* return self.advance(nf, res, fwords) # <<<<<<<<<<<<<<
@@ -45057,9 +45140,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
* return res
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__advance); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__advance); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_v_nf));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_nf));
@@ -45070,7 +45153,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
__Pyx_INCREF(__pyx_v_fwords);
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_fwords);
__Pyx_GIVEREF(__pyx_v_fwords);
- __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
@@ -45081,7 +45164,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12advance(struct __pyx_
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":892
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":893
* return self.advance(nf, res, fwords)
* else:
* return res # <<<<<<<<<<<<<<
@@ -45159,36 +45242,36 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_15get_all_nodes_isteps_
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__spanlen)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pathlen)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fwords)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__next_states)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reachable_buffer)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_all_nodes_isteps_away") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_all_nodes_isteps_away") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
goto __pyx_L5_argtuple_error;
@@ -45211,7 +45294,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_15get_all_nodes_isteps_
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("get_all_nodes_isteps_away", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.get_all_nodes_isteps_away", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -45222,7 +45305,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_15get_all_nodes_isteps_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":894
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":895
* return res
*
* def get_all_nodes_isteps_away(self, skip, i, spanlen, pathlen, fwords, next_states, reachable_buffer): # <<<<<<<<<<<<<<
@@ -45260,41 +45343,41 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_all_nodes_isteps_away", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":896
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":897
* def get_all_nodes_isteps_away(self, skip, i, spanlen, pathlen, fwords, next_states, reachable_buffer):
* cdef unsigned alt_it
* frontier = [] # <<<<<<<<<<<<<<
* if (i+spanlen+skip >= len(next_states)):
* return frontier
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_frontier = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":897
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":898
* cdef unsigned alt_it
* frontier = []
* if (i+spanlen+skip >= len(next_states)): # <<<<<<<<<<<<<<
* return frontier
* key = tuple([i,spanlen])
*/
- __pyx_t_1 = PyNumber_Add(__pyx_v_i, __pyx_v_spanlen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Add(__pyx_v_i, __pyx_v_spanlen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_skip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_skip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_3 = PyObject_Length(__pyx_v_next_states); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Length(__pyx_v_next_states); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":898
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":899
* frontier = []
* if (i+spanlen+skip >= len(next_states)):
* return frontier # <<<<<<<<<<<<<<
@@ -45309,14 +45392,14 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":899
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":900
* if (i+spanlen+skip >= len(next_states)):
* return frontier
* key = tuple([i,spanlen]) # <<<<<<<<<<<<<<
* reachable = []
* if (key in reachable_buffer):
*/
- __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_i);
PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_i);
@@ -45324,42 +45407,42 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
__Pyx_INCREF(__pyx_v_spanlen);
PyList_SET_ITEM(__pyx_t_4, 1, __pyx_v_spanlen);
__Pyx_GIVEREF(__pyx_v_spanlen);
- __pyx_t_1 = ((PyObject *)PyList_AsTuple(__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = ((PyObject *)PyList_AsTuple(__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__pyx_v_key = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":900
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":901
* return frontier
* key = tuple([i,spanlen])
* reachable = [] # <<<<<<<<<<<<<<
* if (key in reachable_buffer):
* reachable = reachable_buffer[key]
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_reachable = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":901
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":902
* key = tuple([i,spanlen])
* reachable = []
* if (key in reachable_buffer): # <<<<<<<<<<<<<<
* reachable = reachable_buffer[key]
* else:
*/
- __pyx_t_5 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_v_key), __pyx_v_reachable_buffer, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_v_key), __pyx_v_reachable_buffer, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":902
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":903
* reachable = []
* if (key in reachable_buffer):
* reachable = reachable_buffer[key] # <<<<<<<<<<<<<<
* else:
* reachable = self.reachable(fwords, i, spanlen)
*/
- __pyx_t_1 = PyObject_GetItem(__pyx_v_reachable_buffer, ((PyObject *)__pyx_v_key)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetItem(__pyx_v_reachable_buffer, ((PyObject *)__pyx_v_key)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_v_reachable);
__pyx_v_reachable = __pyx_t_1;
@@ -45368,16 +45451,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":904
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":905
* reachable = reachable_buffer[key]
* else:
* reachable = self.reachable(fwords, i, spanlen) # <<<<<<<<<<<<<<
* reachable_buffer[key] = reachable
* for nextreachable in reachable:
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_fwords);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_fwords);
@@ -45388,7 +45471,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
__Pyx_INCREF(__pyx_v_spanlen);
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_spanlen);
__Pyx_GIVEREF(__pyx_v_spanlen);
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
@@ -45396,18 +45479,18 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
__pyx_v_reachable = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":905
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":906
* else:
* reachable = self.reachable(fwords, i, spanlen)
* reachable_buffer[key] = reachable # <<<<<<<<<<<<<<
* for nextreachable in reachable:
* for next_id in next_states[nextreachable]:
*/
- if (PyObject_SetItem(__pyx_v_reachable_buffer, ((PyObject *)__pyx_v_key), __pyx_v_reachable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_v_reachable_buffer, ((PyObject *)__pyx_v_key), __pyx_v_reachable) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":906
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":907
* reachable = self.reachable(fwords, i, spanlen)
* reachable_buffer[key] = reachable
* for nextreachable in reachable: # <<<<<<<<<<<<<<
@@ -45418,7 +45501,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
__pyx_t_2 = __pyx_v_reachable; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
__pyx_t_6 = NULL;
} else {
- __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_reachable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_reachable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext;
}
@@ -45426,23 +45509,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_2)) {
if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_2)) {
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __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_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __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_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_6(__pyx_t_2);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -45452,20 +45535,20 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
__pyx_v_nextreachable = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":907
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":908
* reachable_buffer[key] = reachable
* for nextreachable in reachable:
* for next_id in next_states[nextreachable]: # <<<<<<<<<<<<<<
* jump = self.shortest(fwords,i,next_id)
* if jump < skip:
*/
- __pyx_t_4 = PyObject_GetItem(__pyx_v_next_states, __pyx_v_nextreachable); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetItem(__pyx_v_next_states, __pyx_v_nextreachable); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
__pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
} else {
- __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -45474,23 +45557,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_8(__pyx_t_1);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -45500,16 +45583,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
__pyx_v_next_id = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":908
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":909
* for nextreachable in reachable:
* for next_id in next_states[nextreachable]:
* jump = self.shortest(fwords,i,next_id) # <<<<<<<<<<<<<<
* if jump < skip:
* continue
*/
- __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__shortest); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__shortest); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_INCREF(__pyx_v_fwords);
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_fwords);
@@ -45520,7 +45603,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
__Pyx_INCREF(__pyx_v_next_id);
PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_next_id);
__Pyx_GIVEREF(__pyx_v_next_id);
- __pyx_t_10 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
@@ -45528,19 +45611,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
__pyx_v_jump = __pyx_t_10;
__pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":909
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":910
* for next_id in next_states[nextreachable]:
* jump = self.shortest(fwords,i,next_id)
* if jump < skip: # <<<<<<<<<<<<<<
* continue
* if pathlen+jump <= self.max_initial_size:
*/
- __pyx_t_10 = PyObject_RichCompare(__pyx_v_jump, __pyx_v_skip, Py_LT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_RichCompare(__pyx_v_jump, __pyx_v_skip, Py_LT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":910
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":911
* jump = self.shortest(fwords,i,next_id)
* if jump < skip:
* continue # <<<<<<<<<<<<<<
@@ -45552,50 +45635,50 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
}
__pyx_L9:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":911
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":912
* if jump < skip:
* continue
* if pathlen+jump <= self.max_initial_size: # <<<<<<<<<<<<<<
* for alt_id in range(len(fwords[next_id])):
* if (fwords[next_id][alt_id][0] != EPSILON):
*/
- __pyx_t_10 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_9 = PyInt_FromLong(__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyInt_FromLong(__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_10, __pyx_t_9, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_t_10, __pyx_t_9, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":912
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":913
* continue
* if pathlen+jump <= self.max_initial_size:
* for alt_id in range(len(fwords[next_id])): # <<<<<<<<<<<<<<
* if (fwords[next_id][alt_id][0] != EPSILON):
* newel = (next_id,alt_id,pathlen+jump)
*/
- __pyx_t_4 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_next_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_next_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_11 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
__pyx_t_9 = __pyx_t_4; __Pyx_INCREF(__pyx_t_9); __pyx_t_11 = 0;
__pyx_t_12 = NULL;
} else {
- __pyx_t_11 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_12 = Py_TYPE(__pyx_t_9)->tp_iternext;
}
@@ -45604,23 +45687,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_9)) {
if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_9)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_9, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_9, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_9)) {
if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_4); __pyx_t_11++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_9, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_9, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_12(__pyx_t_9);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -45630,40 +45713,40 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
__pyx_v_alt_id = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":913
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":914
* if pathlen+jump <= self.max_initial_size:
* for alt_id in range(len(fwords[next_id])):
* if (fwords[next_id][alt_id][0] != EPSILON): # <<<<<<<<<<<<<<
* newel = (next_id,alt_id,pathlen+jump)
* if newel not in frontier:
*/
- __pyx_t_4 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_next_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_next_id); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_10 = PyObject_GetItem(__pyx_t_4, __pyx_v_alt_id); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_GetItem(__pyx_t_4, __pyx_v_alt_id); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_10, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_10, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_13 = PyObject_RichCompare(__pyx_t_4, __pyx_t_10, Py_NE); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_RichCompare(__pyx_t_4, __pyx_t_10, Py_NE); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":914
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":915
* for alt_id in range(len(fwords[next_id])):
* if (fwords[next_id][alt_id][0] != EPSILON):
* newel = (next_id,alt_id,pathlen+jump) # <<<<<<<<<<<<<<
* if newel not in frontier:
* frontier.append((next_id,alt_id,pathlen+jump))
*/
- __pyx_t_13 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_13);
- __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_INCREF(__pyx_v_next_id);
PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_next_id);
@@ -45678,26 +45761,26 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
__pyx_v_newel = __pyx_t_10;
__pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":915
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":916
* if (fwords[next_id][alt_id][0] != EPSILON):
* newel = (next_id,alt_id,pathlen+jump)
* if newel not in frontier: # <<<<<<<<<<<<<<
* frontier.append((next_id,alt_id,pathlen+jump))
* return frontier
*/
- __pyx_t_5 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_v_newel), ((PyObject *)__pyx_v_frontier), Py_NE)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_v_newel), ((PyObject *)__pyx_v_frontier), Py_NE)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":916
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":917
* newel = (next_id,alt_id,pathlen+jump)
* if newel not in frontier:
* frontier.append((next_id,alt_id,pathlen+jump)) # <<<<<<<<<<<<<<
* return frontier
*
*/
- __pyx_t_10 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyNumber_Add(__pyx_v_pathlen, __pyx_v_jump); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_13);
__Pyx_INCREF(__pyx_v_next_id);
PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_v_next_id);
@@ -45708,7 +45791,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_10);
__Pyx_GIVEREF(__pyx_t_10);
__pyx_t_10 = 0;
- __pyx_t_14 = PyList_Append(__pyx_v_frontier, ((PyObject *)__pyx_t_13)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyList_Append(__pyx_v_frontier, ((PyObject *)__pyx_t_13)); if (unlikely(__pyx_t_14 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
goto __pyx_L14;
}
@@ -45727,7 +45810,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_14get_all_nodes_isteps_
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":917
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":918
* if newel not in frontier:
* frontier.append((next_id,alt_id,pathlen+jump))
* return frontier # <<<<<<<<<<<<<<
@@ -45794,16 +45877,16 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_17reachable(PyObject *_
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ifrom)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dist)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reachable") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reachable") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
@@ -45818,7 +45901,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_17reachable(PyObject *_
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("reachable", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.reachable", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -45829,7 +45912,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_17reachable(PyObject *_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":919
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":920
* return frontier
*
* def reachable(self, fwords, ifrom, dist): # <<<<<<<<<<<<<<
@@ -45859,35 +45942,35 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("reachable", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":920
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":921
*
* def reachable(self, fwords, ifrom, dist):
* ret = [] # <<<<<<<<<<<<<<
* if (ifrom >= len(fwords)):
* return ret
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ret = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":921
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":922
* def reachable(self, fwords, ifrom, dist):
* ret = []
* if (ifrom >= len(fwords)): # <<<<<<<<<<<<<<
* return ret
* for alt_id in range(len(fwords[ifrom])):
*/
- __pyx_t_2 = PyObject_Length(__pyx_v_fwords); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_v_fwords); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_ifrom, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_RichCompare(__pyx_v_ifrom, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":922
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":923
* ret = []
* if (ifrom >= len(fwords)):
* return ret # <<<<<<<<<<<<<<
@@ -45902,32 +45985,32 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":923
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":924
* if (ifrom >= len(fwords)):
* return ret
* for alt_id in range(len(fwords[ifrom])): # <<<<<<<<<<<<<<
* if (fwords[ifrom][alt_id][0] == EPSILON):
* ret.extend(self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist))
*/
- __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
__pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
__pyx_t_5 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -45936,23 +46019,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py
if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_3 = __pyx_t_5(__pyx_t_1);
if (unlikely(!__pyx_t_3)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -45962,53 +46045,53 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py
__pyx_v_alt_id = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":924
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":925
* return ret
* for alt_id in range(len(fwords[ifrom])):
* if (fwords[ifrom][alt_id][0] == EPSILON): # <<<<<<<<<<<<<<
* ret.extend(self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist))
* else:
*/
- __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = PyObject_GetItem(__pyx_t_3, __pyx_v_alt_id); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_GetItem(__pyx_t_3, __pyx_v_alt_id); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":925
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":926
* for alt_id in range(len(fwords[ifrom])):
* if (fwords[ifrom][alt_id][0] == EPSILON):
* ret.extend(self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist)) # <<<<<<<<<<<<<<
* else:
* if (dist==0):
*/
- __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_ret), __pyx_n_s__extend); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_v_ret), __pyx_n_s__extend); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_8 = PyObject_GetItem(__pyx_t_3, __pyx_v_alt_id); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetItem(__pyx_t_3, __pyx_v_alt_id); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_8, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_8, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyNumber_Add(__pyx_v_ifrom, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyNumber_Add(__pyx_v_ifrom, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_fwords);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_fwords);
@@ -46019,16 +46102,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_dist);
__Pyx_GIVEREF(__pyx_v_dist);
__pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
__pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
@@ -46037,36 +46120,36 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":927
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":928
* ret.extend(self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist))
* else:
* if (dist==0): # <<<<<<<<<<<<<<
* if (ifrom not in ret):
* ret.append(ifrom)
*/
- __pyx_t_8 = PyObject_RichCompare(__pyx_v_dist, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_RichCompare(__pyx_v_dist, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":928
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":929
* else:
* if (dist==0):
* if (ifrom not in ret): # <<<<<<<<<<<<<<
* ret.append(ifrom)
* else:
*/
- __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_v_ifrom, ((PyObject *)__pyx_v_ret), Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_v_ifrom, ((PyObject *)__pyx_v_ret), Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":929
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":930
* if (dist==0):
* if (ifrom not in ret):
* ret.append(ifrom) # <<<<<<<<<<<<<<
* else:
* for ifromchild in self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist-1):
*/
- __pyx_t_9 = PyList_Append(__pyx_v_ret, __pyx_v_ifrom); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyList_Append(__pyx_v_ret, __pyx_v_ifrom); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L8;
}
__pyx_L8:;
@@ -46074,29 +46157,29 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":931
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":932
* ret.append(ifrom)
* else:
* for ifromchild in self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist-1): # <<<<<<<<<<<<<<
* if (ifromchild not in ret):
* ret.append(ifromchild)
*/
- __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__reachable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_7 = PyObject_GetItem(__pyx_t_3, __pyx_v_alt_id); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_GetItem(__pyx_t_3, __pyx_v_alt_id); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_7, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_7, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = PyNumber_Add(__pyx_v_ifrom, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyNumber_Add(__pyx_v_ifrom, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Subtract(__pyx_v_dist, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Subtract(__pyx_v_dist, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(__pyx_v_fwords);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_fwords);
@@ -46107,7 +46190,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_7 = 0;
__pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
@@ -46115,7 +46198,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py
__pyx_t_6 = __pyx_t_3; __Pyx_INCREF(__pyx_t_6); __pyx_t_10 = 0;
__pyx_t_11 = NULL;
} else {
- __pyx_t_10 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_11 = Py_TYPE(__pyx_t_6)->tp_iternext;
}
@@ -46124,23 +46207,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py
if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_6)) {
if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_6)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_6)) {
if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_3 = __pyx_t_11(__pyx_t_6);
if (unlikely(!__pyx_t_3)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -46150,24 +46233,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py
__pyx_v_ifromchild = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":932
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":933
* else:
* for ifromchild in self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist-1):
* if (ifromchild not in ret): # <<<<<<<<<<<<<<
* ret.append(ifromchild)
*
*/
- __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_v_ifromchild, ((PyObject *)__pyx_v_ret), Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_v_ifromchild, ((PyObject *)__pyx_v_ret), Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":933
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":934
* for ifromchild in self.reachable(fwords,ifrom+fwords[ifrom][alt_id][2],dist-1):
* if (ifromchild not in ret):
* ret.append(ifromchild) # <<<<<<<<<<<<<<
*
* return ret
*/
- __pyx_t_9 = PyList_Append(__pyx_v_ret, __pyx_v_ifromchild); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyList_Append(__pyx_v_ret, __pyx_v_ifromchild); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L11;
}
__pyx_L11:;
@@ -46180,7 +46263,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_16reachable(struct __py
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":935
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":936
* ret.append(ifromchild)
*
* return ret # <<<<<<<<<<<<<<
@@ -46241,16 +46324,16 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_19shortest(PyObject *__
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ifrom)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ito)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortest") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "shortest") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
@@ -46265,7 +46348,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_19shortest(PyObject *__
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("shortest", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.shortest", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -46276,7 +46359,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_19shortest(PyObject *__
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":937
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":938
* return ret
*
* def shortest(self, fwords, ifrom, ito): # <<<<<<<<<<<<<<
@@ -46301,7 +46384,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("shortest", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":939
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":940
* def shortest(self, fwords, ifrom, ito):
* cdef unsigned alt_id
* min = 1000 # <<<<<<<<<<<<<<
@@ -46311,19 +46394,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx
__Pyx_INCREF(__pyx_int_1000);
__pyx_v_min = __pyx_int_1000;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":940
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":941
* cdef unsigned alt_id
* min = 1000
* if (ifrom > ito): # <<<<<<<<<<<<<<
* return min
* if (ifrom == ito):
*/
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_ifrom, __pyx_v_ito, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_ifrom, __pyx_v_ito, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":941
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":942
* min = 1000
* if (ifrom > ito):
* return min # <<<<<<<<<<<<<<
@@ -46338,19 +46421,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":942
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":943
* if (ifrom > ito):
* return min
* if (ifrom == ito): # <<<<<<<<<<<<<<
* return 0
* for alt_id in range(len(fwords[ifrom])):
*/
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_ifrom, __pyx_v_ito, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_ifrom, __pyx_v_ito, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":943
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":944
* return min
* if (ifrom == ito):
* return 0 # <<<<<<<<<<<<<<
@@ -46365,41 +46448,41 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":944
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":945
* if (ifrom == ito):
* return 0
* for alt_id in range(len(fwords[ifrom])): # <<<<<<<<<<<<<<
* currmin = self.shortest(fwords,ifrom+fwords[ifrom][alt_id][2],ito)
* if (fwords[ifrom][alt_id][0] != EPSILON):
*/
- __pyx_t_1 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_alt_id = __pyx_t_4;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":945
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":946
* return 0
* for alt_id in range(len(fwords[ifrom])):
* currmin = self.shortest(fwords,ifrom+fwords[ifrom][alt_id][2],ito) # <<<<<<<<<<<<<<
* if (fwords[ifrom][alt_id][0] != EPSILON):
* currmin += 1
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__shortest); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__shortest); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_alt_id, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, __pyx_v_alt_id, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyNumber_Add(__pyx_v_ifrom, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Add(__pyx_v_ifrom, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_v_fwords);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_fwords);
@@ -46410,7 +46493,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_ito);
__Pyx_GIVEREF(__pyx_v_ito);
__pyx_t_6 = 0;
- __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
@@ -46418,38 +46501,38 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx
__pyx_v_currmin = __pyx_t_6;
__pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":946
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":947
* for alt_id in range(len(fwords[ifrom])):
* currmin = self.shortest(fwords,ifrom+fwords[ifrom][alt_id][2],ito)
* if (fwords[ifrom][alt_id][0] != EPSILON): # <<<<<<<<<<<<<<
* currmin += 1
* if (currmin<min):
*/
- __pyx_t_6 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_GetItem(__pyx_v_fwords, __pyx_v_ifrom); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_alt_id, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, __pyx_v_alt_id, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":947
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":948
* currmin = self.shortest(fwords,ifrom+fwords[ifrom][alt_id][2],ito)
* if (fwords[ifrom][alt_id][0] != EPSILON):
* currmin += 1 # <<<<<<<<<<<<<<
* if (currmin<min):
* min = currmin
*/
- __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_currmin, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_currmin, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_v_currmin);
__pyx_v_currmin = __pyx_t_1;
@@ -46458,19 +46541,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx
}
__pyx_L7:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":948
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":949
* if (fwords[ifrom][alt_id][0] != EPSILON):
* currmin += 1
* if (currmin<min): # <<<<<<<<<<<<<<
* min = currmin
* return min
*/
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_currmin, __pyx_v_min, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_currmin, __pyx_v_min, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":949
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":950
* currmin += 1
* if (currmin<min):
* min = currmin # <<<<<<<<<<<<<<
@@ -46485,7 +46568,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_18shortest(struct __pyx
__pyx_L8:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":950
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":951
* if (currmin<min):
* min = currmin
* return min # <<<<<<<<<<<<<<
@@ -46544,7 +46627,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_21get_next_states(PyObj
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__curr_idx)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("get_next_states", 0, 2, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("get_next_states", 0, 2, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (kw_args > 0) {
@@ -46553,7 +46636,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_21get_next_states(PyObj
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_next_states") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_next_states") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -46570,7 +46653,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_21get_next_states(PyObj
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("get_next_states", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 952; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("get_next_states", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.get_next_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -46581,7 +46664,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_21get_next_states(PyObj
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":952
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":953
* return min
*
* def get_next_states(self, _columns, curr_idx, min_dist=2): # <<<<<<<<<<<<<<
@@ -46614,26 +46697,26 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_next_states", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":953
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":954
*
* def get_next_states(self, _columns, curr_idx, min_dist=2):
* result = [] # <<<<<<<<<<<<<<
* candidate = [[curr_idx,0]]
*
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_result = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":954
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":955
* def get_next_states(self, _columns, curr_idx, min_dist=2):
* result = []
* candidate = [[curr_idx,0]] # <<<<<<<<<<<<<<
*
* while len(candidate) > 0:
*/
- __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_curr_idx);
PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_curr_idx);
@@ -46641,7 +46724,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
__Pyx_INCREF(__pyx_int_0);
PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_0);
__Pyx_GIVEREF(__pyx_int_0);
- __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
__Pyx_GIVEREF(((PyObject *)__pyx_t_1));
@@ -46649,7 +46732,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
__pyx_v_candidate = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":956
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":957
* candidate = [[curr_idx,0]]
*
* while len(candidate) > 0: # <<<<<<<<<<<<<<
@@ -46657,43 +46740,43 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
* if curr[0] >= len(_columns):
*/
while (1) {
- __pyx_t_3 = PyList_GET_SIZE(((PyObject *)__pyx_v_candidate)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_GET_SIZE(((PyObject *)__pyx_v_candidate)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_4 = (__pyx_t_3 > 0);
if (!__pyx_t_4) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":957
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":958
*
* while len(candidate) > 0:
* curr = candidate.pop() # <<<<<<<<<<<<<<
* if curr[0] >= len(_columns):
* continue
*/
- __pyx_t_2 = __Pyx_PyObject_Pop(((PyObject *)__pyx_v_candidate)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Pop(((PyObject *)__pyx_v_candidate)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_v_curr);
__pyx_v_curr = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":958
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":959
* while len(candidate) > 0:
* curr = candidate.pop()
* if curr[0] >= len(_columns): # <<<<<<<<<<<<<<
* continue
* if curr[0] not in result and min_dist <= curr[1] <= self.max_initial_size:
*/
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyObject_Length(__pyx_v__columns); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Length(__pyx_v__columns); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":959
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":960
* curr = candidate.pop()
* if curr[0] >= len(_columns):
* continue # <<<<<<<<<<<<<<
@@ -46705,30 +46788,30 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":960
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":961
* if curr[0] >= len(_columns):
* continue
* if curr[0] not in result and min_dist <= curr[1] <= self.max_initial_size: # <<<<<<<<<<<<<<
* result.append(curr[0]);
* curr_col = _columns[curr[0]]
*/
- __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_t_5, ((PyObject *)__pyx_v_result), Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_t_5, ((PyObject *)__pyx_v_result), Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_4) {
- __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_curr, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_curr, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_min_dist, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_min_dist, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
__Pyx_DECREF(__pyx_t_1);
- __pyx_t_2 = PyInt_FromLong(__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_7 = __pyx_t_6;
} else {
@@ -46736,38 +46819,38 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
}
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":961
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":962
* continue
* if curr[0] not in result and min_dist <= curr[1] <= self.max_initial_size:
* result.append(curr[0]); # <<<<<<<<<<<<<<
* curr_col = _columns[curr[0]]
* for alt in curr_col:
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_8 = PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L6;
}
__pyx_L6:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":962
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":963
* if curr[0] not in result and min_dist <= curr[1] <= self.max_initial_size:
* result.append(curr[0]);
* curr_col = _columns[curr[0]] # <<<<<<<<<<<<<<
* for alt in curr_col:
* next_id = curr[0]+alt[2]
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyObject_GetItem(__pyx_v__columns, __pyx_t_1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_GetItem(__pyx_v__columns, __pyx_t_1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_v_curr_col);
__pyx_v_curr_col = __pyx_t_5;
__pyx_t_5 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":963
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":964
* result.append(curr[0]);
* curr_col = _columns[curr[0]]
* for alt in curr_col: # <<<<<<<<<<<<<<
@@ -46778,7 +46861,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
__pyx_t_5 = __pyx_v_curr_col; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
__pyx_t_9 = NULL;
} else {
- __pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_curr_col); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_curr_col); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext;
}
@@ -46786,23 +46869,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
if (!__pyx_t_9 && PyList_CheckExact(__pyx_t_5)) {
if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_9 && PyTuple_CheckExact(__pyx_t_5)) {
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_1 = __pyx_t_9(__pyx_t_5);
if (unlikely(!__pyx_t_1)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -46812,18 +46895,18 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
__pyx_v_alt = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":964
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":965
* curr_col = _columns[curr[0]]
* for alt in curr_col:
* next_id = curr[0]+alt[2] # <<<<<<<<<<<<<<
* jump = 1
* if (alt[0] == EPSILON):
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_alt, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_alt, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_10 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -46831,7 +46914,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
__pyx_v_next_id = __pyx_t_10;
__pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":965
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":966
* for alt in curr_col:
* next_id = curr[0]+alt[2]
* jump = 1 # <<<<<<<<<<<<<<
@@ -46842,25 +46925,25 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
__Pyx_XDECREF(__pyx_v_jump);
__pyx_v_jump = __pyx_int_1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":966
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":967
* next_id = curr[0]+alt[2]
* jump = 1
* if (alt[0] == EPSILON): # <<<<<<<<<<<<<<
* jump = 0
* if next_id not in result and min_dist <= curr[1]+jump <= self.max_initial_size+1:
*/
- __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_alt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_alt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_2 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_10, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_10, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":967
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":968
* jump = 1
* if (alt[0] == EPSILON):
* jump = 0 # <<<<<<<<<<<<<<
@@ -46874,30 +46957,30 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
}
__pyx_L9:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":968
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":969
* if (alt[0] == EPSILON):
* jump = 0
* if next_id not in result and min_dist <= curr[1]+jump <= self.max_initial_size+1: # <<<<<<<<<<<<<<
* candidate.append([next_id,curr[1]+jump])
* return sorted(result);
*/
- __pyx_t_7 = (__Pyx_PySequence_Contains(__pyx_v_next_id, ((PyObject *)__pyx_v_result), Py_NE)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = (__Pyx_PySequence_Contains(__pyx_v_next_id, ((PyObject *)__pyx_v_result), Py_NE)); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_7) {
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_jump); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_jump); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_min_dist, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_min_dist, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
__Pyx_DECREF(__pyx_t_1);
- __pyx_t_10 = PyInt_FromLong((__pyx_v_self->max_initial_size + 1)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromLong((__pyx_v_self->max_initial_size + 1)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_10, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_10, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_6 = __pyx_t_4;
} else {
@@ -46905,19 +46988,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
}
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":969
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":970
* jump = 0
* if next_id not in result and min_dist <= curr[1]+jump <= self.max_initial_size+1:
* candidate.append([next_id,curr[1]+jump]) # <<<<<<<<<<<<<<
* return sorted(result);
*
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curr, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_jump); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_jump); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_next_id);
PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_next_id);
@@ -46925,7 +47008,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_8 = PyList_Append(__pyx_v_candidate, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyList_Append(__pyx_v_candidate, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
goto __pyx_L10;
}
@@ -46935,7 +47018,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
__pyx_L3_continue:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":970
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":971
* if next_id not in result and min_dist <= curr[1]+jump <= self.max_initial_size+1:
* candidate.append([next_id,curr[1]+jump])
* return sorted(result); # <<<<<<<<<<<<<<
@@ -46943,12 +47026,12 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_20get_next_states(struc
* def input(self, fwords, meta):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(((PyObject *)__pyx_v_result));
PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_result));
__Pyx_GIVEREF(((PyObject *)__pyx_v_result));
- __pyx_t_1 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
__pyx_r = __pyx_t_1;
@@ -47007,11 +47090,11 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_23input(PyObject *__pyx
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__meta)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("input", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("input", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "input") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "input") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -47024,7 +47107,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_23input(PyObject *__pyx
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("input", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("input", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.input", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -47059,7 +47142,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_5input_7lambda4_lambda5
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1137
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1142
* if len(extracts) > 0:
* fcount = Counter()
* fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) # <<<<<<<<<<<<<<
@@ -47078,14 +47161,14 @@ static PyObject *__pyx_lambda_funcdef_lambda5(CYTHON_UNUSED PyObject *__pyx_self
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("lambda5", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)((PyObject*)(&PyList_Type))));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyList_Type))));
__Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyList_Type))));
- __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
@@ -47118,16 +47201,16 @@ static PyObject *__pyx_lambda_funcdef_lambda4(CYTHON_UNUSED PyObject *__pyx_self
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("lambda4", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_5input_7lambda4_lambda5, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_5input_7lambda4_lambda5, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
@@ -47161,7 +47244,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_5input_1lambda6(PyObjec
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1143
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1148
* for f, elist in fphrases.iteritems():
* for e, alslist in elist.iteritems():
* alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1])) # <<<<<<<<<<<<<<
@@ -47179,11 +47262,11 @@ static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("lambda6", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -47202,7 +47285,7 @@ static PyObject *__pyx_lambda_funcdef_lambda6(CYTHON_UNUSED PyObject *__pyx_self
}
static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_5input_4generator14(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1182
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1187
* # Online rule extraction and scoring
* if self.online:
* f_syms = tuple(word[0][0] for word in fwords) # <<<<<<<<<<<<<<
@@ -47228,7 +47311,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_5input_2genexpr(PyObjec
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_3_sa_23HieroCachingRuleFactory_5input_4generator14, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_3_sa_23HieroCachingRuleFactory_5input_4generator14, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -47265,13 +47348,13 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_5input_4generator14(__p
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_fwords)) { __Pyx_RaiseClosureNameError("fwords"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_fwords)) { __Pyx_RaiseClosureNameError("fwords"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_fwords) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_fwords)) {
__pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_fwords; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
__pyx_t_3 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_fwords); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_fwords); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -47279,23 +47362,23 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_5input_4generator14(__p
if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_3(__pyx_t_1);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -47306,9 +47389,9 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_5input_4generator14(__p
__Pyx_GIVEREF(__pyx_t_4);
__pyx_cur_scope->__pyx_v_word = __pyx_t_4;
__pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_word, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_word, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_r = __pyx_t_5;
@@ -47328,7 +47411,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_5input_4generator14(__p
__Pyx_XGOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
__pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyErr_SetNone(PyExc_StopIteration);
@@ -47346,7 +47429,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_5input_4generator14(__p
return NULL;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":972
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":973
* return sorted(result);
*
* def input(self, fwords, meta): # <<<<<<<<<<<<<<
@@ -47378,7 +47461,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_22input(struct __pyx_ob
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_meta);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_meta);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -47403,25 +47486,25 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
- int __pyx_t_4;
- Py_ssize_t __pyx_t_5;
- int __pyx_t_6;
- PyObject *__pyx_t_7 = NULL;
- int __pyx_t_8;
- PyObject *__pyx_t_9 = NULL;
+ float __pyx_t_4;
+ int __pyx_t_5;
+ Py_ssize_t __pyx_t_6;
+ int __pyx_t_7;
+ PyObject *__pyx_t_8 = NULL;
+ int __pyx_t_9;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
- int __pyx_t_12;
- PyObject *__pyx_t_13 = NULL;
+ PyObject *__pyx_t_12 = NULL;
+ int __pyx_t_13;
PyObject *__pyx_t_14 = NULL;
PyObject *__pyx_t_15 = NULL;
PyObject *__pyx_t_16 = NULL;
PyObject *__pyx_t_17 = NULL;
- PyObject *(*__pyx_t_18)(PyObject *);
- int __pyx_t_19;
+ PyObject *__pyx_t_18 = NULL;
+ PyObject *(*__pyx_t_19)(PyObject *);
int __pyx_t_20;
- PyObject *(*__pyx_t_21)(PyObject *);
- float __pyx_t_22;
+ int __pyx_t_21;
+ PyObject *(*__pyx_t_22)(PyObject *);
Py_ssize_t __pyx_t_23;
Py_ssize_t __pyx_t_24;
Py_ssize_t __pyx_t_25;
@@ -47440,9 +47523,9 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":983
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":984
* cdef Phrase hiero_phrase
*
* flen = len(fwords) # <<<<<<<<<<<<<<
@@ -47451,43 +47534,59 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
*/
__pyx_t_1 = __pyx_cur_scope->__pyx_v_fwords;
__Pyx_INCREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_cur_scope->__pyx_v_flen = __pyx_t_2;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":984
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":985
*
* flen = len(fwords)
* start_time = monitor_cpu() # <<<<<<<<<<<<<<
* self.extract_time = 0.0
- * nodes_isteps_away_buffer = {}
+ * self.intersect_time = 0.0
*/
- __pyx_cur_scope->__pyx_v_start_time = __pyx_f_3_sa_monitor_cpu();
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_cur_scope->__pyx_v_start_time = __pyx_t_4;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":985
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":986
* flen = len(fwords)
* start_time = monitor_cpu()
* self.extract_time = 0.0 # <<<<<<<<<<<<<<
+ * self.intersect_time = 0.0
* nodes_isteps_away_buffer = {}
- * hit = 0
*/
__pyx_cur_scope->__pyx_v_self->extract_time = 0.0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":986
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":987
* start_time = monitor_cpu()
* self.extract_time = 0.0
+ * self.intersect_time = 0.0 # <<<<<<<<<<<<<<
+ * nodes_isteps_away_buffer = {}
+ * hit = 0
+ */
+ __pyx_cur_scope->__pyx_v_self->intersect_time = 0.0;
+
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":988
+ * self.extract_time = 0.0
+ * self.intersect_time = 0.0
* nodes_isteps_away_buffer = {} # <<<<<<<<<<<<<<
* hit = 0
* reachable_buffer = {}
*/
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
- __pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer = __pyx_t_1;
- __pyx_t_1 = 0;
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
+ __pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer = __pyx_t_3;
+ __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":987
- * self.extract_time = 0.0
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":989
+ * self.intersect_time = 0.0
* nodes_isteps_away_buffer = {}
* hit = 0 # <<<<<<<<<<<<<<
* reachable_buffer = {}
@@ -47495,176 +47594,176 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
*/
__pyx_cur_scope->__pyx_v_hit = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":988
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":990
* nodes_isteps_away_buffer = {}
* hit = 0
* reachable_buffer = {} # <<<<<<<<<<<<<<
*
* # Phrase pairs processed by suffix array extractor. Do not re-extract
*/
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
- __pyx_cur_scope->__pyx_v_reachable_buffer = __pyx_t_1;
- __pyx_t_1 = 0;
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
+ __pyx_cur_scope->__pyx_v_reachable_buffer = __pyx_t_3;
+ __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":993
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":995
* # during online extraction. This is probably the hackiest part of
* # online grammar extraction.
* seen_phrases = set() # <<<<<<<<<<<<<<
*
* # Do not cache between sentences
*/
- __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
- __pyx_cur_scope->__pyx_v_seen_phrases = __pyx_t_1;
- __pyx_t_1 = 0;
+ __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
+ __pyx_cur_scope->__pyx_v_seen_phrases = __pyx_t_3;
+ __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":996
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":998
*
* # Do not cache between sentences
* self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation()) # <<<<<<<<<<<<<<
*
* frontier = []
*/
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+ __Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->rules->root);
__Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->rules->root);
- __pyx_cur_scope->__pyx_v_self->rules->root = __pyx_t_3;
- __pyx_t_3 = 0;
+ __pyx_cur_scope->__pyx_v_self->rules->root = __pyx_t_1;
+ __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":998
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1000
* self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation())
*
* frontier = [] # <<<<<<<<<<<<<<
* for i in range(len(fwords)):
* for alt in range(0, len(fwords[i])):
*/
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
- __pyx_cur_scope->__pyx_v_frontier = __pyx_t_3;
- __pyx_t_3 = 0;
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
+ __pyx_cur_scope->__pyx_v_frontier = __pyx_t_1;
+ __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":999
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1001
*
* frontier = []
* for i in range(len(fwords)): # <<<<<<<<<<<<<<
* for alt in range(0, len(fwords[i])):
* if fwords[i][alt][0] != EPSILON:
*/
- __pyx_t_3 = __pyx_cur_scope->__pyx_v_fwords;
- __Pyx_INCREF(__pyx_t_3);
- __pyx_t_2 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) {
- __pyx_cur_scope->__pyx_v_i = __pyx_t_4;
+ __pyx_t_1 = __pyx_cur_scope->__pyx_v_fwords;
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) {
+ __pyx_cur_scope->__pyx_v_i = __pyx_t_5;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1000
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1002
* frontier = []
* for i in range(len(fwords)):
* for alt in range(0, len(fwords[i])): # <<<<<<<<<<<<<<
* if fwords[i][alt][0] != EPSILON:
* frontier.append((i, i, (i,), alt, 0, self.rules.root, (), False))
*/
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_cur_scope->__pyx_v_alt = __pyx_t_6;
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_cur_scope->__pyx_v_alt = __pyx_t_7;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1001
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1003
* for i in range(len(fwords)):
* for alt in range(0, len(fwords[i])):
* if fwords[i][alt][0] != EPSILON: # <<<<<<<<<<<<<<
* frontier.append((i, i, (i,), alt, 0, self.rules.root, (), False))
*
*/
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (__pyx_t_8) {
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1002
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1004
* for alt in range(0, len(fwords[i])):
* if fwords[i][alt][0] != EPSILON:
* frontier.append((i, i, (i,), alt, 0, self.rules.root, (), False)) # <<<<<<<<<<<<<<
*
* xroot = None
*/
- __pyx_t_7 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_1 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_10 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = PyTuple_New(8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_11, 2, ((PyObject *)__pyx_t_9));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
- PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_3);
+ __pyx_t_1 = 0;
+ __pyx_t_1 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_11 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_12 = PyTuple_New(8); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_8);
+ __Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_12, 2, ((PyObject *)__pyx_t_10));
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_10));
+ PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
__Pyx_INCREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_int_0);
+ PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_int_0);
__Pyx_GIVEREF(__pyx_int_0);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->rules->root);
- PyTuple_SET_ITEM(__pyx_t_11, 5, __pyx_cur_scope->__pyx_v_self->rules->root);
+ PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_cur_scope->__pyx_v_self->rules->root);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->rules->root);
__Pyx_INCREF(((PyObject *)__pyx_empty_tuple));
- PyTuple_SET_ITEM(__pyx_t_11, 6, ((PyObject *)__pyx_empty_tuple));
+ PyTuple_SET_ITEM(__pyx_t_12, 6, ((PyObject *)__pyx_empty_tuple));
__Pyx_GIVEREF(((PyObject *)__pyx_empty_tuple));
- PyTuple_SET_ITEM(__pyx_t_11, 7, __pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_10);
- __pyx_t_7 = 0;
- __pyx_t_1 = 0;
- __pyx_t_9 = 0;
+ PyTuple_SET_ITEM(__pyx_t_12, 7, __pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_11);
+ __pyx_t_8 = 0;
__pyx_t_3 = 0;
__pyx_t_10 = 0;
- __pyx_t_12 = PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_11)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
+ __pyx_t_1 = 0;
+ __pyx_t_11 = 0;
+ __pyx_t_13 = PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_12)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
goto __pyx_L8;
}
__pyx_L8:;
}
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1004
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1006
* frontier.append((i, i, (i,), alt, 0, self.rules.root, (), False))
*
* xroot = None # <<<<<<<<<<<<<<
@@ -47675,7 +47774,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_GIVEREF(Py_None);
__pyx_cur_scope->__pyx_v_xroot = Py_None;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1005
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1007
*
* xroot = None
* x1 = sym_setindex(self.category, 1) # <<<<<<<<<<<<<<
@@ -47684,257 +47783,257 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
*/
__pyx_cur_scope->__pyx_v_x1 = __pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1006
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1008
* xroot = None
* x1 = sym_setindex(self.category, 1)
* if x1 in self.rules.root.children: # <<<<<<<<<<<<<<
* xroot = self.rules.root.children[x1]
* else:
*/
- __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_x1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_x1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __pyx_t_11 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_8 = (__Pyx_PySequence_Contains(__pyx_t_11, __pyx_t_10, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_t_12, __pyx_t_11, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- if (__pyx_t_8) {
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1007
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1009
* x1 = sym_setindex(self.category, 1)
* if x1 in self.rules.root.children:
* xroot = self.rules.root.children[x1] # <<<<<<<<<<<<<<
* else:
* xroot = ExtendedTrieNode(suffix_link=self.rules.root, phrase_location=PhraseLocation())
*/
- __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_10, __pyx_cur_scope->__pyx_v_x1, sizeof(int), PyInt_FromLong); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_11, __pyx_cur_scope->__pyx_v_x1, sizeof(int), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_xroot);
__Pyx_DECREF(__pyx_cur_scope->__pyx_v_xroot);
- __Pyx_GIVEREF(__pyx_t_11);
- __pyx_cur_scope->__pyx_v_xroot = __pyx_t_11;
- __pyx_t_11 = 0;
+ __Pyx_GIVEREF(__pyx_t_12);
+ __pyx_cur_scope->__pyx_v_xroot = __pyx_t_12;
+ __pyx_t_12 = 0;
goto __pyx_L9;
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1009
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1011
* xroot = self.rules.root.children[x1]
* else:
* xroot = ExtendedTrieNode(suffix_link=self.rules.root, phrase_location=PhraseLocation()) # <<<<<<<<<<<<<<
* self.rules.root.children[x1] = xroot
*
*/
- __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_11));
- if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__suffix_link), __pyx_cur_scope->__pyx_v_self->rules->root) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_11)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
+ __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_12));
+ if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__suffix_link), __pyx_cur_scope->__pyx_v_self->rules->root) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_11) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_xroot);
__Pyx_DECREF(__pyx_cur_scope->__pyx_v_xroot);
- __Pyx_GIVEREF(__pyx_t_10);
- __pyx_cur_scope->__pyx_v_xroot = __pyx_t_10;
- __pyx_t_10 = 0;
+ __Pyx_GIVEREF(__pyx_t_11);
+ __pyx_cur_scope->__pyx_v_xroot = __pyx_t_11;
+ __pyx_t_11 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1010
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1012
* else:
* xroot = ExtendedTrieNode(suffix_link=self.rules.root, phrase_location=PhraseLocation())
* self.rules.root.children[x1] = xroot # <<<<<<<<<<<<<<
*
* for i in range(self.min_gap_size, len(fwords)):
*/
- __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- if (__Pyx_SetItemInt(__pyx_t_10, __pyx_cur_scope->__pyx_v_x1, __pyx_cur_scope->__pyx_v_xroot, sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_11 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->rules->root, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ if (__Pyx_SetItemInt(__pyx_t_11, __pyx_cur_scope->__pyx_v_x1, __pyx_cur_scope->__pyx_v_xroot, sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
}
__pyx_L9:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1012
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1014
* self.rules.root.children[x1] = xroot
*
* for i in range(self.min_gap_size, len(fwords)): # <<<<<<<<<<<<<<
* for alt in range(0, len(fwords[i])):
* if fwords[i][alt][0] != EPSILON:
*/
- __pyx_t_10 = __pyx_cur_scope->__pyx_v_fwords;
- __Pyx_INCREF(__pyx_t_10);
- __pyx_t_2 = PyObject_Length(__pyx_t_10); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- for (__pyx_t_4 = __pyx_cur_scope->__pyx_v_self->min_gap_size; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) {
- __pyx_cur_scope->__pyx_v_i = __pyx_t_4;
+ __pyx_t_11 = __pyx_cur_scope->__pyx_v_fwords;
+ __Pyx_INCREF(__pyx_t_11);
+ __pyx_t_2 = PyObject_Length(__pyx_t_11); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ for (__pyx_t_5 = __pyx_cur_scope->__pyx_v_self->min_gap_size; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) {
+ __pyx_cur_scope->__pyx_v_i = __pyx_t_5;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1013
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1015
*
* for i in range(self.min_gap_size, len(fwords)):
* for alt in range(0, len(fwords[i])): # <<<<<<<<<<<<<<
* if fwords[i][alt][0] != EPSILON:
* frontier.append((i-self.min_gap_size, i, (i,), alt, self.min_gap_size, xroot, (x1,), True))
*/
- __pyx_t_10 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = PyObject_Length(__pyx_t_10); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_cur_scope->__pyx_v_alt = __pyx_t_6;
+ __pyx_t_11 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_6 = PyObject_Length(__pyx_t_11); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_cur_scope->__pyx_v_alt = __pyx_t_7;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1014
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1016
* for i in range(self.min_gap_size, len(fwords)):
* for alt in range(0, len(fwords[i])):
* if fwords[i][alt][0] != EPSILON: # <<<<<<<<<<<<<<
* frontier.append((i-self.min_gap_size, i, (i,), alt, self.min_gap_size, xroot, (x1,), True))
*
*/
- __pyx_t_10 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_10, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_11, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_11, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_12, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_10, __pyx_t_11, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __pyx_t_12 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_11, __pyx_t_12, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_8) {
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1015
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1017
* for alt in range(0, len(fwords[i])):
* if fwords[i][alt][0] != EPSILON:
* frontier.append((i-self.min_gap_size, i, (i,), alt, self.min_gap_size, xroot, (x1,), True)) # <<<<<<<<<<<<<<
*
* next_states = []
*/
- __pyx_t_3 = PyInt_FromLong((__pyx_cur_scope->__pyx_v_i - __pyx_cur_scope->__pyx_v_self->min_gap_size)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong((__pyx_cur_scope->__pyx_v_i - __pyx_cur_scope->__pyx_v_self->min_gap_size)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_10);
- __pyx_t_10 = 0;
- __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_1 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_x1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_14 = PyTuple_New(8); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_11);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11);
__Pyx_GIVEREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_14, 2, ((PyObject *)__pyx_t_9));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
- PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_t_1);
+ __pyx_t_11 = 0;
+ __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_x1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_8);
+ __Pyx_GIVEREF(__pyx_t_8);
+ __pyx_t_8 = 0;
+ __pyx_t_8 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_15 = PyTuple_New(8); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_15);
+ PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_12);
+ __Pyx_GIVEREF(__pyx_t_12);
+ PyTuple_SET_ITEM(__pyx_t_15, 2, ((PyObject *)__pyx_t_10));
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_10));
+ PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_11);
+ PyTuple_SET_ITEM(__pyx_t_15, 4, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_xroot);
- PyTuple_SET_ITEM(__pyx_t_14, 5, __pyx_cur_scope->__pyx_v_xroot);
+ PyTuple_SET_ITEM(__pyx_t_15, 5, __pyx_cur_scope->__pyx_v_xroot);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_xroot);
- PyTuple_SET_ITEM(__pyx_t_14, 6, ((PyObject *)__pyx_t_13));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_13));
- PyTuple_SET_ITEM(__pyx_t_14, 7, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_3 = 0;
- __pyx_t_11 = 0;
- __pyx_t_9 = 0;
- __pyx_t_10 = 0;
+ PyTuple_SET_ITEM(__pyx_t_15, 6, ((PyObject *)__pyx_t_14));
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
+ PyTuple_SET_ITEM(__pyx_t_15, 7, __pyx_t_8);
+ __Pyx_GIVEREF(__pyx_t_8);
__pyx_t_1 = 0;
- __pyx_t_13 = 0;
- __pyx_t_7 = 0;
- __pyx_t_12 = PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_14)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
+ __pyx_t_12 = 0;
+ __pyx_t_10 = 0;
+ __pyx_t_11 = 0;
+ __pyx_t_3 = 0;
+ __pyx_t_14 = 0;
+ __pyx_t_8 = 0;
+ __pyx_t_13 = PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_15)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
goto __pyx_L14;
}
__pyx_L14:;
}
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1017
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1019
* frontier.append((i-self.min_gap_size, i, (i,), alt, self.min_gap_size, xroot, (x1,), True))
*
* next_states = [] # <<<<<<<<<<<<<<
* for i in range(len(fwords)):
* next_states.append(self.get_next_states(fwords,i,self.min_gap_size))
*/
- __pyx_t_14 = PyList_New(0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
- __pyx_cur_scope->__pyx_v_next_states = __pyx_t_14;
- __pyx_t_14 = 0;
+ __pyx_t_15 = PyList_New(0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_15));
+ __pyx_cur_scope->__pyx_v_next_states = __pyx_t_15;
+ __pyx_t_15 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1018
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1020
*
* next_states = []
* for i in range(len(fwords)): # <<<<<<<<<<<<<<
* next_states.append(self.get_next_states(fwords,i,self.min_gap_size))
*
*/
- __pyx_t_14 = __pyx_cur_scope->__pyx_v_fwords;
- __Pyx_INCREF(__pyx_t_14);
- __pyx_t_2 = PyObject_Length(__pyx_t_14); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_2; __pyx_t_4+=1) {
- __pyx_cur_scope->__pyx_v_i = __pyx_t_4;
+ __pyx_t_15 = __pyx_cur_scope->__pyx_v_fwords;
+ __Pyx_INCREF(__pyx_t_15);
+ __pyx_t_2 = PyObject_Length(__pyx_t_15); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_2; __pyx_t_5+=1) {
+ __pyx_cur_scope->__pyx_v_i = __pyx_t_5;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1019
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1021
* next_states = []
* for i in range(len(fwords)):
* next_states.append(self.get_next_states(fwords,i,self.min_gap_size)) # <<<<<<<<<<<<<<
*
* while len(frontier) > 0:
*/
- __pyx_t_14 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_next_states); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_next_states); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_15);
+ __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_14 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
- __pyx_t_7 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_13 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_fwords);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_fwords);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_fwords);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fwords);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_13);
- __Pyx_GIVEREF(__pyx_t_13);
- __pyx_t_7 = 0;
- __pyx_t_13 = 0;
- __pyx_t_13 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_8);
+ __Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_14);
+ __Pyx_GIVEREF(__pyx_t_14);
+ __pyx_t_8 = 0;
+ __pyx_t_14 = 0;
+ __pyx_t_14 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+ __pyx_t_13 = PyList_Append(__pyx_cur_scope->__pyx_v_next_states, __pyx_t_14); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_12 = PyList_Append(__pyx_cur_scope->__pyx_v_next_states, __pyx_t_13); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1021
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1023
* next_states.append(self.get_next_states(fwords,i,self.min_gap_size))
*
* while len(frontier) > 0: # <<<<<<<<<<<<<<
@@ -47942,42 +48041,42 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
* for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier:
*/
while (1) {
- __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_frontier)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_8 = (__pyx_t_2 > 0);
- if (!__pyx_t_8) break;
+ __pyx_t_2 = PyList_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_frontier)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = (__pyx_t_2 > 0);
+ if (!__pyx_t_9) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1022
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1024
*
* while len(frontier) > 0:
* new_frontier = [] # <<<<<<<<<<<<<<
* for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier:
* word_id = fwords[i][alt][0]
*/
- __pyx_t_13 = PyList_New(0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_14 = PyList_New(0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_new_frontier));
__Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_new_frontier));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_13));
- __pyx_cur_scope->__pyx_v_new_frontier = __pyx_t_13;
- __pyx_t_13 = 0;
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
+ __pyx_cur_scope->__pyx_v_new_frontier = __pyx_t_14;
+ __pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1023
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1025
* while len(frontier) > 0:
* new_frontier = []
* for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier: # <<<<<<<<<<<<<<
* word_id = fwords[i][alt][0]
* spanlen = fwords[i][alt][2]
*/
- __pyx_t_13 = ((PyObject *)__pyx_cur_scope->__pyx_v_frontier); __Pyx_INCREF(__pyx_t_13); __pyx_t_2 = 0;
+ __pyx_t_14 = ((PyObject *)__pyx_cur_scope->__pyx_v_frontier); __Pyx_INCREF(__pyx_t_14); __pyx_t_2 = 0;
for (;;) {
- if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_13)) break;
+ if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_14)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_13, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
- PyObject* sequence = __pyx_t_1;
+ if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
+ PyObject* sequence = __pyx_t_3;
#if CYTHON_COMPILING_IN_CPYTHON
Py_ssize_t size = Py_SIZE(sequence);
#else
@@ -47986,187 +48085,187 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
if (unlikely(size != 8)) {
if (size > 8) __Pyx_RaiseTooManyValuesError(8);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
- __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2);
- __pyx_t_9 = PyTuple_GET_ITEM(sequence, 3);
- __pyx_t_11 = PyTuple_GET_ITEM(sequence, 4);
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 5);
- __pyx_t_15 = PyTuple_GET_ITEM(sequence, 6);
- __pyx_t_16 = PyTuple_GET_ITEM(sequence, 7);
+ __pyx_t_15 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
+ __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2);
+ __pyx_t_10 = PyTuple_GET_ITEM(sequence, 3);
+ __pyx_t_12 = PyTuple_GET_ITEM(sequence, 4);
+ __pyx_t_1 = PyTuple_GET_ITEM(sequence, 5);
+ __pyx_t_16 = PyTuple_GET_ITEM(sequence, 6);
+ __pyx_t_17 = PyTuple_GET_ITEM(sequence, 7);
} else {
- __pyx_t_14 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
- __pyx_t_10 = PyList_GET_ITEM(sequence, 2);
- __pyx_t_9 = PyList_GET_ITEM(sequence, 3);
- __pyx_t_11 = PyList_GET_ITEM(sequence, 4);
- __pyx_t_3 = PyList_GET_ITEM(sequence, 5);
- __pyx_t_15 = PyList_GET_ITEM(sequence, 6);
- __pyx_t_16 = PyList_GET_ITEM(sequence, 7);
+ __pyx_t_15 = PyList_GET_ITEM(sequence, 0);
+ __pyx_t_8 = PyList_GET_ITEM(sequence, 1);
+ __pyx_t_11 = PyList_GET_ITEM(sequence, 2);
+ __pyx_t_10 = PyList_GET_ITEM(sequence, 3);
+ __pyx_t_12 = PyList_GET_ITEM(sequence, 4);
+ __pyx_t_1 = PyList_GET_ITEM(sequence, 5);
+ __pyx_t_16 = PyList_GET_ITEM(sequence, 6);
+ __pyx_t_17 = PyList_GET_ITEM(sequence, 7);
}
- __Pyx_INCREF(__pyx_t_14);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(__pyx_t_10);
- __Pyx_INCREF(__pyx_t_9);
- __Pyx_INCREF(__pyx_t_11);
- __Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(__pyx_t_15);
+ __Pyx_INCREF(__pyx_t_8);
+ __Pyx_INCREF(__pyx_t_11);
+ __Pyx_INCREF(__pyx_t_10);
+ __Pyx_INCREF(__pyx_t_12);
+ __Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_16);
+ __Pyx_INCREF(__pyx_t_17);
#else
Py_ssize_t i;
- PyObject** temps[8] = {&__pyx_t_14,&__pyx_t_7,&__pyx_t_10,&__pyx_t_9,&__pyx_t_11,&__pyx_t_3,&__pyx_t_15,&__pyx_t_16};
+ PyObject** temps[8] = {&__pyx_t_15,&__pyx_t_8,&__pyx_t_11,&__pyx_t_10,&__pyx_t_12,&__pyx_t_1,&__pyx_t_16,&__pyx_t_17};
for (i=0; i < 8; i++) {
- PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
*(temps[i]) = item;
}
#endif
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
{
Py_ssize_t index = -1;
- PyObject** temps[8] = {&__pyx_t_14,&__pyx_t_7,&__pyx_t_10,&__pyx_t_9,&__pyx_t_11,&__pyx_t_3,&__pyx_t_15,&__pyx_t_16};
- __pyx_t_17 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_17);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_18 = Py_TYPE(__pyx_t_17)->tp_iternext;
+ PyObject** temps[8] = {&__pyx_t_15,&__pyx_t_8,&__pyx_t_11,&__pyx_t_10,&__pyx_t_12,&__pyx_t_1,&__pyx_t_16,&__pyx_t_17};
+ __pyx_t_18 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_18);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_19 = Py_TYPE(__pyx_t_18)->tp_iternext;
for (index=0; index < 8; index++) {
- PyObject* item = __pyx_t_18(__pyx_t_17); if (unlikely(!item)) goto __pyx_L21_unpacking_failed;
+ PyObject* item = __pyx_t_19(__pyx_t_18); if (unlikely(!item)) goto __pyx_L21_unpacking_failed;
__Pyx_GOTREF(item);
*(temps[index]) = item;
}
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_18(__pyx_t_17), 8) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_18 = NULL;
- __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_18), 8) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = NULL;
+ __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
goto __pyx_L22_unpacking_done;
__pyx_L21_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
- __pyx_t_18 = NULL;
+ __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+ __pyx_t_19 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L22_unpacking_done:;
}
- __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_14); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_7); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_19 = __Pyx_PyInt_AsInt(__pyx_t_9); if (unlikely((__pyx_t_19 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_cur_scope->__pyx_v_k = __pyx_t_4;
- __pyx_cur_scope->__pyx_v_i = __pyx_t_6;
+ __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_t_15); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_8); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_20 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_cur_scope->__pyx_v_k = __pyx_t_5;
+ __pyx_cur_scope->__pyx_v_i = __pyx_t_7;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_input_match);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_input_match);
- __Pyx_GIVEREF(__pyx_t_10);
- __pyx_cur_scope->__pyx_v_input_match = __pyx_t_10;
- __pyx_t_10 = 0;
- __pyx_cur_scope->__pyx_v_alt = __pyx_t_19;
- __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_pathlen);
- __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_pathlen);
__Pyx_GIVEREF(__pyx_t_11);
- __pyx_cur_scope->__pyx_v_pathlen = __pyx_t_11;
+ __pyx_cur_scope->__pyx_v_input_match = __pyx_t_11;
__pyx_t_11 = 0;
+ __pyx_cur_scope->__pyx_v_alt = __pyx_t_20;
+ __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_pathlen);
+ __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_pathlen);
+ __Pyx_GIVEREF(__pyx_t_12);
+ __pyx_cur_scope->__pyx_v_pathlen = __pyx_t_12;
+ __pyx_t_12 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_node);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_node);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_cur_scope->__pyx_v_node = __pyx_t_3;
- __pyx_t_3 = 0;
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_cur_scope->__pyx_v_node = __pyx_t_1;
+ __pyx_t_1 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_prefix);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_prefix);
- __Pyx_GIVEREF(__pyx_t_15);
- __pyx_cur_scope->__pyx_v_prefix = __pyx_t_15;
- __pyx_t_15 = 0;
- __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_is_shadow_path);
- __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_is_shadow_path);
__Pyx_GIVEREF(__pyx_t_16);
- __pyx_cur_scope->__pyx_v_is_shadow_path = __pyx_t_16;
+ __pyx_cur_scope->__pyx_v_prefix = __pyx_t_16;
__pyx_t_16 = 0;
+ __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_is_shadow_path);
+ __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_is_shadow_path);
+ __Pyx_GIVEREF(__pyx_t_17);
+ __pyx_cur_scope->__pyx_v_is_shadow_path = __pyx_t_17;
+ __pyx_t_17 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1024
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1026
* new_frontier = []
* for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier:
* word_id = fwords[i][alt][0] # <<<<<<<<<<<<<<
* spanlen = fwords[i][alt][2]
* # TODO get rid of k -- pathlen is replacing it
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_1, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong); if (!__pyx_t_16) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_16, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_17 = __Pyx_GetItemInt(__pyx_t_3, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_17, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_word_id);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_word_id);
- __Pyx_GIVEREF(__pyx_t_1);
- __pyx_cur_scope->__pyx_v_word_id = __pyx_t_1;
- __pyx_t_1 = 0;
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_cur_scope->__pyx_v_word_id = __pyx_t_3;
+ __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1025
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1027
* for k, i, input_match, alt, pathlen, node, prefix, is_shadow_path in frontier:
* word_id = fwords[i][alt][0]
* spanlen = fwords[i][alt][2] # <<<<<<<<<<<<<<
* # TODO get rid of k -- pathlen is replacing it
* if word_id == EPSILON:
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_1, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong); if (!__pyx_t_16) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_16, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1025; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_fwords, __pyx_cur_scope->__pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_17 = __Pyx_GetItemInt(__pyx_t_3, __pyx_cur_scope->__pyx_v_alt, sizeof(int), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_17, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_spanlen);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_spanlen);
- __Pyx_GIVEREF(__pyx_t_1);
- __pyx_cur_scope->__pyx_v_spanlen = __pyx_t_1;
- __pyx_t_1 = 0;
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_cur_scope->__pyx_v_spanlen = __pyx_t_3;
+ __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1027
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1029
* spanlen = fwords[i][alt][2]
* # TODO get rid of k -- pathlen is replacing it
* if word_id == EPSILON: # <<<<<<<<<<<<<<
* # skipping because word_id is epsilon
* if i+spanlen >= len(fwords):
*/
- __pyx_t_1 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_16 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_16); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- if (__pyx_t_8) {
+ __pyx_t_3 = PyInt_FromLong(__pyx_v_3_sa_EPSILON); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_17 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1029
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1031
* if word_id == EPSILON:
* # skipping because word_id is epsilon
* if i+spanlen >= len(fwords): # <<<<<<<<<<<<<<
* continue
* for nualt in range(0,len(fwords[i+spanlen])):
*/
- __pyx_t_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_1 = PyNumber_Add(__pyx_t_16, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_16 = __pyx_cur_scope->__pyx_v_fwords;
- __Pyx_INCREF(__pyx_t_16);
- __pyx_t_5 = PyObject_Length(__pyx_t_16); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_16 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_15 = PyObject_RichCompare(__pyx_t_1, __pyx_t_16, Py_GE); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_3 = PyNumber_Add(__pyx_t_17, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __pyx_t_17 = __pyx_cur_scope->__pyx_v_fwords;
+ __Pyx_INCREF(__pyx_t_17);
+ __pyx_t_6 = PyObject_Length(__pyx_t_17); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __pyx_t_17 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_16 = PyObject_RichCompare(__pyx_t_3, __pyx_t_17, Py_GE); __Pyx_XGOTREF(__pyx_t_16); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_16); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- if (__pyx_t_8) {
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1030
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1032
* # skipping because word_id is epsilon
* if i+spanlen >= len(fwords):
* continue # <<<<<<<<<<<<<<
@@ -48178,73 +48277,73 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
__pyx_L24:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1031
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1033
* if i+spanlen >= len(fwords):
* continue
* for nualt in range(0,len(fwords[i+spanlen])): # <<<<<<<<<<<<<<
* frontier.append((k, i+spanlen, input_match, nualt, pathlen, node, prefix, is_shadow_path))
* continue
*/
- __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
- __pyx_t_16 = PyNumber_Add(__pyx_t_15, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fwords, __pyx_t_16); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
+ __pyx_t_17 = PyNumber_Add(__pyx_t_16, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
__Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_5 = PyObject_Length(__pyx_t_15); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_5; __pyx_t_19+=1) {
- __pyx_cur_scope->__pyx_v_nualt = __pyx_t_19;
+ __pyx_t_16 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fwords, __pyx_t_17); if (!__pyx_t_16) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_16);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __pyx_t_6 = PyObject_Length(__pyx_t_16); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_6; __pyx_t_20+=1) {
+ __pyx_cur_scope->__pyx_v_nualt = __pyx_t_20;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1032
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1034
* continue
* for nualt in range(0,len(fwords[i+spanlen])):
* frontier.append((k, i+spanlen, input_match, nualt, pathlen, node, prefix, is_shadow_path)) # <<<<<<<<<<<<<<
* continue
*
*/
- __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
- __pyx_t_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_1 = PyNumber_Add(__pyx_t_16, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_nualt); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
- __pyx_t_3 = PyTuple_New(8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_3 = PyNumber_Add(__pyx_t_17, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_15);
- __Pyx_GIVEREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_nualt); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_1 = PyTuple_New(8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_16);
+ __Pyx_GIVEREF(__pyx_t_16);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_input_match);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_cur_scope->__pyx_v_input_match);
+ PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_cur_scope->__pyx_v_input_match);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_input_match);
- PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_16);
- __Pyx_GIVEREF(__pyx_t_16);
+ PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_17);
+ __Pyx_GIVEREF(__pyx_t_17);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_pathlen);
- PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_cur_scope->__pyx_v_pathlen);
+ PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_cur_scope->__pyx_v_pathlen);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_pathlen);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_node);
- PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_cur_scope->__pyx_v_node);
+ PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_cur_scope->__pyx_v_node);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_node);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_prefix);
- PyTuple_SET_ITEM(__pyx_t_3, 6, __pyx_cur_scope->__pyx_v_prefix);
+ PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_cur_scope->__pyx_v_prefix);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_prefix);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_is_shadow_path);
- PyTuple_SET_ITEM(__pyx_t_3, 7, __pyx_cur_scope->__pyx_v_is_shadow_path);
+ PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_cur_scope->__pyx_v_is_shadow_path);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_is_shadow_path);
- __pyx_t_15 = 0;
- __pyx_t_1 = 0;
__pyx_t_16 = 0;
- __pyx_t_12 = PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+ __pyx_t_3 = 0;
+ __pyx_t_17 = 0;
+ __pyx_t_13 = PyList_Append(__pyx_cur_scope->__pyx_v_frontier, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1033
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1035
* for nualt in range(0,len(fwords[i+spanlen])):
* frontier.append((k, i+spanlen, input_match, nualt, pathlen, node, prefix, is_shadow_path))
* continue # <<<<<<<<<<<<<<
@@ -48256,65 +48355,65 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
__pyx_L23:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1035
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1037
* continue
*
* phrase = prefix + (word_id,) # <<<<<<<<<<<<<<
* hiero_phrase = Phrase(phrase)
* arity = hiero_phrase.arity()
*/
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_word_id);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_word_id);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_word_id);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_word_id);
- __pyx_t_16 = PyNumber_Add(__pyx_cur_scope->__pyx_v_prefix, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+ __pyx_t_17 = PyNumber_Add(__pyx_cur_scope->__pyx_v_prefix, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_phrase);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_phrase);
- __Pyx_GIVEREF(__pyx_t_16);
- __pyx_cur_scope->__pyx_v_phrase = __pyx_t_16;
- __pyx_t_16 = 0;
+ __Pyx_GIVEREF(__pyx_t_17);
+ __pyx_cur_scope->__pyx_v_phrase = __pyx_t_17;
+ __pyx_t_17 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1036
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1038
*
* phrase = prefix + (word_id,)
* hiero_phrase = Phrase(phrase) # <<<<<<<<<<<<<<
* arity = hiero_phrase.arity()
*
*/
- __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
+ __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_phrase);
- PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_cur_scope->__pyx_v_phrase);
+ PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_cur_scope->__pyx_v_phrase);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_phrase);
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0;
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase));
__Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase));
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_cur_scope->__pyx_v_hiero_phrase = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_3);
- __pyx_t_3 = 0;
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_cur_scope->__pyx_v_hiero_phrase = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_1);
+ __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1037
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1039
* phrase = prefix + (word_id,)
* hiero_phrase = Phrase(phrase)
* arity = hiero_phrase.arity() # <<<<<<<<<<<<<<
*
* lookup_required = False
*/
- __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase), __pyx_n_s__arity); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_16 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_19 = __Pyx_PyInt_AsInt(__pyx_t_16); if (unlikely((__pyx_t_19 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_cur_scope->__pyx_v_arity = __pyx_t_19;
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase), __pyx_n_s__arity); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_17 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_20 = __Pyx_PyInt_AsInt(__pyx_t_17); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __pyx_cur_scope->__pyx_v_arity = __pyx_t_20;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1039
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1041
* arity = hiero_phrase.arity()
*
* lookup_required = False # <<<<<<<<<<<<<<
@@ -48323,36 +48422,36 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
*/
__pyx_cur_scope->__pyx_v_lookup_required = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1040
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1042
*
* lookup_required = False
* if word_id in node.children: # <<<<<<<<<<<<<<
* if node.children[word_id] is None:
* # Path dead-ends at this node
*/
- __pyx_t_16 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_8 = (__Pyx_PySequence_Contains(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_16, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- if (__pyx_t_8) {
+ __pyx_t_17 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_17, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1041
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1043
* lookup_required = False
* if word_id in node.children:
* if node.children[word_id] is None: # <<<<<<<<<<<<<<
* # Path dead-ends at this node
* continue
*/
- __pyx_t_16 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_3 = PyObject_GetItem(__pyx_t_16, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_8 = (__pyx_t_3 == Py_None);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_8) {
+ __pyx_t_17 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_1 = PyObject_GetItem(__pyx_t_17, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __pyx_t_9 = (__pyx_t_1 == Py_None);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1043
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1045
* if node.children[word_id] is None:
* # Path dead-ends at this node
* continue # <<<<<<<<<<<<<<
@@ -48364,43 +48463,43 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1046
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1048
* else:
* # Path continues at this node
* node = node.children[word_id] # <<<<<<<<<<<<<<
* else:
* if node.suffix_link is None:
*/
- __pyx_t_3 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_16 = PyObject_GetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_16) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_1 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_17 = PyObject_GetItem(__pyx_t_1, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_node);
__Pyx_DECREF(__pyx_cur_scope->__pyx_v_node);
- __Pyx_GIVEREF(__pyx_t_16);
- __pyx_cur_scope->__pyx_v_node = __pyx_t_16;
- __pyx_t_16 = 0;
+ __Pyx_GIVEREF(__pyx_t_17);
+ __pyx_cur_scope->__pyx_v_node = __pyx_t_17;
+ __pyx_t_17 = 0;
}
__pyx_L28:;
goto __pyx_L27;
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1048
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1050
* node = node.children[word_id]
* else:
* if node.suffix_link is None: # <<<<<<<<<<<<<<
* # Current node is root; lookup required
* lookup_required = True
*/
- __pyx_t_16 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_8 = (__pyx_t_16 == Py_None);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- if (__pyx_t_8) {
+ __pyx_t_17 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_9 = (__pyx_t_17 == Py_None);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1050
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1052
* if node.suffix_link is None:
* # Current node is root; lookup required
* lookup_required = True # <<<<<<<<<<<<<<
@@ -48412,54 +48511,54 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1052
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1054
* lookup_required = True
* else:
* if word_id in node.suffix_link.children: # <<<<<<<<<<<<<<
* if node.suffix_link.children[word_id] is None:
* # Suffix link reports path is dead end
*/
- __pyx_t_16 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_16, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_8 = (__Pyx_PySequence_Contains(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_8) {
+ __pyx_t_17 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_1 = PyObject_GetAttr(__pyx_t_17, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __pyx_t_9 = (__Pyx_PySequence_Contains(__pyx_cur_scope->__pyx_v_word_id, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1053
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1055
* else:
* if word_id in node.suffix_link.children:
* if node.suffix_link.children[word_id] is None: # <<<<<<<<<<<<<<
* # Suffix link reports path is dead end
* node.children[word_id] = None
*/
- __pyx_t_3 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_16 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__children); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_GetItem(__pyx_t_16, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_8 = (__pyx_t_3 == Py_None);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_8) {
+ __pyx_t_1 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_17 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__children); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyObject_GetItem(__pyx_t_17, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __pyx_t_9 = (__pyx_t_1 == Py_None);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1055
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1057
* if node.suffix_link.children[word_id] is None:
* # Suffix link reports path is dead end
* node.children[word_id] = None # <<<<<<<<<<<<<<
* continue
* else:
*/
- __pyx_t_3 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyObject_SetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id, Py_None) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_1 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyObject_SetItem(__pyx_t_1, __pyx_cur_scope->__pyx_v_word_id, Py_None) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1056
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1058
* # Suffix link reports path is dead end
* node.children[word_id] = None
* continue # <<<<<<<<<<<<<<
@@ -48471,7 +48570,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1059
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1061
* else:
* # Suffix link indicates lookup is reqired
* lookup_required = True # <<<<<<<<<<<<<<
@@ -48485,18 +48584,18 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1062
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1064
* else:
* #ERROR: We never get here
* raise Exception("Keyword trie error") # <<<<<<<<<<<<<<
* # checking whether lookup_required
* if lookup_required:
*/
- __pyx_t_3 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_122), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_builtin_Exception, ((PyObject *)__pyx_k_tuple_122), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_L30:;
}
@@ -48504,7 +48603,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
__pyx_L27:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1064
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1066
* raise Exception("Keyword trie error")
* # checking whether lookup_required
* if lookup_required: # <<<<<<<<<<<<<<
@@ -48513,7 +48612,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
*/
if (__pyx_cur_scope->__pyx_v_lookup_required) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1065
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1067
* # checking whether lookup_required
* if lookup_required:
* new_node = None # <<<<<<<<<<<<<<
@@ -48526,103 +48625,121 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_GIVEREF(Py_None);
__pyx_cur_scope->__pyx_v_new_node = Py_None;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1066
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1068
* if lookup_required:
* new_node = None
* if is_shadow_path: # <<<<<<<<<<<<<<
* # Extending shadow path
* # on the shadow path we don't do any search, we just use info from suffix link
*/
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__pyx_t_8) {
+ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1069
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1071
* # Extending shadow path
* # on the shadow path we don't do any search, we just use info from suffix link
* new_node = ExtendedTrieNode(phrase_location=node.suffix_link.children[word_id].phrase_location, # <<<<<<<<<<<<<<
* suffix_link=node.suffix_link.children[word_id],
* phrase=hiero_phrase)
*/
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
- __pyx_t_16 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_1 = PyObject_GetAttr(__pyx_t_16, __pyx_n_s__children); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_16 = PyObject_GetItem(__pyx_t_1, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_16) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_GetAttr(__pyx_t_16, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+ __pyx_t_17 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_3 = PyObject_GetAttr(__pyx_t_17, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __pyx_t_17 = PyObject_GetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyObject_GetAttr(__pyx_t_17, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1070
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1072
* # on the shadow path we don't do any search, we just use info from suffix link
* new_node = ExtendedTrieNode(phrase_location=node.suffix_link.children[word_id].phrase_location,
* suffix_link=node.suffix_link.children[word_id], # <<<<<<<<<<<<<<
* phrase=hiero_phrase)
* else:
*/
- __pyx_t_1 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_16 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__children); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_GetItem(__pyx_t_16, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__suffix_link), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_3 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_17 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__children); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyObject_GetItem(__pyx_t_17, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__suffix_link), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1071
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1073
* new_node = ExtendedTrieNode(phrase_location=node.suffix_link.children[word_id].phrase_location,
* suffix_link=node.suffix_link.children[word_id],
* phrase=hiero_phrase) # <<<<<<<<<<<<<<
* else:
* if arity > 0:
*/
- if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__phrase), ((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+ if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__phrase), ((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_new_node);
__Pyx_DECREF(__pyx_cur_scope->__pyx_v_new_node);
- __Pyx_GIVEREF(__pyx_t_1);
- __pyx_cur_scope->__pyx_v_new_node = __pyx_t_1;
- __pyx_t_1 = 0;
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_cur_scope->__pyx_v_new_node = __pyx_t_3;
+ __pyx_t_3 = 0;
goto __pyx_L33;
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1073
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1075
* phrase=hiero_phrase)
* else:
* if arity > 0: # <<<<<<<<<<<<<<
* # Intersecting because of arity > 0
- * phrase_location = self.intersect(node, node.suffix_link.children[word_id], hiero_phrase)
+ * intersect_start_time = monitor_cpu()
*/
- __pyx_t_8 = (__pyx_cur_scope->__pyx_v_arity > 0);
- if (__pyx_t_8) {
+ __pyx_t_9 = (__pyx_cur_scope->__pyx_v_arity > 0);
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1075
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1077
* if arity > 0:
* # Intersecting because of arity > 0
+ * intersect_start_time = monitor_cpu() # <<<<<<<<<<<<<<
+ * phrase_location = self.intersect(node, node.suffix_link.children[word_id], hiero_phrase)
+ * intersect_stop_time = monitor_cpu()
+ */
+ __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_intersect_start_time);
+ __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_intersect_start_time);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_cur_scope->__pyx_v_intersect_start_time = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1078
+ * # Intersecting because of arity > 0
+ * intersect_start_time = monitor_cpu()
* phrase_location = self.intersect(node, node.suffix_link.children[word_id], hiero_phrase) # <<<<<<<<<<<<<<
- * else:
- * # Suffix array search
+ * intersect_stop_time = monitor_cpu()
+ * self.intersect_time += intersect_stop_time - intersect_start_time
*/
- __pyx_t_1 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_GetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->intersect(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_node, __pyx_t_1, __pyx_cur_scope->__pyx_v_hiero_phrase)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->intersect(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_node, __pyx_t_1, __pyx_cur_scope->__pyx_v_hiero_phrase)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location));
@@ -48630,112 +48747,149 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_GIVEREF(__pyx_t_3);
__pyx_cur_scope->__pyx_v_phrase_location = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_3);
__pyx_t_3 = 0;
+
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1079
+ * intersect_start_time = monitor_cpu()
+ * phrase_location = self.intersect(node, node.suffix_link.children[word_id], hiero_phrase)
+ * intersect_stop_time = monitor_cpu() # <<<<<<<<<<<<<<
+ * self.intersect_time += intersect_stop_time - intersect_start_time
+ * else:
+ */
+ __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_intersect_stop_time);
+ __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_intersect_stop_time);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_cur_scope->__pyx_v_intersect_stop_time = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1080
+ * phrase_location = self.intersect(node, node.suffix_link.children[word_id], hiero_phrase)
+ * intersect_stop_time = monitor_cpu()
+ * self.intersect_time += intersect_stop_time - intersect_start_time # <<<<<<<<<<<<<<
+ * else:
+ * # Suffix array search
+ */
+ __pyx_t_1 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->intersect_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_intersect_stop_time, __pyx_cur_scope->__pyx_v_intersect_start_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_17 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_17); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __pyx_cur_scope->__pyx_v_self->intersect_time = __pyx_t_4;
goto __pyx_L34;
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1078
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1083
* else:
* # Suffix array search
* phrase_location = node.phrase_location # <<<<<<<<<<<<<<
* sa_range = self.fsa.lookup(sym_tostring(phrase[-1]), len(phrase)-1, phrase_location.sa_low, phrase_location.sa_high)
* if sa_range is not None:
*/
- __pyx_t_3 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ if (!(likely(((__pyx_t_17) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_17, __pyx_ptype_3_sa_PhraseLocation))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location));
__Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location));
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_cur_scope->__pyx_v_phrase_location = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_3);
- __pyx_t_3 = 0;
+ __Pyx_GIVEREF(__pyx_t_17);
+ __pyx_cur_scope->__pyx_v_phrase_location = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_17);
+ __pyx_t_17 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1079
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1084
* # Suffix array search
* phrase_location = node.phrase_location
* sa_range = self.fsa.lookup(sym_tostring(phrase[-1]), len(phrase)-1, phrase_location.sa_low, phrase_location.sa_high) # <<<<<<<<<<<<<<
* if sa_range is not None:
* phrase_location = PhraseLocation(sa_low=sa_range[0], sa_high=sa_range[1])
*/
- __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self->fsa), __pyx_n_s__lookup); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self->fsa), __pyx_n_s__lookup); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_phrase, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_phrase, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_20 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_20)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+ __pyx_t_6 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_6 - 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_19 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_19 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_19)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_t_5 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_16 = PyInt_FromSsize_t((__pyx_t_5 - 1)); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_phrase_location->sa_low); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_16);
- __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_phrase_location->sa_low); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
- __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_phrase_location->sa_high); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_9 = PyTuple_New(4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_1));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
- PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_16);
+ __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_phrase_location->sa_high); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_3));
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
+ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_16);
__Pyx_GIVEREF(__pyx_t_16);
- PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_15);
- __Pyx_GIVEREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_11);
+ PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_12);
+ __Pyx_GIVEREF(__pyx_t_12);
+ __pyx_t_3 = 0;
__pyx_t_1 = 0;
__pyx_t_16 = 0;
- __pyx_t_15 = 0;
- __pyx_t_11 = 0;
- __pyx_t_11 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
+ __pyx_t_12 = 0;
+ __pyx_t_12 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_sa_range);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_sa_range);
- __Pyx_GIVEREF(__pyx_t_11);
- __pyx_cur_scope->__pyx_v_sa_range = __pyx_t_11;
- __pyx_t_11 = 0;
+ __Pyx_GIVEREF(__pyx_t_12);
+ __pyx_cur_scope->__pyx_v_sa_range = __pyx_t_12;
+ __pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1080
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1085
* phrase_location = node.phrase_location
* sa_range = self.fsa.lookup(sym_tostring(phrase[-1]), len(phrase)-1, phrase_location.sa_low, phrase_location.sa_high)
* if sa_range is not None: # <<<<<<<<<<<<<<
* phrase_location = PhraseLocation(sa_low=sa_range[0], sa_high=sa_range[1])
* else:
*/
- __pyx_t_8 = (__pyx_cur_scope->__pyx_v_sa_range != Py_None);
- if (__pyx_t_8) {
+ __pyx_t_9 = (__pyx_cur_scope->__pyx_v_sa_range != Py_None);
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1081
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1086
* sa_range = self.fsa.lookup(sym_tostring(phrase[-1]), len(phrase)-1, phrase_location.sa_low, phrase_location.sa_high)
* if sa_range is not None:
* phrase_location = PhraseLocation(sa_low=sa_range[0], sa_high=sa_range[1]) # <<<<<<<<<<<<<<
* else:
* phrase_location = None
*/
- __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_11));
- __pyx_t_9 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_sa_range, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__sa_low), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_sa_range, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__sa_high), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_11)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
+ __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_12));
+ __pyx_t_10 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_sa_range, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__sa_low), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_sa_range, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__sa_high), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_PhraseLocation)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
__Pyx_GOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location));
__Pyx_DECREF(((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location));
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_cur_scope->__pyx_v_phrase_location = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_9);
- __pyx_t_9 = 0;
+ __Pyx_GIVEREF(__pyx_t_10);
+ __pyx_cur_scope->__pyx_v_phrase_location = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_10);
+ __pyx_t_10 = 0;
goto __pyx_L35;
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1083
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1088
* phrase_location = PhraseLocation(sa_low=sa_range[0], sa_high=sa_range[1])
* else:
* phrase_location = None # <<<<<<<<<<<<<<
@@ -48752,29 +48906,29 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
__pyx_L34:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1085
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1090
* phrase_location = None
*
* if phrase_location is None: # <<<<<<<<<<<<<<
* node.children[word_id] = None
* # Search failed
*/
- __pyx_t_8 = (((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location) == Py_None);
- if (__pyx_t_8) {
+ __pyx_t_9 = (((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location) == Py_None);
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1086
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1091
*
* if phrase_location is None:
* node.children[word_id] = None # <<<<<<<<<<<<<<
* # Search failed
* continue
*/
- __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- if (PyObject_SetItem(__pyx_t_9, __pyx_cur_scope->__pyx_v_word_id, Py_None) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ if (PyObject_SetItem(__pyx_t_10, __pyx_cur_scope->__pyx_v_word_id, Py_None) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1088
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1093
* node.children[word_id] = None
* # Search failed
* continue # <<<<<<<<<<<<<<
@@ -48786,7 +48940,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
__pyx_L36:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1090
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1095
* continue
* # Search succeeded
* suffix_link = self.rules.root # <<<<<<<<<<<<<<
@@ -48799,95 +48953,95 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->rules->root);
__pyx_cur_scope->__pyx_v_suffix_link = __pyx_cur_scope->__pyx_v_self->rules->root;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1091
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1096
* # Search succeeded
* suffix_link = self.rules.root
* if node.suffix_link is not None: # <<<<<<<<<<<<<<
* suffix_link = node.suffix_link.children[word_id]
* new_node = ExtendedTrieNode(phrase_location=phrase_location,
*/
- __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_8 = (__pyx_t_9 != Py_None);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- if (__pyx_t_8) {
+ __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_9 = (__pyx_t_10 != Py_None);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1092
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1097
* suffix_link = self.rules.root
* if node.suffix_link is not None:
* suffix_link = node.suffix_link.children[word_id] # <<<<<<<<<<<<<<
* new_node = ExtendedTrieNode(phrase_location=phrase_location,
* suffix_link=suffix_link,
*/
- __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_11 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_GetItem(__pyx_t_11, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_12 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__children); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = PyObject_GetItem(__pyx_t_12, __pyx_cur_scope->__pyx_v_word_id); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_suffix_link);
__Pyx_DECREF(__pyx_cur_scope->__pyx_v_suffix_link);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_cur_scope->__pyx_v_suffix_link = __pyx_t_9;
- __pyx_t_9 = 0;
+ __Pyx_GIVEREF(__pyx_t_10);
+ __pyx_cur_scope->__pyx_v_suffix_link = __pyx_t_10;
+ __pyx_t_10 = 0;
goto __pyx_L37;
}
__pyx_L37:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1093
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1098
* if node.suffix_link is not None:
* suffix_link = node.suffix_link.children[word_id]
* new_node = ExtendedTrieNode(phrase_location=phrase_location, # <<<<<<<<<<<<<<
* suffix_link=suffix_link,
* phrase=hiero_phrase)
*/
- __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_9));
- if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__phrase_location), ((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_10));
+ if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__phrase_location), ((PyObject *)__pyx_cur_scope->__pyx_v_phrase_location)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1094
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1099
* suffix_link = node.suffix_link.children[word_id]
* new_node = ExtendedTrieNode(phrase_location=phrase_location,
* suffix_link=suffix_link, # <<<<<<<<<<<<<<
* phrase=hiero_phrase)
* node.children[word_id] = new_node
*/
- if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__suffix_link), __pyx_cur_scope->__pyx_v_suffix_link) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__suffix_link), __pyx_cur_scope->__pyx_v_suffix_link) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1095
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1100
* new_node = ExtendedTrieNode(phrase_location=phrase_location,
* suffix_link=suffix_link,
* phrase=hiero_phrase) # <<<<<<<<<<<<<<
* node.children[word_id] = new_node
* node = new_node
*/
- if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__phrase), ((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
+ if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__phrase), ((PyObject *)__pyx_cur_scope->__pyx_v_hiero_phrase)) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_new_node);
__Pyx_DECREF(__pyx_cur_scope->__pyx_v_new_node);
- __Pyx_GIVEREF(__pyx_t_11);
- __pyx_cur_scope->__pyx_v_new_node = __pyx_t_11;
- __pyx_t_11 = 0;
+ __Pyx_GIVEREF(__pyx_t_12);
+ __pyx_cur_scope->__pyx_v_new_node = __pyx_t_12;
+ __pyx_t_12 = 0;
}
__pyx_L33:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1096
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1101
* suffix_link=suffix_link,
* phrase=hiero_phrase)
* node.children[word_id] = new_node # <<<<<<<<<<<<<<
* node = new_node
*
*/
- __pyx_t_11 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- if (PyObject_SetItem(__pyx_t_11, __pyx_cur_scope->__pyx_v_word_id, __pyx_cur_scope->__pyx_v_new_node) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_12 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ if (PyObject_SetItem(__pyx_t_12, __pyx_cur_scope->__pyx_v_word_id, __pyx_cur_scope->__pyx_v_new_node) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1097
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1102
* phrase=hiero_phrase)
* node.children[word_id] = new_node
* node = new_node # <<<<<<<<<<<<<<
@@ -48900,42 +49054,42 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_new_node);
__pyx_cur_scope->__pyx_v_node = __pyx_cur_scope->__pyx_v_new_node;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1102
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1107
* This should happen before we get to extraction (so that
* the node will exist if needed)'''
* if arity < self.max_nonterminals: # <<<<<<<<<<<<<<
* xcat_index = arity+1
* xcat = sym_setindex(self.category, xcat_index)
*/
- __pyx_t_8 = (__pyx_cur_scope->__pyx_v_arity < __pyx_cur_scope->__pyx_v_self->max_nonterminals);
- if (__pyx_t_8) {
+ __pyx_t_9 = (__pyx_cur_scope->__pyx_v_arity < __pyx_cur_scope->__pyx_v_self->max_nonterminals);
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1103
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1108
* the node will exist if needed)'''
* if arity < self.max_nonterminals:
* xcat_index = arity+1 # <<<<<<<<<<<<<<
* xcat = sym_setindex(self.category, xcat_index)
* suffix_link_xcat_index = xcat_index
*/
- __pyx_t_11 = PyInt_FromLong((__pyx_cur_scope->__pyx_v_arity + 1)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_12 = PyInt_FromLong((__pyx_cur_scope->__pyx_v_arity + 1)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_xcat_index);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_xcat_index);
- __Pyx_GIVEREF(__pyx_t_11);
- __pyx_cur_scope->__pyx_v_xcat_index = __pyx_t_11;
- __pyx_t_11 = 0;
+ __Pyx_GIVEREF(__pyx_t_12);
+ __pyx_cur_scope->__pyx_v_xcat_index = __pyx_t_12;
+ __pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1104
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1109
* if arity < self.max_nonterminals:
* xcat_index = arity+1
* xcat = sym_setindex(self.category, xcat_index) # <<<<<<<<<<<<<<
* suffix_link_xcat_index = xcat_index
* if is_shadow_path:
*/
- __pyx_t_19 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_xcat_index); if (unlikely((__pyx_t_19 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_cur_scope->__pyx_v_xcat = __pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_19);
+ __pyx_t_20 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_xcat_index); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_cur_scope->__pyx_v_xcat = __pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_20);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1105
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1110
* xcat_index = arity+1
* xcat = sym_setindex(self.category, xcat_index)
* suffix_link_xcat_index = xcat_index # <<<<<<<<<<<<<<
@@ -48948,206 +49102,206 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_xcat_index);
__pyx_cur_scope->__pyx_v_suffix_link_xcat_index = __pyx_cur_scope->__pyx_v_xcat_index;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1106
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1111
* xcat = sym_setindex(self.category, xcat_index)
* suffix_link_xcat_index = xcat_index
* if is_shadow_path: # <<<<<<<<<<<<<<
* suffix_link_xcat_index = xcat_index-1
* suffix_link_xcat = sym_setindex(self.category, suffix_link_xcat_index)
*/
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__pyx_t_8) {
+ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1107
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1112
* suffix_link_xcat_index = xcat_index
* if is_shadow_path:
* suffix_link_xcat_index = xcat_index-1 # <<<<<<<<<<<<<<
* suffix_link_xcat = sym_setindex(self.category, suffix_link_xcat_index)
* node.children[xcat] = ExtendedTrieNode(phrase_location=node.phrase_location,
*/
- __pyx_t_11 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_xcat_index, __pyx_int_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_12 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_xcat_index, __pyx_int_1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index);
__Pyx_DECREF(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index);
- __Pyx_GIVEREF(__pyx_t_11);
- __pyx_cur_scope->__pyx_v_suffix_link_xcat_index = __pyx_t_11;
- __pyx_t_11 = 0;
+ __Pyx_GIVEREF(__pyx_t_12);
+ __pyx_cur_scope->__pyx_v_suffix_link_xcat_index = __pyx_t_12;
+ __pyx_t_12 = 0;
goto __pyx_L39;
}
__pyx_L39:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1108
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1113
* if is_shadow_path:
* suffix_link_xcat_index = xcat_index-1
* suffix_link_xcat = sym_setindex(self.category, suffix_link_xcat_index) # <<<<<<<<<<<<<<
* node.children[xcat] = ExtendedTrieNode(phrase_location=node.phrase_location,
* suffix_link=node.suffix_link.children[suffix_link_xcat],
*/
- __pyx_t_19 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index); if (unlikely((__pyx_t_19 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_cur_scope->__pyx_v_suffix_link_xcat = __pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_19);
+ __pyx_t_20 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_suffix_link_xcat_index); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_cur_scope->__pyx_v_suffix_link_xcat = __pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_20);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1109
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1114
* suffix_link_xcat_index = xcat_index-1
* suffix_link_xcat = sym_setindex(self.category, suffix_link_xcat_index)
* node.children[xcat] = ExtendedTrieNode(phrase_location=node.phrase_location, # <<<<<<<<<<<<<<
* suffix_link=node.suffix_link.children[suffix_link_xcat],
* phrase= Phrase(phrase + (xcat,)))
*/
- __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_11));
- __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_12));
+ __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__phrase_location), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1110
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1115
* suffix_link_xcat = sym_setindex(self.category, suffix_link_xcat_index)
* node.children[xcat] = ExtendedTrieNode(phrase_location=node.phrase_location,
* suffix_link=node.suffix_link.children[suffix_link_xcat], # <<<<<<<<<<<<<<
* phrase= Phrase(phrase + (xcat,)))
*
*/
- __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_3 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__children); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_3, __pyx_cur_scope->__pyx_v_suffix_link_xcat, sizeof(int), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__suffix_link), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_10 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__suffix_link); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_17 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__children); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_17, __pyx_cur_scope->__pyx_v_suffix_link_xcat, sizeof(int), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__suffix_link), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1111
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1116
* node.children[xcat] = ExtendedTrieNode(phrase_location=node.phrase_location,
* suffix_link=node.suffix_link.children[suffix_link_xcat],
* phrase= Phrase(phrase + (xcat,))) # <<<<<<<<<<<<<<
*
* # sample from range
*/
- __pyx_t_9 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_xcat); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_9 = PyNumber_Add(__pyx_cur_scope->__pyx_v_phrase, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__phrase), __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_11)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
+ __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_xcat); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_10);
+ __pyx_t_10 = 0;
+ __pyx_t_10 = PyNumber_Add(__pyx_cur_scope->__pyx_v_phrase, ((PyObject *)__pyx_t_17)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
+ __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_10);
+ __pyx_t_10 = 0;
+ __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
+ if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__phrase), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_ExtendedTrieNode)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1109
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1114
* suffix_link_xcat_index = xcat_index-1
* suffix_link_xcat = sym_setindex(self.category, suffix_link_xcat_index)
* node.children[xcat] = ExtendedTrieNode(phrase_location=node.phrase_location, # <<<<<<<<<<<<<<
* suffix_link=node.suffix_link.children[suffix_link_xcat],
* phrase= Phrase(phrase + (xcat,)))
*/
- __pyx_t_11 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- if (__Pyx_SetItemInt(__pyx_t_11, __pyx_cur_scope->__pyx_v_xcat, __pyx_t_9, sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_12 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ if (__Pyx_SetItemInt(__pyx_t_12, __pyx_cur_scope->__pyx_v_xcat, __pyx_t_10, sizeof(int), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L38;
}
__pyx_L38:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1114
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1119
*
* # sample from range
* if not is_shadow_path: # <<<<<<<<<<<<<<
* sample = self.sampler.sample(node.phrase_location)
* num_subpatterns = (<PhraseLocation> node.phrase_location).num_subpatterns
*/
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_20 = (!__pyx_t_8);
- if (__pyx_t_20) {
+ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = (!__pyx_t_9);
+ if (__pyx_t_21) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1115
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1120
* # sample from range
* if not is_shadow_path:
* sample = self.sampler.sample(node.phrase_location) # <<<<<<<<<<<<<<
* num_subpatterns = (<PhraseLocation> node.phrase_location).num_subpatterns
* chunklen = IntList(initial_len=num_subpatterns)
*/
- __pyx_t_9 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self->sampler), __pyx_n_s__sample); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_11 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_11);
- __pyx_t_11 = 0;
- __pyx_t_11 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self->sampler), __pyx_n_s__sample); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_12 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_12);
+ __Pyx_GIVEREF(__pyx_t_12);
+ __pyx_t_12 = 0;
+ __pyx_t_12 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
+ if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_3_sa_IntList))))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_sample));
__Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_sample));
- __Pyx_GIVEREF(__pyx_t_11);
- __pyx_cur_scope->__pyx_v_sample = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_11);
- __pyx_t_11 = 0;
+ __Pyx_GIVEREF(__pyx_t_12);
+ __pyx_cur_scope->__pyx_v_sample = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_12);
+ __pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1116
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1121
* if not is_shadow_path:
* sample = self.sampler.sample(node.phrase_location)
* num_subpatterns = (<PhraseLocation> node.phrase_location).num_subpatterns # <<<<<<<<<<<<<<
* chunklen = IntList(initial_len=num_subpatterns)
* for j from 0 <= j < num_subpatterns:
*/
- __pyx_t_11 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_cur_scope->__pyx_v_num_subpatterns = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_11)->num_subpatterns;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_12 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__phrase_location); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __pyx_cur_scope->__pyx_v_num_subpatterns = ((struct __pyx_obj_3_sa_PhraseLocation *)__pyx_t_12)->num_subpatterns;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1117
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1122
* sample = self.sampler.sample(node.phrase_location)
* num_subpatterns = (<PhraseLocation> node.phrase_location).num_subpatterns
* chunklen = IntList(initial_len=num_subpatterns) # <<<<<<<<<<<<<<
* for j from 0 <= j < num_subpatterns:
* chunklen.arr[j] = hiero_phrase.chunklen(j)
*/
- __pyx_t_11 = PyDict_New(); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_11));
- __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_t_11, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_11)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
+ __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_12));
+ __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ if (PyDict_SetItem(__pyx_t_12, ((PyObject *)__pyx_n_s__initial_len), __pyx_t_17) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __pyx_t_17 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_12)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_chunklen));
__Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_chunklen));
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_cur_scope->__pyx_v_chunklen = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_3);
- __pyx_t_3 = 0;
+ __Pyx_GIVEREF(__pyx_t_17);
+ __pyx_cur_scope->__pyx_v_chunklen = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_17);
+ __pyx_t_17 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1118
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1123
* num_subpatterns = (<PhraseLocation> node.phrase_location).num_subpatterns
* chunklen = IntList(initial_len=num_subpatterns)
* for j from 0 <= j < num_subpatterns: # <<<<<<<<<<<<<<
* chunklen.arr[j] = hiero_phrase.chunklen(j)
* extracts = []
*/
- __pyx_t_19 = __pyx_cur_scope->__pyx_v_num_subpatterns;
- for (__pyx_cur_scope->__pyx_v_j = 0; __pyx_cur_scope->__pyx_v_j < __pyx_t_19; __pyx_cur_scope->__pyx_v_j++) {
+ __pyx_t_20 = __pyx_cur_scope->__pyx_v_num_subpatterns;
+ for (__pyx_cur_scope->__pyx_v_j = 0; __pyx_cur_scope->__pyx_v_j < __pyx_t_20; __pyx_cur_scope->__pyx_v_j++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1119
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1124
* chunklen = IntList(initial_len=num_subpatterns)
* for j from 0 <= j < num_subpatterns:
* chunklen.arr[j] = hiero_phrase.chunklen(j) # <<<<<<<<<<<<<<
@@ -49157,22 +49311,22 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
(__pyx_cur_scope->__pyx_v_chunklen->arr[__pyx_cur_scope->__pyx_v_j]) = ((struct __pyx_vtabstruct_3_sa_Phrase *)__pyx_cur_scope->__pyx_v_hiero_phrase->__pyx_vtab)->chunklen(__pyx_cur_scope->__pyx_v_hiero_phrase, __pyx_cur_scope->__pyx_v_j);
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1120
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1125
* for j from 0 <= j < num_subpatterns:
* chunklen.arr[j] = hiero_phrase.chunklen(j)
* extracts = [] # <<<<<<<<<<<<<<
* j = 0
* extract_start = monitor_cpu()
*/
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_17 = PyList_New(0); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_extracts));
__Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_extracts));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
- __pyx_cur_scope->__pyx_v_extracts = __pyx_t_3;
- __pyx_t_3 = 0;
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_17));
+ __pyx_cur_scope->__pyx_v_extracts = __pyx_t_17;
+ __pyx_t_17 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1121
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1126
* chunklen.arr[j] = hiero_phrase.chunklen(j)
* extracts = []
* j = 0 # <<<<<<<<<<<<<<
@@ -49181,22 +49335,25 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
*/
__pyx_cur_scope->__pyx_v_j = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1122
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1127
* extracts = []
* j = 0
* extract_start = monitor_cpu() # <<<<<<<<<<<<<<
* while j < sample.len:
* extract = []
*/
- __pyx_t_3 = PyFloat_FromDouble(__pyx_f_3_sa_monitor_cpu()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_17 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_12 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_extract_start);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_extract_start);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_cur_scope->__pyx_v_extract_start = __pyx_t_3;
- __pyx_t_3 = 0;
+ __Pyx_GIVEREF(__pyx_t_12);
+ __pyx_cur_scope->__pyx_v_extract_start = __pyx_t_12;
+ __pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1123
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1128
* j = 0
* extract_start = monitor_cpu()
* while j < sample.len: # <<<<<<<<<<<<<<
@@ -49204,25 +49361,25 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
*
*/
while (1) {
- __pyx_t_20 = (__pyx_cur_scope->__pyx_v_j < __pyx_cur_scope->__pyx_v_sample->len);
- if (!__pyx_t_20) break;
+ __pyx_t_21 = (__pyx_cur_scope->__pyx_v_j < __pyx_cur_scope->__pyx_v_sample->len);
+ if (!__pyx_t_21) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1124
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1129
* extract_start = monitor_cpu()
* while j < sample.len:
* extract = [] # <<<<<<<<<<<<<<
*
* assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr)
*/
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_extract);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_extract);
- __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
- __pyx_cur_scope->__pyx_v_extract = ((PyObject *)__pyx_t_3);
- __pyx_t_3 = 0;
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_12));
+ __pyx_cur_scope->__pyx_v_extract = ((PyObject *)__pyx_t_12);
+ __pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1126
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1131
* extract = []
*
* assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr) # <<<<<<<<<<<<<<
@@ -49231,119 +49388,119 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
*/
__pyx_f_3_sa_assign_matching((&__pyx_cur_scope->__pyx_v_matching), __pyx_cur_scope->__pyx_v_sample->arr, __pyx_cur_scope->__pyx_v_j, __pyx_cur_scope->__pyx_v_num_subpatterns, __pyx_cur_scope->__pyx_v_self->fda->sent_id->arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1127
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1132
*
* assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr)
* loc = tuple(sample[j:j+num_subpatterns]) # <<<<<<<<<<<<<<
* extract = self.extract(hiero_phrase, &matching, chunklen.arr, num_subpatterns)
* extracts.extend([(e, loc) for e in extract])
*/
- __pyx_t_3 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_cur_scope->__pyx_v_sample), __pyx_cur_scope->__pyx_v_j, (__pyx_cur_scope->__pyx_v_j + __pyx_cur_scope->__pyx_v_num_subpatterns)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
+ __pyx_t_12 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_cur_scope->__pyx_v_sample), __pyx_cur_scope->__pyx_v_j, (__pyx_cur_scope->__pyx_v_j + __pyx_cur_scope->__pyx_v_num_subpatterns)); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_12);
+ __Pyx_GIVEREF(__pyx_t_12);
+ __pyx_t_12 = 0;
+ __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_17), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_loc);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_loc);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_cur_scope->__pyx_v_loc = __pyx_t_3;
- __pyx_t_3 = 0;
+ __Pyx_GIVEREF(__pyx_t_12);
+ __pyx_cur_scope->__pyx_v_loc = __pyx_t_12;
+ __pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1128
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1133
* assign_matching(&matching, sample.arr, j, num_subpatterns, self.fda.sent_id.arr)
* loc = tuple(sample[j:j+num_subpatterns])
* extract = self.extract(hiero_phrase, &matching, chunklen.arr, num_subpatterns) # <<<<<<<<<<<<<<
* extracts.extend([(e, loc) for e in extract])
* j = j + num_subpatterns
*/
- __pyx_t_3 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->extract(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_hiero_phrase, (&__pyx_cur_scope->__pyx_v_matching), __pyx_cur_scope->__pyx_v_chunklen->arr, __pyx_cur_scope->__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_12 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->extract(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_hiero_phrase, (&__pyx_cur_scope->__pyx_v_matching), __pyx_cur_scope->__pyx_v_chunklen->arr, __pyx_cur_scope->__pyx_v_num_subpatterns); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_extract);
__Pyx_DECREF(__pyx_cur_scope->__pyx_v_extract);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_cur_scope->__pyx_v_extract = __pyx_t_3;
- __pyx_t_3 = 0;
+ __Pyx_GIVEREF(__pyx_t_12);
+ __pyx_cur_scope->__pyx_v_extract = __pyx_t_12;
+ __pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1129
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1134
* loc = tuple(sample[j:j+num_subpatterns])
* extract = self.extract(hiero_phrase, &matching, chunklen.arr, num_subpatterns)
* extracts.extend([(e, loc) for e in extract]) # <<<<<<<<<<<<<<
* j = j + num_subpatterns
*
*/
- __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_extracts), __pyx_n_s__extend); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_12 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_extracts), __pyx_n_s__extend); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __pyx_t_17 = PyList_New(0); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_extract) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_extract)) {
- __pyx_t_9 = __pyx_cur_scope->__pyx_v_extract; __Pyx_INCREF(__pyx_t_9); __pyx_t_5 = 0;
- __pyx_t_21 = NULL;
+ __pyx_t_10 = __pyx_cur_scope->__pyx_v_extract; __Pyx_INCREF(__pyx_t_10); __pyx_t_6 = 0;
+ __pyx_t_22 = NULL;
} else {
- __pyx_t_5 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_extract); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_21 = Py_TYPE(__pyx_t_9)->tp_iternext;
+ __pyx_t_6 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_extract); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_22 = Py_TYPE(__pyx_t_10)->tp_iternext;
}
for (;;) {
- if (!__pyx_t_21 && PyList_CheckExact(__pyx_t_9)) {
- if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_9)) break;
+ if (!__pyx_t_22 && PyList_CheckExact(__pyx_t_10)) {
+ if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_10)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_15 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_15); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_16); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_15 = PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- } else if (!__pyx_t_21 && PyTuple_CheckExact(__pyx_t_9)) {
- if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
+ } else if (!__pyx_t_22 && PyTuple_CheckExact(__pyx_t_10)) {
+ if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_15); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_16); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_15 = PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
- __pyx_t_15 = __pyx_t_21(__pyx_t_9);
- if (unlikely(!__pyx_t_15)) {
+ __pyx_t_16 = __pyx_t_22(__pyx_t_10);
+ if (unlikely(!__pyx_t_16)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
- __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_GOTREF(__pyx_t_16);
}
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_e);
- __Pyx_GIVEREF(__pyx_t_15);
- __pyx_cur_scope->__pyx_v_e = __pyx_t_15;
- __pyx_t_15 = 0;
- __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_16);
+ __pyx_cur_scope->__pyx_v_e = __pyx_t_16;
+ __pyx_t_16 = 0;
+ __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_16);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e);
- PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_e);
+ PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_cur_scope->__pyx_v_e);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_loc);
- PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_cur_scope->__pyx_v_loc);
+ PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_cur_scope->__pyx_v_loc);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_loc);
- if (unlikely(__Pyx_PyList_Append(__pyx_t_11, (PyObject*)__pyx_t_15))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
+ if (unlikely(__Pyx_PyList_Append(__pyx_t_17, (PyObject*)__pyx_t_16))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0;
}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_INCREF(((PyObject *)__pyx_t_11));
- PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_11));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_11));
- __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
- __pyx_t_11 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_INCREF(((PyObject *)__pyx_t_17));
+ PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_17));
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_17));
+ __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
+ __pyx_t_17 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1130
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1135
* extract = self.extract(hiero_phrase, &matching, chunklen.arr, num_subpatterns)
* extracts.extend([(e, loc) for e in extract])
* j = j + num_subpatterns # <<<<<<<<<<<<<<
@@ -49353,7 +49510,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_j = (__pyx_cur_scope->__pyx_v_j + __pyx_cur_scope->__pyx_v_num_subpatterns);
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1132
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1137
* j = j + num_subpatterns
*
* num_samples = sample.len/num_subpatterns # <<<<<<<<<<<<<<
@@ -49362,120 +49519,123 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
*/
if (unlikely(__pyx_cur_scope->__pyx_v_num_subpatterns == 0)) {
PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
else if (sizeof(int) == sizeof(long) && unlikely(__pyx_cur_scope->__pyx_v_num_subpatterns == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_cur_scope->__pyx_v_sample->len))) {
PyErr_Format(PyExc_OverflowError, "value too large to perform division");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_cur_scope->__pyx_v_num_samples = __Pyx_div_int(__pyx_cur_scope->__pyx_v_sample->len, __pyx_cur_scope->__pyx_v_num_subpatterns);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1133
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1138
*
* num_samples = sample.len/num_subpatterns
* extract_stop = monitor_cpu() # <<<<<<<<<<<<<<
* self.extract_time = self.extract_time + extract_stop - extract_start
* if len(extracts) > 0:
*/
- __pyx_t_11 = PyFloat_FromDouble(__pyx_f_3_sa_monitor_cpu()); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_17 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_10 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_extract_stop);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_extract_stop);
- __Pyx_GIVEREF(__pyx_t_11);
- __pyx_cur_scope->__pyx_v_extract_stop = __pyx_t_11;
- __pyx_t_11 = 0;
+ __Pyx_GIVEREF(__pyx_t_10);
+ __pyx_cur_scope->__pyx_v_extract_stop = __pyx_t_10;
+ __pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1134
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1139
* num_samples = sample.len/num_subpatterns
* extract_stop = monitor_cpu()
* self.extract_time = self.extract_time + extract_stop - extract_start # <<<<<<<<<<<<<<
* if len(extracts) > 0:
* fcount = Counter()
*/
- __pyx_t_11 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->extract_time); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_9 = PyNumber_Add(__pyx_t_11, __pyx_cur_scope->__pyx_v_extract_stop); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = PyNumber_Subtract(__pyx_t_9, __pyx_cur_scope->__pyx_v_extract_start); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_22 = __pyx_PyFloat_AsFloat(__pyx_t_11); if (unlikely((__pyx_t_22 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_cur_scope->__pyx_v_self->extract_time = __pyx_t_22;
+ __pyx_t_10 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->extract_time); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_17 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_extract_stop); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = PyNumber_Subtract(__pyx_t_17, __pyx_cur_scope->__pyx_v_extract_start); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_10); if (unlikely((__pyx_t_4 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_cur_scope->__pyx_v_self->extract_time = __pyx_t_4;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1135
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1140
* extract_stop = monitor_cpu()
* self.extract_time = self.extract_time + extract_stop - extract_start
* if len(extracts) > 0: # <<<<<<<<<<<<<<
* fcount = Counter()
* fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list)))
*/
- __pyx_t_5 = PyList_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_extracts)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_20 = (__pyx_t_5 > 0);
- if (__pyx_t_20) {
+ __pyx_t_6 = PyList_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_extracts)); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = (__pyx_t_6 > 0);
+ if (__pyx_t_21) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1136
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1141
* self.extract_time = self.extract_time + extract_stop - extract_start
* if len(extracts) > 0:
* fcount = Counter() # <<<<<<<<<<<<<<
* fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list)))
* for (f, e, count, als), loc in extracts:
*/
- __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__Counter); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_9 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__Counter); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_17 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_fcount);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_fcount);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_cur_scope->__pyx_v_fcount = __pyx_t_9;
- __pyx_t_9 = 0;
+ __Pyx_GIVEREF(__pyx_t_17);
+ __pyx_cur_scope->__pyx_v_fcount = __pyx_t_17;
+ __pyx_t_17 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1137
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1142
* if len(extracts) > 0:
* fcount = Counter()
* fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list))) # <<<<<<<<<<<<<<
* for (f, e, count, als), loc in extracts:
* fcount[f] += count
*/
- __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_11 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_5input_lambda4, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_11);
- __pyx_t_11 = 0;
- __pyx_t_11 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+ __pyx_t_17 = __Pyx_GetName(__pyx_m, __pyx_n_s__defaultdict); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_10 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_5input_lambda4, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_10);
+ __pyx_t_10 = 0;
+ __pyx_t_10 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_fphrases);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_fphrases);
- __Pyx_GIVEREF(__pyx_t_11);
- __pyx_cur_scope->__pyx_v_fphrases = __pyx_t_11;
- __pyx_t_11 = 0;
+ __Pyx_GIVEREF(__pyx_t_10);
+ __pyx_cur_scope->__pyx_v_fphrases = __pyx_t_10;
+ __pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1138
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1143
* fcount = Counter()
* fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list)))
* for (f, e, count, als), loc in extracts: # <<<<<<<<<<<<<<
* fcount[f] += count
* fphrases[f][e][als].append(loc)
*/
- __pyx_t_11 = ((PyObject *)__pyx_cur_scope->__pyx_v_extracts); __Pyx_INCREF(__pyx_t_11); __pyx_t_5 = 0;
+ __pyx_t_10 = ((PyObject *)__pyx_cur_scope->__pyx_v_extracts); __Pyx_INCREF(__pyx_t_10); __pyx_t_6 = 0;
for (;;) {
- if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_11)) break;
+ if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_10)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_6); __Pyx_INCREF(__pyx_t_12); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_11, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PySequence_ITEM(__pyx_t_10, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
- PyObject* sequence = __pyx_t_3;
+ if ((likely(PyTuple_CheckExact(__pyx_t_12))) || (PyList_CheckExact(__pyx_t_12))) {
+ PyObject* sequence = __pyx_t_12;
#if CYTHON_COMPILING_IN_CPYTHON
Py_ssize_t size = Py_SIZE(sequence);
#else
@@ -49484,47 +49644,47 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_15 = PyTuple_GET_ITEM(sequence, 1);
+ __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_16 = PyTuple_GET_ITEM(sequence, 1);
} else {
- __pyx_t_9 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_15 = PyList_GET_ITEM(sequence, 1);
+ __pyx_t_17 = PyList_GET_ITEM(sequence, 0);
+ __pyx_t_16 = PyList_GET_ITEM(sequence, 1);
}
- __Pyx_INCREF(__pyx_t_9);
- __Pyx_INCREF(__pyx_t_15);
+ __Pyx_INCREF(__pyx_t_17);
+ __Pyx_INCREF(__pyx_t_16);
#else
- __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_15 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_16 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __pyx_t_19 = Py_TYPE(__pyx_t_1)->tp_iternext;
+ index = 0; __pyx_t_17 = __pyx_t_19(__pyx_t_1); if (unlikely(!__pyx_t_17)) goto __pyx_L50_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_17);
+ index = 1; __pyx_t_16 = __pyx_t_19(__pyx_t_1); if (unlikely(!__pyx_t_16)) goto __pyx_L50_unpacking_failed;
__Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_18 = Py_TYPE(__pyx_t_16)->tp_iternext;
- index = 0; __pyx_t_9 = __pyx_t_18(__pyx_t_16); if (unlikely(!__pyx_t_9)) goto __pyx_L50_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_9);
- index = 1; __pyx_t_15 = __pyx_t_18(__pyx_t_16); if (unlikely(!__pyx_t_15)) goto __pyx_L50_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_15);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_18(__pyx_t_16), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_18 = NULL;
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_1), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = NULL;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L51_unpacking_done;
__pyx_L50_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_18 = NULL;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_19 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L51_unpacking_done:;
}
- if ((likely(PyTuple_CheckExact(__pyx_t_9))) || (PyList_CheckExact(__pyx_t_9))) {
- PyObject* sequence = __pyx_t_9;
+ if ((likely(PyTuple_CheckExact(__pyx_t_17))) || (PyList_CheckExact(__pyx_t_17))) {
+ PyObject* sequence = __pyx_t_17;
#if CYTHON_COMPILING_IN_CPYTHON
Py_ssize_t size = Py_SIZE(sequence);
#else
@@ -49533,84 +49693,84 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
if (unlikely(size != 4)) {
if (size > 4) __Pyx_RaiseTooManyValuesError(4);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_16 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
- __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2);
- __pyx_t_7 = PyTuple_GET_ITEM(sequence, 3);
+ __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
+ __pyx_t_11 = PyTuple_GET_ITEM(sequence, 2);
+ __pyx_t_8 = PyTuple_GET_ITEM(sequence, 3);
} else {
- __pyx_t_16 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_1 = PyList_GET_ITEM(sequence, 1);
- __pyx_t_10 = PyList_GET_ITEM(sequence, 2);
- __pyx_t_7 = PyList_GET_ITEM(sequence, 3);
+ __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
+ __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
+ __pyx_t_11 = PyList_GET_ITEM(sequence, 2);
+ __pyx_t_8 = PyList_GET_ITEM(sequence, 3);
}
- __Pyx_INCREF(__pyx_t_16);
__Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_t_10);
- __Pyx_INCREF(__pyx_t_7);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_11);
+ __Pyx_INCREF(__pyx_t_8);
#else
Py_ssize_t i;
- PyObject** temps[4] = {&__pyx_t_16,&__pyx_t_1,&__pyx_t_10,&__pyx_t_7};
+ PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_3,&__pyx_t_11,&__pyx_t_8};
for (i=0; i < 4; i++) {
- PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
*(temps[i]) = item;
}
#endif
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
} else
{
Py_ssize_t index = -1;
- PyObject** temps[4] = {&__pyx_t_16,&__pyx_t_1,&__pyx_t_10,&__pyx_t_7};
- __pyx_t_14 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_18 = Py_TYPE(__pyx_t_14)->tp_iternext;
+ PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_3,&__pyx_t_11,&__pyx_t_8};
+ __pyx_t_15 = PyObject_GetIter(__pyx_t_17); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __pyx_t_19 = Py_TYPE(__pyx_t_15)->tp_iternext;
for (index=0; index < 4; index++) {
- PyObject* item = __pyx_t_18(__pyx_t_14); if (unlikely(!item)) goto __pyx_L52_unpacking_failed;
+ PyObject* item = __pyx_t_19(__pyx_t_15); if (unlikely(!item)) goto __pyx_L52_unpacking_failed;
__Pyx_GOTREF(item);
*(temps[index]) = item;
}
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_18(__pyx_t_14), 4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_18 = NULL;
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_15), 4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = NULL;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
goto __pyx_L53_unpacking_done;
__pyx_L52_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __pyx_t_18 = NULL;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __pyx_t_19 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L53_unpacking_done:;
}
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_f);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_f);
- __Pyx_GIVEREF(__pyx_t_16);
- __pyx_cur_scope->__pyx_v_f = __pyx_t_16;
- __pyx_t_16 = 0;
- __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e);
- __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_e);
__Pyx_GIVEREF(__pyx_t_1);
- __pyx_cur_scope->__pyx_v_e = __pyx_t_1;
+ __pyx_cur_scope->__pyx_v_f = __pyx_t_1;
__pyx_t_1 = 0;
+ __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e);
+ __Pyx_XDECREF(__pyx_cur_scope->__pyx_v_e);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_cur_scope->__pyx_v_e = __pyx_t_3;
+ __pyx_t_3 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_count);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_count);
- __Pyx_GIVEREF(__pyx_t_10);
- __pyx_cur_scope->__pyx_v_count = __pyx_t_10;
- __pyx_t_10 = 0;
+ __Pyx_GIVEREF(__pyx_t_11);
+ __pyx_cur_scope->__pyx_v_count = __pyx_t_11;
+ __pyx_t_11 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_als);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_als);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_cur_scope->__pyx_v_als = __pyx_t_7;
- __pyx_t_7 = 0;
+ __Pyx_GIVEREF(__pyx_t_8);
+ __pyx_cur_scope->__pyx_v_als = __pyx_t_8;
+ __pyx_t_8 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_loc);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_loc);
- __Pyx_GIVEREF(__pyx_t_15);
- __pyx_cur_scope->__pyx_v_loc = __pyx_t_15;
- __pyx_t_15 = 0;
+ __Pyx_GIVEREF(__pyx_t_16);
+ __pyx_cur_scope->__pyx_v_loc = __pyx_t_16;
+ __pyx_t_16 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1139
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1144
* fphrases = defaultdict(lambda: defaultdict(lambda: defaultdict(list)))
* for (f, e, count, als), loc in extracts:
* fcount[f] += count # <<<<<<<<<<<<<<
@@ -49618,73 +49778,73 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
* for f, elist in fphrases.iteritems():
*/
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
- __pyx_t_3 = __pyx_cur_scope->__pyx_v_f;
- __pyx_t_15 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_t_3); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
- __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_t_15, __pyx_cur_scope->__pyx_v_count); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- if (PyObject_SetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_t_3, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_12 = __pyx_cur_scope->__pyx_v_f;
+ __pyx_t_16 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_t_12); if (!__pyx_t_16) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_16);
+ __pyx_t_17 = PyNumber_InPlaceAdd(__pyx_t_16, __pyx_cur_scope->__pyx_v_count); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ if (PyObject_SetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_t_12, __pyx_t_17) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1140
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1145
* for (f, e, count, als), loc in extracts:
* fcount[f] += count
* fphrases[f][e][als].append(loc) # <<<<<<<<<<<<<<
* for f, elist in fphrases.iteritems():
* for e, alslist in elist.iteritems():
*/
- __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fphrases, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_9 = PyObject_GetItem(__pyx_t_3, __pyx_cur_scope->__pyx_v_e); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_GetItem(__pyx_t_9, __pyx_cur_scope->__pyx_v_als); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_cur_scope->__pyx_v_loc); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_12 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fphrases, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __pyx_t_17 = PyObject_GetItem(__pyx_t_12, __pyx_cur_scope->__pyx_v_e); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __pyx_t_12 = PyObject_GetItem(__pyx_t_17, __pyx_cur_scope->__pyx_v_als); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __pyx_t_17 = __Pyx_PyObject_Append(__pyx_t_12, __pyx_cur_scope->__pyx_v_loc); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
}
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1141
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1146
* fcount[f] += count
* fphrases[f][e][als].append(loc)
* for f, elist in fphrases.iteritems(): # <<<<<<<<<<<<<<
* for e, alslist in elist.iteritems():
* alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1]))
*/
- __pyx_t_5 = 0;
+ __pyx_t_6 = 0;
if (unlikely(__pyx_cur_scope->__pyx_v_fphrases == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_9 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_fphrases, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_23), (&__pyx_t_19)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_XDECREF(__pyx_t_11);
- __pyx_t_11 = __pyx_t_9;
- __pyx_t_9 = 0;
+ __pyx_t_17 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_fphrases, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_23), (&__pyx_t_20)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_XDECREF(__pyx_t_10);
+ __pyx_t_10 = __pyx_t_17;
+ __pyx_t_17 = 0;
while (1) {
- __pyx_t_6 = __Pyx_dict_iter_next(__pyx_t_11, __pyx_t_23, &__pyx_t_5, &__pyx_t_9, &__pyx_t_3, NULL, __pyx_t_19);
- if (unlikely(__pyx_t_6 == 0)) break;
- if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_10, __pyx_t_23, &__pyx_t_6, &__pyx_t_17, &__pyx_t_12, NULL, __pyx_t_20);
+ if (unlikely(__pyx_t_7 == 0)) break;
+ if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_GOTREF(__pyx_t_12);
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_f);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_f);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_cur_scope->__pyx_v_f = __pyx_t_9;
- __pyx_t_9 = 0;
+ __Pyx_GIVEREF(__pyx_t_17);
+ __pyx_cur_scope->__pyx_v_f = __pyx_t_17;
+ __pyx_t_17 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_elist);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_elist);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_cur_scope->__pyx_v_elist = __pyx_t_3;
- __pyx_t_3 = 0;
+ __Pyx_GIVEREF(__pyx_t_12);
+ __pyx_cur_scope->__pyx_v_elist = __pyx_t_12;
+ __pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1142
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1147
* fphrases[f][e][als].append(loc)
* for f, elist in fphrases.iteritems():
* for e, alslist in elist.iteritems(): # <<<<<<<<<<<<<<
@@ -49694,59 +49854,59 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_t_24 = 0;
if (unlikely(__pyx_cur_scope->__pyx_v_elist == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "iteritems");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __pyx_t_9 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_elist, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_25), (&__pyx_t_6)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_XDECREF(__pyx_t_3);
- __pyx_t_3 = __pyx_t_9;
- __pyx_t_9 = 0;
+ __pyx_t_17 = __Pyx_dict_iterator(__pyx_cur_scope->__pyx_v_elist, 0, ((PyObject *)__pyx_n_s__iteritems), (&__pyx_t_25), (&__pyx_t_7)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_XDECREF(__pyx_t_12);
+ __pyx_t_12 = __pyx_t_17;
+ __pyx_t_17 = 0;
while (1) {
- __pyx_t_4 = __Pyx_dict_iter_next(__pyx_t_3, __pyx_t_25, &__pyx_t_24, &__pyx_t_9, &__pyx_t_15, NULL, __pyx_t_6);
- if (unlikely(__pyx_t_4 == 0)) break;
- if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_GOTREF(__pyx_t_15);
+ __pyx_t_5 = __Pyx_dict_iter_next(__pyx_t_12, __pyx_t_25, &__pyx_t_24, &__pyx_t_17, &__pyx_t_16, NULL, __pyx_t_7);
+ if (unlikely(__pyx_t_5 == 0)) break;
+ if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_GOTREF(__pyx_t_16);
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_e);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_cur_scope->__pyx_v_e = __pyx_t_9;
- __pyx_t_9 = 0;
+ __Pyx_GIVEREF(__pyx_t_17);
+ __pyx_cur_scope->__pyx_v_e = __pyx_t_17;
+ __pyx_t_17 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_alslist);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_alslist);
- __Pyx_GIVEREF(__pyx_t_15);
- __pyx_cur_scope->__pyx_v_alslist = __pyx_t_15;
- __pyx_t_15 = 0;
+ __Pyx_GIVEREF(__pyx_t_16);
+ __pyx_cur_scope->__pyx_v_alslist = __pyx_t_16;
+ __pyx_t_16 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1143
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1148
* for f, elist in fphrases.iteritems():
* for e, alslist in elist.iteritems():
* alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1])) # <<<<<<<<<<<<<<
* locs = tuple(itertools.chain.from_iterable(alslist.itervalues()))
* count = len(locs)
*/
- __pyx_t_15 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
- __pyx_t_9 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_9));
- __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_5input_1lambda6, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_t_9, ((PyObject *)__pyx_n_s__key), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_15), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
- if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
- PyObject* sequence = __pyx_t_7;
+ __pyx_t_16 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s__iteritems); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_16);
+ __pyx_t_17 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_16);
+ PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_17);
+ __Pyx_GIVEREF(__pyx_t_17);
+ __pyx_t_17 = 0;
+ __pyx_t_17 = PyDict_New(); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_17));
+ __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_5input_1lambda6, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ if (PyDict_SetItem(__pyx_t_17, ((PyObject *)__pyx_n_s__key), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_8 = PyObject_Call(__pyx_builtin_max, ((PyObject *)__pyx_t_16), ((PyObject *)__pyx_t_17)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
+ if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
+ PyObject* sequence = __pyx_t_8;
#if CYTHON_COMPILING_IN_CPYTHON
Py_ssize_t size = Py_SIZE(sequence);
#else
@@ -49755,236 +49915,236 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_15 = PyTuple_GET_ITEM(sequence, 1);
+ __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_16 = PyTuple_GET_ITEM(sequence, 1);
} else {
- __pyx_t_9 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_15 = PyList_GET_ITEM(sequence, 1);
+ __pyx_t_17 = PyList_GET_ITEM(sequence, 0);
+ __pyx_t_16 = PyList_GET_ITEM(sequence, 1);
}
- __Pyx_INCREF(__pyx_t_9);
- __Pyx_INCREF(__pyx_t_15);
+ __Pyx_INCREF(__pyx_t_17);
+ __Pyx_INCREF(__pyx_t_16);
#else
- __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_15 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_10 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_18 = Py_TYPE(__pyx_t_10)->tp_iternext;
- index = 0; __pyx_t_9 = __pyx_t_18(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L58_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_9);
- index = 1; __pyx_t_15 = __pyx_t_18(__pyx_t_10); if (unlikely(!__pyx_t_15)) goto __pyx_L58_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_15);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_18(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_18 = NULL;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_11 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_19 = Py_TYPE(__pyx_t_11)->tp_iternext;
+ index = 0; __pyx_t_17 = __pyx_t_19(__pyx_t_11); if (unlikely(!__pyx_t_17)) goto __pyx_L58_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_17);
+ index = 1; __pyx_t_16 = __pyx_t_19(__pyx_t_11); if (unlikely(!__pyx_t_16)) goto __pyx_L58_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_16);
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_11), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = NULL;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
goto __pyx_L59_unpacking_done;
__pyx_L58_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_18 = NULL;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_19 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L59_unpacking_done:;
}
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_alignment);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_alignment);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_cur_scope->__pyx_v_alignment = __pyx_t_9;
- __pyx_t_9 = 0;
+ __Pyx_GIVEREF(__pyx_t_17);
+ __pyx_cur_scope->__pyx_v_alignment = __pyx_t_17;
+ __pyx_t_17 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_max_locs);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_max_locs);
- __Pyx_GIVEREF(__pyx_t_15);
- __pyx_cur_scope->__pyx_v_max_locs = __pyx_t_15;
- __pyx_t_15 = 0;
+ __Pyx_GIVEREF(__pyx_t_16);
+ __pyx_cur_scope->__pyx_v_max_locs = __pyx_t_16;
+ __pyx_t_16 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1144
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1149
* for e, alslist in elist.iteritems():
* alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1]))
* locs = tuple(itertools.chain.from_iterable(alslist.itervalues())) # <<<<<<<<<<<<<<
* count = len(locs)
* scores = self.scorer.score(FeatureContext(
*/
- __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__itertools); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_15 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__chain); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = PyObject_GetAttr(__pyx_t_15, __pyx_n_s__from_iterable); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s__itervalues); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
- __pyx_t_9 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
- __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
+ __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__itertools); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_16 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__chain); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_16);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_8 = PyObject_GetAttr(__pyx_t_16, __pyx_n_s__from_iterable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __pyx_t_16 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_alslist, __pyx_n_s__itervalues); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_16);
+ __pyx_t_17 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_16);
+ PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_17);
+ __Pyx_GIVEREF(__pyx_t_17);
+ __pyx_t_17 = 0;
+ __pyx_t_17 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0;
+ __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_16);
+ PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_17);
+ __Pyx_GIVEREF(__pyx_t_17);
+ __pyx_t_17 = 0;
+ __pyx_t_17 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0;
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_locs));
__Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_locs));
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_cur_scope->__pyx_v_locs = ((PyObject*)__pyx_t_9);
- __pyx_t_9 = 0;
+ __Pyx_GIVEREF(__pyx_t_17);
+ __pyx_cur_scope->__pyx_v_locs = ((PyObject*)__pyx_t_17);
+ __pyx_t_17 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1145
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1150
* alignment, max_locs = max(alslist.iteritems(), key=lambda x: len(x[1]))
* locs = tuple(itertools.chain.from_iterable(alslist.itervalues()))
* count = len(locs) # <<<<<<<<<<<<<<
* scores = self.scorer.score(FeatureContext(
* f, e, count, fcount[f], num_samples,
*/
- __pyx_t_26 = PyTuple_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_locs)); if (unlikely(__pyx_t_26 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_26); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_26 = PyTuple_GET_SIZE(((PyObject *)__pyx_cur_scope->__pyx_v_locs)); if (unlikely(__pyx_t_26 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PyInt_FromSsize_t(__pyx_t_26); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_count);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_count);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_cur_scope->__pyx_v_count = __pyx_t_9;
- __pyx_t_9 = 0;
+ __Pyx_GIVEREF(__pyx_t_17);
+ __pyx_cur_scope->__pyx_v_count = __pyx_t_17;
+ __pyx_t_17 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1146
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1151
* locs = tuple(itertools.chain.from_iterable(alslist.itervalues()))
* count = len(locs)
* scores = self.scorer.score(FeatureContext( # <<<<<<<<<<<<<<
* f, e, count, fcount[f], num_samples,
* (k,i+spanlen), locs, input_match,
*/
- __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__FeatureContext); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_17 = __Pyx_GetName(__pyx_m, __pyx_n_s__FeatureContext); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1147
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1152
* count = len(locs)
* scores = self.scorer.score(FeatureContext(
* f, e, count, fcount[f], num_samples, # <<<<<<<<<<<<<<
* (k,i+spanlen), locs, input_match,
* fwords, self.fda, self.eda,
*/
- __pyx_t_15 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
- __pyx_t_7 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_samples); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_16 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fcount, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_16) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_16);
+ __pyx_t_8 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_num_samples); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1148
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1153
* scores = self.scorer.score(FeatureContext(
* f, e, count, fcount[f], num_samples,
* (k,i+spanlen), locs, input_match, # <<<<<<<<<<<<<<
* fwords, self.fda, self.eda,
* meta,
*/
- __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_1 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_16 = PyNumber_Add(__pyx_t_1, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_16);
- __Pyx_GIVEREF(__pyx_t_16);
- __pyx_t_10 = 0;
- __pyx_t_16 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_11);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_11 = 0;
+ __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1152
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1157
* meta,
* # Include online stats. None if none.
* self.online_ctx_lookup(f, e))) # <<<<<<<<<<<<<<
* # Phrase pair processed
* if self.online:
*/
- __pyx_t_16 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__online_ctx_lookup); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__online_ctx_lookup); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_cur_scope->__pyx_v_f);
+ PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_cur_scope->__pyx_v_f);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e);
- PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_cur_scope->__pyx_v_e);
+ PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_cur_scope->__pyx_v_e);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e);
- __pyx_t_14 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
- __pyx_t_10 = PyTuple_New(13); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_15 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
+ __pyx_t_11 = PyTuple_New(13); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_cur_scope->__pyx_v_f);
+ PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_cur_scope->__pyx_v_f);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e);
- PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_cur_scope->__pyx_v_e);
+ PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_cur_scope->__pyx_v_e);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_count);
- PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_cur_scope->__pyx_v_count);
+ PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_cur_scope->__pyx_v_count);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_count);
- PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_15);
- __Pyx_GIVEREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_10, 5, ((PyObject *)__pyx_t_1));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
+ PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_t_16);
+ __Pyx_GIVEREF(__pyx_t_16);
+ PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_t_8);
+ __Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_11, 5, ((PyObject *)__pyx_t_3));
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_locs));
- PyTuple_SET_ITEM(__pyx_t_10, 6, ((PyObject *)__pyx_cur_scope->__pyx_v_locs));
+ PyTuple_SET_ITEM(__pyx_t_11, 6, ((PyObject *)__pyx_cur_scope->__pyx_v_locs));
__Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_locs));
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_input_match);
- PyTuple_SET_ITEM(__pyx_t_10, 7, __pyx_cur_scope->__pyx_v_input_match);
+ PyTuple_SET_ITEM(__pyx_t_11, 7, __pyx_cur_scope->__pyx_v_input_match);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_input_match);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_fwords);
- PyTuple_SET_ITEM(__pyx_t_10, 8, __pyx_cur_scope->__pyx_v_fwords);
+ PyTuple_SET_ITEM(__pyx_t_11, 8, __pyx_cur_scope->__pyx_v_fwords);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fwords);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->fda));
- PyTuple_SET_ITEM(__pyx_t_10, 9, ((PyObject *)__pyx_cur_scope->__pyx_v_self->fda));
+ PyTuple_SET_ITEM(__pyx_t_11, 9, ((PyObject *)__pyx_cur_scope->__pyx_v_self->fda));
__Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->fda));
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->eda));
- PyTuple_SET_ITEM(__pyx_t_10, 10, ((PyObject *)__pyx_cur_scope->__pyx_v_self->eda));
+ PyTuple_SET_ITEM(__pyx_t_11, 10, ((PyObject *)__pyx_cur_scope->__pyx_v_self->eda));
__Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->eda));
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_meta);
- PyTuple_SET_ITEM(__pyx_t_10, 11, __pyx_cur_scope->__pyx_v_meta);
+ PyTuple_SET_ITEM(__pyx_t_11, 11, __pyx_cur_scope->__pyx_v_meta);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_meta);
- PyTuple_SET_ITEM(__pyx_t_10, 12, __pyx_t_14);
- __Pyx_GIVEREF(__pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_11, 12, __pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_15);
+ __pyx_t_16 = 0;
+ __pyx_t_8 = 0;
+ __pyx_t_3 = 0;
__pyx_t_15 = 0;
- __pyx_t_7 = 0;
- __pyx_t_1 = 0;
- __pyx_t_14 = 0;
- __pyx_t_14 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
- __pyx_t_10 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_Scorer *)__pyx_cur_scope->__pyx_v_self->scorer->__pyx_vtab)->score(__pyx_cur_scope->__pyx_v_self->scorer, __pyx_t_14)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __pyx_t_15 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
+ __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_Scorer *)__pyx_cur_scope->__pyx_v_self->scorer->__pyx_vtab)->score(__pyx_cur_scope->__pyx_v_self->scorer, __pyx_t_15)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores));
__Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores));
- __Pyx_GIVEREF(__pyx_t_10);
- __pyx_cur_scope->__pyx_v_scores = ((struct __pyx_obj_3_sa_FeatureVector *)__pyx_t_10);
- __pyx_t_10 = 0;
+ __Pyx_GIVEREF(__pyx_t_11);
+ __pyx_cur_scope->__pyx_v_scores = ((struct __pyx_obj_3_sa_FeatureVector *)__pyx_t_11);
+ __pyx_t_11 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1154
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1159
* self.online_ctx_lookup(f, e)))
* # Phrase pair processed
* if self.online: # <<<<<<<<<<<<<<
@@ -49993,68 +50153,68 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
*/
if (__pyx_cur_scope->__pyx_v_self->online) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1155
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1160
* # Phrase pair processed
* if self.online:
* seen_phrases.add((f, e)) # <<<<<<<<<<<<<<
* yield Rule(self.category, f, e, scores, alignment)
*
*/
- __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_cur_scope->__pyx_v_f);
+ PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_cur_scope->__pyx_v_f);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e);
- PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_cur_scope->__pyx_v_e);
+ PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_cur_scope->__pyx_v_e);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e);
- __pyx_t_12 = PySet_Add(__pyx_cur_scope->__pyx_v_seen_phrases, ((PyObject *)__pyx_t_10)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
+ __pyx_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_seen_phrases, ((PyObject *)__pyx_t_11)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
goto __pyx_L60;
}
__pyx_L60:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1156
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1161
* if self.online:
* seen_phrases.add((f, e))
* yield Rule(self.category, f, e, scores, alignment) # <<<<<<<<<<<<<<
*
* if len(phrase) < self.max_length and i+spanlen < len(fwords) and pathlen+1 <= self.max_initial_size:
*/
- __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->category); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_14 = PyTuple_New(5); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_10);
+ __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->category); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_15 = PyTuple_New(5); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_15);
+ PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_11);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
- PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_cur_scope->__pyx_v_f);
+ PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_cur_scope->__pyx_v_f);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e);
- PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_cur_scope->__pyx_v_e);
+ PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_cur_scope->__pyx_v_e);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores));
- PyTuple_SET_ITEM(__pyx_t_14, 3, ((PyObject *)__pyx_cur_scope->__pyx_v_scores));
+ PyTuple_SET_ITEM(__pyx_t_15, 3, ((PyObject *)__pyx_cur_scope->__pyx_v_scores));
__Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores));
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_alignment);
- PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_cur_scope->__pyx_v_alignment);
+ PyTuple_SET_ITEM(__pyx_t_15, 4, __pyx_cur_scope->__pyx_v_alignment);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_alignment);
- __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Rule)), ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
- __pyx_r = __pyx_t_10;
- __pyx_t_10 = 0;
+ __pyx_t_11 = 0;
+ __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Rule)), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
+ __pyx_r = __pyx_t_11;
+ __pyx_t_11 = 0;
__pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
- __Pyx_XGIVEREF(__pyx_t_3);
- __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
- __pyx_cur_scope->__pyx_t_2 = __pyx_t_5;
- __pyx_cur_scope->__pyx_t_3 = __pyx_t_6;
- __Pyx_XGIVEREF(__pyx_t_11);
- __pyx_cur_scope->__pyx_t_4 = __pyx_t_11;
- __Pyx_XGIVEREF(__pyx_t_13);
- __pyx_cur_scope->__pyx_t_5 = __pyx_t_13;
- __pyx_cur_scope->__pyx_t_6 = __pyx_t_19;
+ __pyx_cur_scope->__pyx_t_1 = __pyx_t_6;
+ __pyx_cur_scope->__pyx_t_2 = __pyx_t_7;
+ __Pyx_XGIVEREF(__pyx_t_10);
+ __pyx_cur_scope->__pyx_t_3 = __pyx_t_10;
+ __Pyx_XGIVEREF(__pyx_t_12);
+ __pyx_cur_scope->__pyx_t_4 = __pyx_t_12;
+ __Pyx_XGIVEREF(__pyx_t_14);
+ __pyx_cur_scope->__pyx_t_5 = __pyx_t_14;
+ __pyx_cur_scope->__pyx_t_6 = __pyx_t_20;
__pyx_cur_scope->__pyx_t_7 = __pyx_t_23;
__pyx_cur_scope->__pyx_t_8 = __pyx_t_24;
__pyx_cur_scope->__pyx_t_9 = __pyx_t_25;
@@ -50065,26 +50225,26 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
return __pyx_r;
__pyx_L61_resume_from_yield:;
__pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
- __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
- __pyx_cur_scope->__pyx_t_1 = 0;
- __Pyx_XGOTREF(__pyx_t_3);
- __pyx_t_5 = __pyx_cur_scope->__pyx_t_2;
- __pyx_t_6 = __pyx_cur_scope->__pyx_t_3;
- __pyx_t_11 = __pyx_cur_scope->__pyx_t_4;
+ __pyx_t_6 = __pyx_cur_scope->__pyx_t_1;
+ __pyx_t_7 = __pyx_cur_scope->__pyx_t_2;
+ __pyx_t_10 = __pyx_cur_scope->__pyx_t_3;
+ __pyx_cur_scope->__pyx_t_3 = 0;
+ __Pyx_XGOTREF(__pyx_t_10);
+ __pyx_t_12 = __pyx_cur_scope->__pyx_t_4;
__pyx_cur_scope->__pyx_t_4 = 0;
- __Pyx_XGOTREF(__pyx_t_11);
- __pyx_t_13 = __pyx_cur_scope->__pyx_t_5;
+ __Pyx_XGOTREF(__pyx_t_12);
+ __pyx_t_14 = __pyx_cur_scope->__pyx_t_5;
__pyx_cur_scope->__pyx_t_5 = 0;
- __Pyx_XGOTREF(__pyx_t_13);
- __pyx_t_19 = __pyx_cur_scope->__pyx_t_6;
+ __Pyx_XGOTREF(__pyx_t_14);
+ __pyx_t_20 = __pyx_cur_scope->__pyx_t_6;
__pyx_t_23 = __pyx_cur_scope->__pyx_t_7;
__pyx_t_24 = __pyx_cur_scope->__pyx_t_8;
__pyx_t_25 = __pyx_cur_scope->__pyx_t_9;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
}
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L47;
}
__pyx_L47:;
@@ -50095,121 +50255,121 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
__pyx_L32:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1158
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1163
* yield Rule(self.category, f, e, scores, alignment)
*
* if len(phrase) < self.max_length and i+spanlen < len(fwords) and pathlen+1 <= self.max_initial_size: # <<<<<<<<<<<<<<
* for alt_id in range(len(fwords[i+spanlen])):
* new_frontier.append((k, i+spanlen, input_match, alt_id, pathlen + 1, node, phrase, is_shadow_path))
*/
- __pyx_t_23 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_20 = (__pyx_t_23 < __pyx_cur_scope->__pyx_v_self->max_length);
- if (__pyx_t_20) {
- __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_3 = PyNumber_Add(__pyx_t_11, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = __pyx_cur_scope->__pyx_v_fwords;
- __Pyx_INCREF(__pyx_t_11);
- __pyx_t_23 = PyObject_Length(__pyx_t_11); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = PyInt_FromSsize_t(__pyx_t_23); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_10 = PyObject_RichCompare(__pyx_t_3, __pyx_t_11, Py_LT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_23 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = (__pyx_t_23 < __pyx_cur_scope->__pyx_v_self->max_length);
+ if (__pyx_t_21) {
+ __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_12 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- if (__pyx_t_8) {
- __pyx_t_10 = PyNumber_Add(__pyx_cur_scope->__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __pyx_cur_scope->__pyx_v_fwords;
+ __Pyx_INCREF(__pyx_t_10);
+ __pyx_t_23 = PyObject_Length(__pyx_t_10); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = PyInt_FromSsize_t(__pyx_t_23); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_11 = PyObject_RichCompare(__pyx_t_12, __pyx_t_10, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ if (__pyx_t_9) {
+ __pyx_t_11 = PyNumber_Add(__pyx_cur_scope->__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_10, __pyx_t_11, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_12 = PyObject_RichCompare(__pyx_t_11, __pyx_t_10, Py_LE); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_27 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_27 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_t_28 = __pyx_t_27;
} else {
- __pyx_t_28 = __pyx_t_8;
+ __pyx_t_28 = __pyx_t_9;
}
- __pyx_t_8 = __pyx_t_28;
+ __pyx_t_9 = __pyx_t_28;
} else {
- __pyx_t_8 = __pyx_t_20;
+ __pyx_t_9 = __pyx_t_21;
}
- if (__pyx_t_8) {
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1159
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1164
*
* if len(phrase) < self.max_length and i+spanlen < len(fwords) and pathlen+1 <= self.max_initial_size:
* for alt_id in range(len(fwords[i+spanlen])): # <<<<<<<<<<<<<<
* new_frontier.append((k, i+spanlen, input_match, alt_id, pathlen + 1, node, phrase, is_shadow_path))
* num_subpatterns = arity
*/
- __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_11 = PyNumber_Add(__pyx_t_3, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fwords, __pyx_t_11); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_23 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_23; __pyx_t_19+=1) {
- __pyx_cur_scope->__pyx_v_alt_id = __pyx_t_19;
+ __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __pyx_t_10 = PyNumber_Add(__pyx_t_12, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __pyx_t_12 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fwords, __pyx_t_10); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_23 = PyObject_Length(__pyx_t_12); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ for (__pyx_t_20 = 0; __pyx_t_20 < __pyx_t_23; __pyx_t_20+=1) {
+ __pyx_cur_scope->__pyx_v_alt_id = __pyx_t_20;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1160
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1165
* if len(phrase) < self.max_length and i+spanlen < len(fwords) and pathlen+1 <= self.max_initial_size:
* for alt_id in range(len(fwords[i+spanlen])):
* new_frontier.append((k, i+spanlen, input_match, alt_id, pathlen + 1, node, phrase, is_shadow_path)) # <<<<<<<<<<<<<<
* num_subpatterns = arity
* if not is_shadow_path:
*/
- __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_10 = PyNumber_Add(__pyx_t_11, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt_id); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyNumber_Add(__pyx_t_10, __pyx_cur_scope->__pyx_v_spanlen); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_14 = PyNumber_Add(__pyx_cur_scope->__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- __pyx_t_9 = PyTuple_New(8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt_id); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_15 = PyNumber_Add(__pyx_cur_scope->__pyx_v_pathlen, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_15);
+ __pyx_t_17 = PyTuple_New(8); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_12);
+ __Pyx_GIVEREF(__pyx_t_12);
+ PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_11);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_input_match);
- PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_cur_scope->__pyx_v_input_match);
+ PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_cur_scope->__pyx_v_input_match);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_input_match);
- PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_t_14);
- __Pyx_GIVEREF(__pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_17, 3, __pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_17, 4, __pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_15);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_node);
- PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_cur_scope->__pyx_v_node);
+ PyTuple_SET_ITEM(__pyx_t_17, 5, __pyx_cur_scope->__pyx_v_node);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_node);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_phrase);
- PyTuple_SET_ITEM(__pyx_t_9, 6, __pyx_cur_scope->__pyx_v_phrase);
+ PyTuple_SET_ITEM(__pyx_t_17, 6, __pyx_cur_scope->__pyx_v_phrase);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_phrase);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_is_shadow_path);
- PyTuple_SET_ITEM(__pyx_t_9, 7, __pyx_cur_scope->__pyx_v_is_shadow_path);
+ PyTuple_SET_ITEM(__pyx_t_17, 7, __pyx_cur_scope->__pyx_v_is_shadow_path);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_is_shadow_path);
- __pyx_t_3 = 0;
- __pyx_t_10 = 0;
+ __pyx_t_12 = 0;
__pyx_t_11 = 0;
- __pyx_t_14 = 0;
- __pyx_t_12 = PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_9)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
+ __pyx_t_10 = 0;
+ __pyx_t_15 = 0;
+ __pyx_t_13 = PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_17)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1161
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1166
* for alt_id in range(len(fwords[i+spanlen])):
* new_frontier.append((k, i+spanlen, input_match, alt_id, pathlen + 1, node, phrase, is_shadow_path))
* num_subpatterns = arity # <<<<<<<<<<<<<<
@@ -50218,18 +50378,18 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
*/
__pyx_cur_scope->__pyx_v_num_subpatterns = __pyx_cur_scope->__pyx_v_arity;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1162
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1167
* new_frontier.append((k, i+spanlen, input_match, alt_id, pathlen + 1, node, phrase, is_shadow_path))
* num_subpatterns = arity
* if not is_shadow_path: # <<<<<<<<<<<<<<
* num_subpatterns = num_subpatterns + 1
* if len(phrase)+1 < self.max_length and arity < self.max_nonterminals and num_subpatterns < self.max_chunks:
*/
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_20 = (!__pyx_t_8);
- if (__pyx_t_20) {
+ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_is_shadow_path); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = (!__pyx_t_9);
+ if (__pyx_t_21) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1163
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1168
* num_subpatterns = arity
* if not is_shadow_path:
* num_subpatterns = num_subpatterns + 1 # <<<<<<<<<<<<<<
@@ -50241,30 +50401,30 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
}
__pyx_L65:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1164
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1169
* if not is_shadow_path:
* num_subpatterns = num_subpatterns + 1
* if len(phrase)+1 < self.max_length and arity < self.max_nonterminals and num_subpatterns < self.max_chunks: # <<<<<<<<<<<<<<
* xcat = sym_setindex(self.category, arity+1)
* xnode = node.children[xcat]
*/
- __pyx_t_23 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_20 = ((__pyx_t_23 + 1) < __pyx_cur_scope->__pyx_v_self->max_length);
- if (__pyx_t_20) {
- __pyx_t_8 = (__pyx_cur_scope->__pyx_v_arity < __pyx_cur_scope->__pyx_v_self->max_nonterminals);
- if (__pyx_t_8) {
+ __pyx_t_23 = PyObject_Length(__pyx_cur_scope->__pyx_v_phrase); if (unlikely(__pyx_t_23 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = ((__pyx_t_23 + 1) < __pyx_cur_scope->__pyx_v_self->max_length);
+ if (__pyx_t_21) {
+ __pyx_t_9 = (__pyx_cur_scope->__pyx_v_arity < __pyx_cur_scope->__pyx_v_self->max_nonterminals);
+ if (__pyx_t_9) {
__pyx_t_28 = (__pyx_cur_scope->__pyx_v_num_subpatterns < __pyx_cur_scope->__pyx_v_self->max_chunks);
__pyx_t_27 = __pyx_t_28;
} else {
- __pyx_t_27 = __pyx_t_8;
+ __pyx_t_27 = __pyx_t_9;
}
- __pyx_t_8 = __pyx_t_27;
+ __pyx_t_9 = __pyx_t_27;
} else {
- __pyx_t_8 = __pyx_t_20;
+ __pyx_t_9 = __pyx_t_21;
}
- if (__pyx_t_8) {
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1165
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1170
* num_subpatterns = num_subpatterns + 1
* if len(phrase)+1 < self.max_length and arity < self.max_nonterminals and num_subpatterns < self.max_chunks:
* xcat = sym_setindex(self.category, arity+1) # <<<<<<<<<<<<<<
@@ -50273,159 +50433,159 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
*/
__pyx_cur_scope->__pyx_v_xcat = __pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, (__pyx_cur_scope->__pyx_v_arity + 1));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1166
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1171
* if len(phrase)+1 < self.max_length and arity < self.max_nonterminals and num_subpatterns < self.max_chunks:
* xcat = sym_setindex(self.category, arity+1)
* xnode = node.children[xcat] # <<<<<<<<<<<<<<
* # I put spanlen=1 below
* key = tuple([self.min_gap_size, i, 1, pathlen])
*/
- __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_9, __pyx_cur_scope->__pyx_v_xcat, sizeof(int), PyInt_FromLong); if (!__pyx_t_14) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_17 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_node, __pyx_n_s__children); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_17, __pyx_cur_scope->__pyx_v_xcat, sizeof(int), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_xnode);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_xnode);
- __Pyx_GIVEREF(__pyx_t_14);
- __pyx_cur_scope->__pyx_v_xnode = __pyx_t_14;
- __pyx_t_14 = 0;
+ __Pyx_GIVEREF(__pyx_t_15);
+ __pyx_cur_scope->__pyx_v_xnode = __pyx_t_15;
+ __pyx_t_15 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1168
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1173
* xnode = node.children[xcat]
* # I put spanlen=1 below
* key = tuple([self.min_gap_size, i, 1, pathlen]) # <<<<<<<<<<<<<<
* frontier_nodes = []
* if (key in nodes_isteps_away_buffer):
*/
- __pyx_t_14 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- __pyx_t_9 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_11 = PyList_New(4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- PyList_SET_ITEM(__pyx_t_11, 0, __pyx_t_14);
- __Pyx_GIVEREF(__pyx_t_14);
- PyList_SET_ITEM(__pyx_t_11, 1, __pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_9);
+ __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_15);
+ __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_10 = PyList_New(4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_15);
+ PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_17);
+ __Pyx_GIVEREF(__pyx_t_17);
__Pyx_INCREF(__pyx_int_1);
- PyList_SET_ITEM(__pyx_t_11, 2, __pyx_int_1);
+ PyList_SET_ITEM(__pyx_t_10, 2, __pyx_int_1);
__Pyx_GIVEREF(__pyx_int_1);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_pathlen);
- PyList_SET_ITEM(__pyx_t_11, 3, __pyx_cur_scope->__pyx_v_pathlen);
+ PyList_SET_ITEM(__pyx_t_10, 3, __pyx_cur_scope->__pyx_v_pathlen);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_pathlen);
- __pyx_t_14 = 0;
- __pyx_t_9 = 0;
- __pyx_t_9 = ((PyObject *)PyList_AsTuple(__pyx_t_11)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_9));
- __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
+ __pyx_t_15 = 0;
+ __pyx_t_17 = 0;
+ __pyx_t_17 = ((PyObject *)PyList_AsTuple(__pyx_t_10)); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(((PyObject *)__pyx_t_17));
+ __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_key));
__Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_key));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
- __pyx_cur_scope->__pyx_v_key = __pyx_t_9;
- __pyx_t_9 = 0;
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_17));
+ __pyx_cur_scope->__pyx_v_key = __pyx_t_17;
+ __pyx_t_17 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1169
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1174
* # I put spanlen=1 below
* key = tuple([self.min_gap_size, i, 1, pathlen])
* frontier_nodes = [] # <<<<<<<<<<<<<<
* if (key in nodes_isteps_away_buffer):
* frontier_nodes = nodes_isteps_away_buffer[key]
*/
- __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_17 = PyList_New(0); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_frontier_nodes);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_frontier_nodes);
- __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
- __pyx_cur_scope->__pyx_v_frontier_nodes = ((PyObject *)__pyx_t_9);
- __pyx_t_9 = 0;
+ __Pyx_GIVEREF(((PyObject *)__pyx_t_17));
+ __pyx_cur_scope->__pyx_v_frontier_nodes = ((PyObject *)__pyx_t_17);
+ __pyx_t_17 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1170
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1175
* key = tuple([self.min_gap_size, i, 1, pathlen])
* frontier_nodes = []
* if (key in nodes_isteps_away_buffer): # <<<<<<<<<<<<<<
* frontier_nodes = nodes_isteps_away_buffer[key]
* else:
*/
- __pyx_t_8 = (__Pyx_PyDict_Contains(((PyObject *)__pyx_cur_scope->__pyx_v_key), ((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), Py_EQ)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__pyx_t_8) {
+ __pyx_t_9 = (__Pyx_PyDict_Contains(((PyObject *)__pyx_cur_scope->__pyx_v_key), ((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1171
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1176
* frontier_nodes = []
* if (key in nodes_isteps_away_buffer):
* frontier_nodes = nodes_isteps_away_buffer[key] # <<<<<<<<<<<<<<
* else:
* frontier_nodes = self.get_all_nodes_isteps_away(self.min_gap_size, i, 1, pathlen, fwords, next_states, reachable_buffer)
*/
- __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), ((PyObject *)__pyx_cur_scope->__pyx_v_key)); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_17 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), ((PyObject *)__pyx_cur_scope->__pyx_v_key)); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_frontier_nodes);
__Pyx_DECREF(__pyx_cur_scope->__pyx_v_frontier_nodes);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_cur_scope->__pyx_v_frontier_nodes = __pyx_t_9;
- __pyx_t_9 = 0;
+ __Pyx_GIVEREF(__pyx_t_17);
+ __pyx_cur_scope->__pyx_v_frontier_nodes = __pyx_t_17;
+ __pyx_t_17 = 0;
goto __pyx_L67;
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1173
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1178
* frontier_nodes = nodes_isteps_away_buffer[key]
* else:
* frontier_nodes = self.get_all_nodes_isteps_away(self.min_gap_size, i, 1, pathlen, fwords, next_states, reachable_buffer) # <<<<<<<<<<<<<<
* nodes_isteps_away_buffer[key] = frontier_nodes
*
*/
- __pyx_t_9 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_123); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_14 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- __pyx_t_10 = PyTuple_New(7); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_123); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->min_gap_size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_14);
- __Pyx_GIVEREF(__pyx_t_14);
+ __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_15);
+ __pyx_t_11 = PyTuple_New(7); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_11);
+ PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_15);
__Pyx_INCREF(__pyx_int_1);
- PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_int_1);
+ PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_int_1);
__Pyx_GIVEREF(__pyx_int_1);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_pathlen);
- PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_cur_scope->__pyx_v_pathlen);
+ PyTuple_SET_ITEM(__pyx_t_11, 3, __pyx_cur_scope->__pyx_v_pathlen);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_pathlen);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_fwords);
- PyTuple_SET_ITEM(__pyx_t_10, 4, __pyx_cur_scope->__pyx_v_fwords);
+ PyTuple_SET_ITEM(__pyx_t_11, 4, __pyx_cur_scope->__pyx_v_fwords);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fwords);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_next_states));
- PyTuple_SET_ITEM(__pyx_t_10, 5, ((PyObject *)__pyx_cur_scope->__pyx_v_next_states));
+ PyTuple_SET_ITEM(__pyx_t_11, 5, ((PyObject *)__pyx_cur_scope->__pyx_v_next_states));
__Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_next_states));
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_reachable_buffer));
- PyTuple_SET_ITEM(__pyx_t_10, 6, ((PyObject *)__pyx_cur_scope->__pyx_v_reachable_buffer));
+ PyTuple_SET_ITEM(__pyx_t_11, 6, ((PyObject *)__pyx_cur_scope->__pyx_v_reachable_buffer));
__Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_reachable_buffer));
- __pyx_t_11 = 0;
- __pyx_t_14 = 0;
- __pyx_t_14 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
+ __pyx_t_10 = 0;
+ __pyx_t_15 = 0;
+ __pyx_t_15 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_frontier_nodes);
__Pyx_DECREF(__pyx_cur_scope->__pyx_v_frontier_nodes);
- __Pyx_GIVEREF(__pyx_t_14);
- __pyx_cur_scope->__pyx_v_frontier_nodes = __pyx_t_14;
- __pyx_t_14 = 0;
+ __Pyx_GIVEREF(__pyx_t_15);
+ __pyx_cur_scope->__pyx_v_frontier_nodes = __pyx_t_15;
+ __pyx_t_15 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1174
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1179
* else:
* frontier_nodes = self.get_all_nodes_isteps_away(self.min_gap_size, i, 1, pathlen, fwords, next_states, reachable_buffer)
* nodes_isteps_away_buffer[key] = frontier_nodes # <<<<<<<<<<<<<<
*
* for (i, alt, pathlen) in frontier_nodes:
*/
- if (PyDict_SetItem(((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), ((PyObject *)__pyx_cur_scope->__pyx_v_key), __pyx_cur_scope->__pyx_v_frontier_nodes) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(((PyObject *)__pyx_cur_scope->__pyx_v_nodes_isteps_away_buffer), ((PyObject *)__pyx_cur_scope->__pyx_v_key), __pyx_cur_scope->__pyx_v_frontier_nodes) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_L67:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1176
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1181
* nodes_isteps_away_buffer[key] = frontier_nodes
*
* for (i, alt, pathlen) in frontier_nodes: # <<<<<<<<<<<<<<
@@ -50433,41 +50593,41 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
* frontier = new_frontier
*/
if (PyList_CheckExact(__pyx_cur_scope->__pyx_v_frontier_nodes) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_v_frontier_nodes)) {
- __pyx_t_14 = __pyx_cur_scope->__pyx_v_frontier_nodes; __Pyx_INCREF(__pyx_t_14); __pyx_t_23 = 0;
- __pyx_t_21 = NULL;
+ __pyx_t_15 = __pyx_cur_scope->__pyx_v_frontier_nodes; __Pyx_INCREF(__pyx_t_15); __pyx_t_23 = 0;
+ __pyx_t_22 = NULL;
} else {
- __pyx_t_23 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_frontier_nodes); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- __pyx_t_21 = Py_TYPE(__pyx_t_14)->tp_iternext;
+ __pyx_t_23 = -1; __pyx_t_15 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_frontier_nodes); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_15);
+ __pyx_t_22 = Py_TYPE(__pyx_t_15)->tp_iternext;
}
for (;;) {
- if (!__pyx_t_21 && PyList_CheckExact(__pyx_t_14)) {
- if (__pyx_t_23 >= PyList_GET_SIZE(__pyx_t_14)) break;
+ if (!__pyx_t_22 && PyList_CheckExact(__pyx_t_15)) {
+ if (__pyx_t_23 >= PyList_GET_SIZE(__pyx_t_15)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_10 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_23); __Pyx_INCREF(__pyx_t_10); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_23); __Pyx_INCREF(__pyx_t_11); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_10 = PySequence_ITEM(__pyx_t_14, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PySequence_ITEM(__pyx_t_15, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- } else if (!__pyx_t_21 && PyTuple_CheckExact(__pyx_t_14)) {
- if (__pyx_t_23 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
+ } else if (!__pyx_t_22 && PyTuple_CheckExact(__pyx_t_15)) {
+ if (__pyx_t_23 >= PyTuple_GET_SIZE(__pyx_t_15)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_23); __Pyx_INCREF(__pyx_t_10); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_23); __Pyx_INCREF(__pyx_t_11); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_10 = PySequence_ITEM(__pyx_t_14, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PySequence_ITEM(__pyx_t_15, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
- __pyx_t_10 = __pyx_t_21(__pyx_t_14);
- if (unlikely(!__pyx_t_10)) {
+ __pyx_t_11 = __pyx_t_22(__pyx_t_15);
+ if (unlikely(!__pyx_t_11)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
- __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_GOTREF(__pyx_t_11);
}
- if ((likely(PyTuple_CheckExact(__pyx_t_10))) || (PyList_CheckExact(__pyx_t_10))) {
- PyObject* sequence = __pyx_t_10;
+ if ((likely(PyTuple_CheckExact(__pyx_t_11))) || (PyList_CheckExact(__pyx_t_11))) {
+ PyObject* sequence = __pyx_t_11;
#if CYTHON_COMPILING_IN_CPYTHON
Py_ssize_t size = Py_SIZE(sequence);
#else
@@ -50476,126 +50636,126 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1);
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2);
+ __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1);
+ __pyx_t_12 = PyTuple_GET_ITEM(sequence, 2);
} else {
- __pyx_t_9 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_11 = PyList_GET_ITEM(sequence, 1);
- __pyx_t_3 = PyList_GET_ITEM(sequence, 2);
+ __pyx_t_17 = PyList_GET_ITEM(sequence, 0);
+ __pyx_t_10 = PyList_GET_ITEM(sequence, 1);
+ __pyx_t_12 = PyList_GET_ITEM(sequence, 2);
}
- __Pyx_INCREF(__pyx_t_9);
- __Pyx_INCREF(__pyx_t_11);
- __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_17);
+ __Pyx_INCREF(__pyx_t_10);
+ __Pyx_INCREF(__pyx_t_12);
#else
- __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_1 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_18 = Py_TYPE(__pyx_t_1)->tp_iternext;
- index = 0; __pyx_t_9 = __pyx_t_18(__pyx_t_1); if (unlikely(!__pyx_t_9)) goto __pyx_L70_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_9);
- index = 1; __pyx_t_11 = __pyx_t_18(__pyx_t_1); if (unlikely(!__pyx_t_11)) goto __pyx_L70_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_11);
- index = 2; __pyx_t_3 = __pyx_t_18(__pyx_t_1); if (unlikely(!__pyx_t_3)) goto __pyx_L70_unpacking_failed;
+ __pyx_t_3 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_18(__pyx_t_1), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_18 = NULL;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_19 = Py_TYPE(__pyx_t_3)->tp_iternext;
+ index = 0; __pyx_t_17 = __pyx_t_19(__pyx_t_3); if (unlikely(!__pyx_t_17)) goto __pyx_L70_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_17);
+ index = 1; __pyx_t_10 = __pyx_t_19(__pyx_t_3); if (unlikely(!__pyx_t_10)) goto __pyx_L70_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_10);
+ index = 2; __pyx_t_12 = __pyx_t_19(__pyx_t_3); if (unlikely(!__pyx_t_12)) goto __pyx_L70_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_12);
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_3), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = NULL;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L71_unpacking_done;
__pyx_L70_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_18 = NULL;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_19 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L71_unpacking_done:;
}
- __pyx_t_19 = __Pyx_PyInt_AsInt(__pyx_t_9); if (unlikely((__pyx_t_19 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_11); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_cur_scope->__pyx_v_i = __pyx_t_19;
- __pyx_cur_scope->__pyx_v_alt = __pyx_t_6;
+ __pyx_t_20 = __Pyx_PyInt_AsInt(__pyx_t_17); if (unlikely((__pyx_t_20 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_10); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_cur_scope->__pyx_v_i = __pyx_t_20;
+ __pyx_cur_scope->__pyx_v_alt = __pyx_t_7;
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_pathlen);
__Pyx_DECREF(__pyx_cur_scope->__pyx_v_pathlen);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_cur_scope->__pyx_v_pathlen = __pyx_t_3;
- __pyx_t_3 = 0;
+ __Pyx_GIVEREF(__pyx_t_12);
+ __pyx_cur_scope->__pyx_v_pathlen = __pyx_t_12;
+ __pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1177
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1182
*
* for (i, alt, pathlen) in frontier_nodes:
* new_frontier.append((k, i, input_match + (i,), alt, pathlen, xnode, phrase +(xcat,), is_shadow_path)) # <<<<<<<<<<<<<<
* frontier = new_frontier
*
*/
- __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_k); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_11);
- __pyx_t_11 = 0;
- __pyx_t_11 = PyNumber_Add(__pyx_cur_scope->__pyx_v_input_match, ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
- __pyx_t_9 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_1 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_xcat); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Add(__pyx_cur_scope->__pyx_v_phrase, ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
- __pyx_t_7 = PyTuple_New(8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10);
+ __pyx_t_12 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_12);
+ __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_17 = PyTuple_New(1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_10);
__Pyx_GIVEREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3);
+ __pyx_t_10 = 0;
+ __pyx_t_10 = PyNumber_Add(__pyx_cur_scope->__pyx_v_input_match, ((PyObject *)__pyx_t_17)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
+ __pyx_t_17 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_alt); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_3 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_xcat); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_11);
+ __pyx_t_3 = 0;
+ __pyx_t_3 = PyNumber_Add(__pyx_cur_scope->__pyx_v_phrase, ((PyObject *)__pyx_t_8)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
+ __pyx_t_8 = PyTuple_New(8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_11);
__Pyx_GIVEREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_12);
+ __Pyx_GIVEREF(__pyx_t_12);
+ PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_17);
+ __Pyx_GIVEREF(__pyx_t_17);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_pathlen);
- PyTuple_SET_ITEM(__pyx_t_7, 4, __pyx_cur_scope->__pyx_v_pathlen);
+ PyTuple_SET_ITEM(__pyx_t_8, 4, __pyx_cur_scope->__pyx_v_pathlen);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_pathlen);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_xnode);
- PyTuple_SET_ITEM(__pyx_t_7, 5, __pyx_cur_scope->__pyx_v_xnode);
+ PyTuple_SET_ITEM(__pyx_t_8, 5, __pyx_cur_scope->__pyx_v_xnode);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_xnode);
- PyTuple_SET_ITEM(__pyx_t_7, 6, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_8, 6, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_is_shadow_path);
- PyTuple_SET_ITEM(__pyx_t_7, 7, __pyx_cur_scope->__pyx_v_is_shadow_path);
+ PyTuple_SET_ITEM(__pyx_t_8, 7, __pyx_cur_scope->__pyx_v_is_shadow_path);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_is_shadow_path);
+ __pyx_t_11 = 0;
+ __pyx_t_12 = 0;
__pyx_t_10 = 0;
+ __pyx_t_17 = 0;
__pyx_t_3 = 0;
- __pyx_t_11 = 0;
- __pyx_t_9 = 0;
- __pyx_t_1 = 0;
- __pyx_t_12 = PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_7)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
+ __pyx_t_13 = PyList_Append(__pyx_cur_scope->__pyx_v_new_frontier, ((PyObject *)__pyx_t_8)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
}
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
goto __pyx_L66;
}
__pyx_L66:;
@@ -50604,9 +50764,9 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_L62:;
__pyx_L19_continue:;
}
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1178
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1183
* for (i, alt, pathlen) in frontier_nodes:
* new_frontier.append((k, i, input_match + (i,), alt, pathlen, xnode, phrase +(xcat,), is_shadow_path))
* frontier = new_frontier # <<<<<<<<<<<<<<
@@ -50620,7 +50780,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
__pyx_cur_scope->__pyx_v_frontier = __pyx_cur_scope->__pyx_v_new_frontier;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1181
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1186
*
* # Online rule extraction and scoring
* if self.online: # <<<<<<<<<<<<<<
@@ -50629,82 +50789,82 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
*/
if (__pyx_cur_scope->__pyx_v_self->online) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1182
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1187
* # Online rule extraction and scoring
* if self.online:
* f_syms = tuple(word[0][0] for word in fwords) # <<<<<<<<<<<<<<
* for (f, lex_i, lex_j) in self.get_f_phrases(f_syms):
* spanlen = (lex_j - lex_i) + 1
*/
- __pyx_t_13 = __pyx_pf_3_sa_23HieroCachingRuleFactory_5input_2genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __pyx_pf_3_sa_23HieroCachingRuleFactory_5input_2genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
- PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13);
- __Pyx_GIVEREF(__pyx_t_13);
- __pyx_t_13 = 0;
- __pyx_t_13 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
- __Pyx_GIVEREF(__pyx_t_13);
- __pyx_cur_scope->__pyx_v_f_syms = ((PyObject*)__pyx_t_13);
- __pyx_t_13 = 0;
+ __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_15);
+ PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14);
+ __Pyx_GIVEREF(__pyx_t_14);
+ __pyx_t_14 = 0;
+ __pyx_t_14 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
+ __Pyx_GIVEREF(__pyx_t_14);
+ __pyx_cur_scope->__pyx_v_f_syms = ((PyObject*)__pyx_t_14);
+ __pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1183
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1188
* if self.online:
* f_syms = tuple(word[0][0] for word in fwords)
* for (f, lex_i, lex_j) in self.get_f_phrases(f_syms): # <<<<<<<<<<<<<<
* spanlen = (lex_j - lex_i) + 1
* if not sym_isvar(f[0]):
*/
- __pyx_t_13 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_f_phrases); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_f_phrases); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_f_syms));
- PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_f_syms));
+ PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_cur_scope->__pyx_v_f_syms));
__Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_f_syms));
- __pyx_t_7 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
- if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) {
- __pyx_t_14 = __pyx_t_7; __Pyx_INCREF(__pyx_t_14); __pyx_t_2 = 0;
- __pyx_t_21 = NULL;
+ __pyx_t_8 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
+ if (PyList_CheckExact(__pyx_t_8) || PyTuple_CheckExact(__pyx_t_8)) {
+ __pyx_t_15 = __pyx_t_8; __Pyx_INCREF(__pyx_t_15); __pyx_t_2 = 0;
+ __pyx_t_22 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- __pyx_t_21 = Py_TYPE(__pyx_t_14)->tp_iternext;
+ __pyx_t_2 = -1; __pyx_t_15 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_15);
+ __pyx_t_22 = Py_TYPE(__pyx_t_15)->tp_iternext;
}
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
for (;;) {
- if (!__pyx_t_21 && PyList_CheckExact(__pyx_t_14)) {
- if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_14)) break;
+ if (!__pyx_t_22 && PyList_CheckExact(__pyx_t_15)) {
+ if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_15)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_7 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_2); __Pyx_INCREF(__pyx_t_8); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PySequence_ITEM(__pyx_t_15, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- } else if (!__pyx_t_21 && PyTuple_CheckExact(__pyx_t_14)) {
- if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
+ } else if (!__pyx_t_22 && PyTuple_CheckExact(__pyx_t_15)) {
+ if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_15)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_2); __Pyx_INCREF(__pyx_t_8); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PySequence_ITEM(__pyx_t_15, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
- __pyx_t_7 = __pyx_t_21(__pyx_t_14);
- if (unlikely(!__pyx_t_7)) {
+ __pyx_t_8 = __pyx_t_22(__pyx_t_15);
+ if (unlikely(!__pyx_t_8)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
- __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GOTREF(__pyx_t_8);
}
- if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
- PyObject* sequence = __pyx_t_7;
+ if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
+ PyObject* sequence = __pyx_t_8;
#if CYTHON_COMPILING_IN_CPYTHON
Py_ssize_t size = Py_SIZE(sequence);
#else
@@ -50713,389 +50873,389 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_13 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
- __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2);
+ __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
+ __pyx_t_17 = PyTuple_GET_ITEM(sequence, 2);
} else {
- __pyx_t_13 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_1 = PyList_GET_ITEM(sequence, 1);
- __pyx_t_9 = PyList_GET_ITEM(sequence, 2);
+ __pyx_t_14 = PyList_GET_ITEM(sequence, 0);
+ __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
+ __pyx_t_17 = PyList_GET_ITEM(sequence, 2);
}
- __Pyx_INCREF(__pyx_t_13);
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_t_9);
+ __Pyx_INCREF(__pyx_t_14);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_17);
#else
- __pyx_t_13 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_9 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_11 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_18 = Py_TYPE(__pyx_t_11)->tp_iternext;
- index = 0; __pyx_t_13 = __pyx_t_18(__pyx_t_11); if (unlikely(!__pyx_t_13)) goto __pyx_L75_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_13);
- index = 1; __pyx_t_1 = __pyx_t_18(__pyx_t_11); if (unlikely(!__pyx_t_1)) goto __pyx_L75_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_1);
- index = 2; __pyx_t_9 = __pyx_t_18(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L75_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_9);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_18(__pyx_t_11), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_18 = NULL;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_10 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_19 = Py_TYPE(__pyx_t_10)->tp_iternext;
+ index = 0; __pyx_t_14 = __pyx_t_19(__pyx_t_10); if (unlikely(!__pyx_t_14)) goto __pyx_L75_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_14);
+ index = 1; __pyx_t_3 = __pyx_t_19(__pyx_t_10); if (unlikely(!__pyx_t_3)) goto __pyx_L75_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_3);
+ index = 2; __pyx_t_17 = __pyx_t_19(__pyx_t_10); if (unlikely(!__pyx_t_17)) goto __pyx_L75_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_17);
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_19(__pyx_t_10), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = NULL;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L76_unpacking_done;
__pyx_L75_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_18 = NULL;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_19 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L76_unpacking_done:;
}
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_f);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_f);
- __Pyx_GIVEREF(__pyx_t_13);
- __pyx_cur_scope->__pyx_v_f = __pyx_t_13;
- __pyx_t_13 = 0;
+ __Pyx_GIVEREF(__pyx_t_14);
+ __pyx_cur_scope->__pyx_v_f = __pyx_t_14;
+ __pyx_t_14 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_lex_i);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_lex_i);
- __Pyx_GIVEREF(__pyx_t_1);
- __pyx_cur_scope->__pyx_v_lex_i = __pyx_t_1;
- __pyx_t_1 = 0;
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_cur_scope->__pyx_v_lex_i = __pyx_t_3;
+ __pyx_t_3 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_lex_j);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_lex_j);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_cur_scope->__pyx_v_lex_j = __pyx_t_9;
- __pyx_t_9 = 0;
+ __Pyx_GIVEREF(__pyx_t_17);
+ __pyx_cur_scope->__pyx_v_lex_j = __pyx_t_17;
+ __pyx_t_17 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1184
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1189
* f_syms = tuple(word[0][0] for word in fwords)
* for (f, lex_i, lex_j) in self.get_f_phrases(f_syms):
* spanlen = (lex_j - lex_i) + 1 # <<<<<<<<<<<<<<
* if not sym_isvar(f[0]):
* spanlen += 1
*/
- __pyx_t_7 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_lex_j, __pyx_cur_scope->__pyx_v_lex_i); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_9 = PyNumber_Add(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_8 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_lex_j, __pyx_cur_scope->__pyx_v_lex_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_17 = PyNumber_Add(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_spanlen);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_spanlen);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_cur_scope->__pyx_v_spanlen = __pyx_t_9;
- __pyx_t_9 = 0;
+ __Pyx_GIVEREF(__pyx_t_17);
+ __pyx_cur_scope->__pyx_v_spanlen = __pyx_t_17;
+ __pyx_t_17 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1185
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1190
* for (f, lex_i, lex_j) in self.get_f_phrases(f_syms):
* spanlen = (lex_j - lex_i) + 1
* if not sym_isvar(f[0]): # <<<<<<<<<<<<<<
* spanlen += 1
* if not sym_isvar(f[1]):
*/
- __pyx_t_9 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_f, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_9); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_8 = (!__pyx_f_3_sa_sym_isvar(__pyx_t_6));
- if (__pyx_t_8) {
+ __pyx_t_17 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_f, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_17); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __pyx_t_9 = (!__pyx_f_3_sa_sym_isvar(__pyx_t_7));
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1186
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1191
* spanlen = (lex_j - lex_i) + 1
* if not sym_isvar(f[0]):
* spanlen += 1 # <<<<<<<<<<<<<<
* if not sym_isvar(f[1]):
* spanlen += 1
*/
- __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_spanlen, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_17 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_spanlen, __pyx_int_1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_spanlen);
__Pyx_DECREF(__pyx_cur_scope->__pyx_v_spanlen);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_cur_scope->__pyx_v_spanlen = __pyx_t_9;
- __pyx_t_9 = 0;
+ __Pyx_GIVEREF(__pyx_t_17);
+ __pyx_cur_scope->__pyx_v_spanlen = __pyx_t_17;
+ __pyx_t_17 = 0;
goto __pyx_L77;
}
__pyx_L77:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1187
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1192
* if not sym_isvar(f[0]):
* spanlen += 1
* if not sym_isvar(f[1]): # <<<<<<<<<<<<<<
* spanlen += 1
* for e in self.phrases_fe.get(f, ()):
*/
- __pyx_t_9 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_f, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_t_9); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_8 = (!__pyx_f_3_sa_sym_isvar(__pyx_t_6));
- if (__pyx_t_8) {
+ __pyx_t_17 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_f, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_17) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_17); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __pyx_t_9 = (!__pyx_f_3_sa_sym_isvar(__pyx_t_7));
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1188
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1193
* spanlen += 1
* if not sym_isvar(f[1]):
* spanlen += 1 # <<<<<<<<<<<<<<
* for e in self.phrases_fe.get(f, ()):
* if (f, e) not in seen_phrases:
*/
- __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_spanlen, __pyx_int_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_17 = PyNumber_InPlaceAdd(__pyx_cur_scope->__pyx_v_spanlen, __pyx_int_1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
__Pyx_GOTREF(__pyx_cur_scope->__pyx_v_spanlen);
__Pyx_DECREF(__pyx_cur_scope->__pyx_v_spanlen);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_cur_scope->__pyx_v_spanlen = __pyx_t_9;
- __pyx_t_9 = 0;
+ __Pyx_GIVEREF(__pyx_t_17);
+ __pyx_cur_scope->__pyx_v_spanlen = __pyx_t_17;
+ __pyx_t_17 = 0;
goto __pyx_L78;
}
__pyx_L78:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1189
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1194
* if not sym_isvar(f[1]):
* spanlen += 1
* for e in self.phrases_fe.get(f, ()): # <<<<<<<<<<<<<<
* if (f, e) not in seen_phrases:
* # Don't add multiple instances of the same phrase here
*/
- __pyx_t_9 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->phrases_fe, __pyx_n_s__get); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_17 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_self->phrases_fe, __pyx_n_s__get); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_cur_scope->__pyx_v_f);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_f);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f);
__Pyx_INCREF(((PyObject *)__pyx_empty_tuple));
- PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_empty_tuple));
+ PyTuple_SET_ITEM(__pyx_t_8, 1, ((PyObject *)__pyx_empty_tuple));
__Pyx_GIVEREF(((PyObject *)__pyx_empty_tuple));
- __pyx_t_1 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
- if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
- __pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); __pyx_t_23 = 0;
+ __pyx_t_3 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
+ if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
+ __pyx_t_8 = __pyx_t_3; __Pyx_INCREF(__pyx_t_8); __pyx_t_23 = 0;
__pyx_t_29 = NULL;
} else {
- __pyx_t_23 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_29 = Py_TYPE(__pyx_t_7)->tp_iternext;
+ __pyx_t_23 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_29 = Py_TYPE(__pyx_t_8)->tp_iternext;
}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
for (;;) {
- if (!__pyx_t_29 && PyList_CheckExact(__pyx_t_7)) {
- if (__pyx_t_23 >= PyList_GET_SIZE(__pyx_t_7)) break;
+ if (!__pyx_t_29 && PyList_CheckExact(__pyx_t_8)) {
+ if (__pyx_t_23 >= PyList_GET_SIZE(__pyx_t_8)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_23); __Pyx_INCREF(__pyx_t_1); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_23); __Pyx_INCREF(__pyx_t_3); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
- } else if (!__pyx_t_29 && PyTuple_CheckExact(__pyx_t_7)) {
- if (__pyx_t_23 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
+ } else if (!__pyx_t_29 && PyTuple_CheckExact(__pyx_t_8)) {
+ if (__pyx_t_23 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_23); __Pyx_INCREF(__pyx_t_1); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_23); __Pyx_INCREF(__pyx_t_3); __pyx_t_23++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_23); __pyx_t_23++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
- __pyx_t_1 = __pyx_t_29(__pyx_t_7);
- if (unlikely(!__pyx_t_1)) {
+ __pyx_t_3 = __pyx_t_29(__pyx_t_8);
+ if (unlikely(!__pyx_t_3)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
- __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_t_3);
}
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_e);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_e);
- __Pyx_GIVEREF(__pyx_t_1);
- __pyx_cur_scope->__pyx_v_e = __pyx_t_1;
- __pyx_t_1 = 0;
+ __Pyx_GIVEREF(__pyx_t_3);
+ __pyx_cur_scope->__pyx_v_e = __pyx_t_3;
+ __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1190
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1195
* spanlen += 1
* for e in self.phrases_fe.get(f, ()):
* if (f, e) not in seen_phrases: # <<<<<<<<<<<<<<
* # Don't add multiple instances of the same phrase here
* seen_phrases.add((f, e))
*/
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_f);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_f);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_v_e);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_cur_scope->__pyx_v_e);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e);
- __pyx_t_8 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_cur_scope->__pyx_v_seen_phrases), Py_NE)); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- if (__pyx_t_8) {
+ __pyx_t_9 = (__Pyx_PySequence_Contains(((PyObject *)__pyx_t_3), ((PyObject *)__pyx_cur_scope->__pyx_v_seen_phrases), Py_NE)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1192
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1197
* if (f, e) not in seen_phrases:
* # Don't add multiple instances of the same phrase here
* seen_phrases.add((f, e)) # <<<<<<<<<<<<<<
* scores = self.scorer.score(FeatureContext(
* f, e, 0, 0, 0,
*/
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_f);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_f);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_v_e);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_cur_scope->__pyx_v_e);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e);
- __pyx_t_12 = PySet_Add(__pyx_cur_scope->__pyx_v_seen_phrases, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_12 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
+ __pyx_t_13 = PySet_Add(__pyx_cur_scope->__pyx_v_seen_phrases, ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1193
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1198
* # Don't add multiple instances of the same phrase here
* seen_phrases.add((f, e))
* scores = self.scorer.score(FeatureContext( # <<<<<<<<<<<<<<
* f, e, 0, 0, 0,
* spanlen, None, None,
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__FeatureContext); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__FeatureContext); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_3);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1198
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1203
* fwords, self.fda, self.eda,
* meta,
* self.online_ctx_lookup(f, e))) # <<<<<<<<<<<<<<
* alignment = self.phrases_al[f][e]
* yield Rule(self.category, f, e, scores, alignment)
*/
- __pyx_t_9 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__online_ctx_lookup); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_17 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__online_ctx_lookup); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
- PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_cur_scope->__pyx_v_f);
+ PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_cur_scope->__pyx_v_f);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e);
- PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_cur_scope->__pyx_v_e);
+ PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_cur_scope->__pyx_v_e);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e);
- __pyx_t_11 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
- __pyx_t_13 = PyTuple_New(13); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_10 = PyObject_Call(__pyx_t_17, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
+ __pyx_t_14 = PyTuple_New(13); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
- PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_cur_scope->__pyx_v_f);
+ PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_cur_scope->__pyx_v_f);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e);
- PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_cur_scope->__pyx_v_e);
+ PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_cur_scope->__pyx_v_e);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e);
__Pyx_INCREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_int_0);
+ PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_int_0);
__Pyx_GIVEREF(__pyx_int_0);
__Pyx_INCREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_13, 3, __pyx_int_0);
+ PyTuple_SET_ITEM(__pyx_t_14, 3, __pyx_int_0);
__Pyx_GIVEREF(__pyx_int_0);
__Pyx_INCREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_int_0);
+ PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_int_0);
__Pyx_GIVEREF(__pyx_int_0);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_spanlen);
- PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_cur_scope->__pyx_v_spanlen);
+ PyTuple_SET_ITEM(__pyx_t_14, 5, __pyx_cur_scope->__pyx_v_spanlen);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_spanlen);
__Pyx_INCREF(Py_None);
- PyTuple_SET_ITEM(__pyx_t_13, 6, Py_None);
+ PyTuple_SET_ITEM(__pyx_t_14, 6, Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_INCREF(Py_None);
- PyTuple_SET_ITEM(__pyx_t_13, 7, Py_None);
+ PyTuple_SET_ITEM(__pyx_t_14, 7, Py_None);
__Pyx_GIVEREF(Py_None);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_fwords);
- PyTuple_SET_ITEM(__pyx_t_13, 8, __pyx_cur_scope->__pyx_v_fwords);
+ PyTuple_SET_ITEM(__pyx_t_14, 8, __pyx_cur_scope->__pyx_v_fwords);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fwords);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->fda));
- PyTuple_SET_ITEM(__pyx_t_13, 9, ((PyObject *)__pyx_cur_scope->__pyx_v_self->fda));
+ PyTuple_SET_ITEM(__pyx_t_14, 9, ((PyObject *)__pyx_cur_scope->__pyx_v_self->fda));
__Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->fda));
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->eda));
- PyTuple_SET_ITEM(__pyx_t_13, 10, ((PyObject *)__pyx_cur_scope->__pyx_v_self->eda));
+ PyTuple_SET_ITEM(__pyx_t_14, 10, ((PyObject *)__pyx_cur_scope->__pyx_v_self->eda));
__Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self->eda));
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_meta);
- PyTuple_SET_ITEM(__pyx_t_13, 11, __pyx_cur_scope->__pyx_v_meta);
+ PyTuple_SET_ITEM(__pyx_t_14, 11, __pyx_cur_scope->__pyx_v_meta);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_meta);
- PyTuple_SET_ITEM(__pyx_t_13, 12, __pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_11);
- __pyx_t_11 = 0;
- __pyx_t_11 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
- __pyx_t_13 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_Scorer *)__pyx_cur_scope->__pyx_v_self->scorer->__pyx_vtab)->score(__pyx_cur_scope->__pyx_v_self->scorer, __pyx_t_11)); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ PyTuple_SET_ITEM(__pyx_t_14, 12, __pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_10);
+ __pyx_t_10 = 0;
+ __pyx_t_10 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
+ __pyx_t_14 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_Scorer *)__pyx_cur_scope->__pyx_v_self->scorer->__pyx_vtab)->score(__pyx_cur_scope->__pyx_v_self->scorer, __pyx_t_10)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_XGOTREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores));
__Pyx_XDECREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores));
- __Pyx_GIVEREF(__pyx_t_13);
- __pyx_cur_scope->__pyx_v_scores = ((struct __pyx_obj_3_sa_FeatureVector *)__pyx_t_13);
- __pyx_t_13 = 0;
+ __Pyx_GIVEREF(__pyx_t_14);
+ __pyx_cur_scope->__pyx_v_scores = ((struct __pyx_obj_3_sa_FeatureVector *)__pyx_t_14);
+ __pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1199
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1204
* meta,
* self.online_ctx_lookup(f, e)))
* alignment = self.phrases_al[f][e] # <<<<<<<<<<<<<<
* yield Rule(self.category, f, e, scores, alignment)
*
*/
- __pyx_t_13 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->phrases_al, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_11 = PyObject_GetItem(__pyx_t_13, __pyx_cur_scope->__pyx_v_e); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __pyx_t_14 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->phrases_al, __pyx_cur_scope->__pyx_v_f); if (!__pyx_t_14) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_10 = PyObject_GetItem(__pyx_t_14, __pyx_cur_scope->__pyx_v_e); if (!__pyx_t_10) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_alignment);
__Pyx_XDECREF(__pyx_cur_scope->__pyx_v_alignment);
- __Pyx_GIVEREF(__pyx_t_11);
- __pyx_cur_scope->__pyx_v_alignment = __pyx_t_11;
- __pyx_t_11 = 0;
+ __Pyx_GIVEREF(__pyx_t_10);
+ __pyx_cur_scope->__pyx_v_alignment = __pyx_t_10;
+ __pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1200
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1205
* self.online_ctx_lookup(f, e)))
* alignment = self.phrases_al[f][e]
* yield Rule(self.category, f, e, scores, alignment) # <<<<<<<<<<<<<<
*
* stop_time = monitor_cpu()
*/
- __pyx_t_11 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->category); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_13 = PyTuple_New(5); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_11);
+ __pyx_t_10 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->category); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_14 = PyTuple_New(5); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_10);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f);
- PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_cur_scope->__pyx_v_f);
+ PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_cur_scope->__pyx_v_f);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e);
- PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_cur_scope->__pyx_v_e);
+ PyTuple_SET_ITEM(__pyx_t_14, 2, __pyx_cur_scope->__pyx_v_e);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e);
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores));
- PyTuple_SET_ITEM(__pyx_t_13, 3, ((PyObject *)__pyx_cur_scope->__pyx_v_scores));
+ PyTuple_SET_ITEM(__pyx_t_14, 3, ((PyObject *)__pyx_cur_scope->__pyx_v_scores));
__Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_scores));
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_alignment);
- PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_cur_scope->__pyx_v_alignment);
+ PyTuple_SET_ITEM(__pyx_t_14, 4, __pyx_cur_scope->__pyx_v_alignment);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_alignment);
- __pyx_t_11 = 0;
- __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Rule)), ((PyObject *)__pyx_t_13), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(((PyObject *)__pyx_t_13)); __pyx_t_13 = 0;
- __pyx_r = __pyx_t_11;
- __pyx_t_11 = 0;
+ __pyx_t_10 = 0;
+ __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Rule)), ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
+ __pyx_r = __pyx_t_10;
+ __pyx_t_10 = 0;
__pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
- __Pyx_XGIVEREF(__pyx_t_7);
- __pyx_cur_scope->__pyx_t_1 = __pyx_t_7;
- __Pyx_XGIVEREF(__pyx_t_14);
- __pyx_cur_scope->__pyx_t_4 = __pyx_t_14;
- __pyx_cur_scope->__pyx_t_10 = __pyx_t_21;
- __pyx_cur_scope->__pyx_t_2 = __pyx_t_23;
+ __Pyx_XGIVEREF(__pyx_t_8);
+ __pyx_cur_scope->__pyx_t_3 = __pyx_t_8;
+ __Pyx_XGIVEREF(__pyx_t_15);
+ __pyx_cur_scope->__pyx_t_4 = __pyx_t_15;
+ __pyx_cur_scope->__pyx_t_10 = __pyx_t_22;
+ __pyx_cur_scope->__pyx_t_1 = __pyx_t_23;
__pyx_cur_scope->__pyx_t_11 = __pyx_t_29;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
@@ -51104,129 +51264,160 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
return __pyx_r;
__pyx_L82_resume_from_yield:;
__pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
- __pyx_t_7 = __pyx_cur_scope->__pyx_t_1;
- __pyx_cur_scope->__pyx_t_1 = 0;
- __Pyx_XGOTREF(__pyx_t_7);
- __pyx_t_14 = __pyx_cur_scope->__pyx_t_4;
+ __pyx_t_8 = __pyx_cur_scope->__pyx_t_3;
+ __pyx_cur_scope->__pyx_t_3 = 0;
+ __Pyx_XGOTREF(__pyx_t_8);
+ __pyx_t_15 = __pyx_cur_scope->__pyx_t_4;
__pyx_cur_scope->__pyx_t_4 = 0;
- __Pyx_XGOTREF(__pyx_t_14);
- __pyx_t_21 = __pyx_cur_scope->__pyx_t_10;
- __pyx_t_23 = __pyx_cur_scope->__pyx_t_2;
+ __Pyx_XGOTREF(__pyx_t_15);
+ __pyx_t_22 = __pyx_cur_scope->__pyx_t_10;
+ __pyx_t_23 = __pyx_cur_scope->__pyx_t_1;
__pyx_t_29 = __pyx_cur_scope->__pyx_t_11;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L81;
}
__pyx_L81:;
}
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
goto __pyx_L72;
}
__pyx_L72:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1202
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1207
* yield Rule(self.category, f, e, scores, alignment)
*
* stop_time = monitor_cpu() # <<<<<<<<<<<<<<
* logger.info("Total time for rule lookup, extraction, and scoring = %f seconds", (stop_time - start_time))
* gc.collect()
*/
- __pyx_t_14 = PyFloat_FromDouble(__pyx_f_3_sa_monitor_cpu()); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- __Pyx_GIVEREF(__pyx_t_14);
- __pyx_cur_scope->__pyx_v_stop_time = __pyx_t_14;
- __pyx_t_14 = 0;
+ __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__monitor_cpu); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_15);
+ __pyx_t_8 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GIVEREF(__pyx_t_8);
+ __pyx_cur_scope->__pyx_v_stop_time = __pyx_t_8;
+ __pyx_t_8 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1203
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1208
*
* stop_time = monitor_cpu()
* logger.info("Total time for rule lookup, extraction, and scoring = %f seconds", (stop_time - start_time)) # <<<<<<<<<<<<<<
* gc.collect()
* logger.info(" Extract time = %f seconds", self.extract_time)
*/
- __pyx_t_14 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- __pyx_t_7 = PyObject_GetAttr(__pyx_t_14, __pyx_n_s__info); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __pyx_t_14 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_start_time); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- __pyx_t_11 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_stop_time, __pyx_t_14); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_15 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_8 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_start_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_10 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_stop_time, __pyx_t_8); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_124));
- PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_kp_s_124));
+ PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_kp_s_124));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_124));
- PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_11);
- __pyx_t_11 = 0;
- __pyx_t_11 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_10);
+ __pyx_t_10 = 0;
+ __pyx_t_10 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1204
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1209
* stop_time = monitor_cpu()
* logger.info("Total time for rule lookup, extraction, and scoring = %f seconds", (stop_time - start_time))
* gc.collect() # <<<<<<<<<<<<<<
* logger.info(" Extract time = %f seconds", self.extract_time)
- *
+ * logger.info(" Intersect time = %f seconds", self.intersect_time)
*/
- __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__gc); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_14 = PyObject_GetAttr(__pyx_t_11, __pyx_n_s__collect); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__gc); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_8 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__collect); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1205
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1210
* logger.info("Total time for rule lookup, extraction, and scoring = %f seconds", (stop_time - start_time))
* gc.collect()
* logger.info(" Extract time = %f seconds", self.extract_time) # <<<<<<<<<<<<<<
- *
+ * logger.info(" Intersect time = %f seconds", self.intersect_time)
*
*/
- __pyx_t_11 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_14 = PyObject_GetAttr(__pyx_t_11, __pyx_n_s__info); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->extract_time); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_8 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->extract_time); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_125));
- PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_s_125));
+ PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_kp_s_125));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_125));
- PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_11);
- __pyx_t_11 = 0;
- __pyx_t_11 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_10);
+ __pyx_t_10 = 0;
+ __pyx_t_10 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1211
+ * gc.collect()
+ * logger.info(" Extract time = %f seconds", self.extract_time)
+ * logger.info(" Intersect time = %f seconds", self.intersect_time) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_10 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_15 = PyObject_GetAttr(__pyx_t_10, __pyx_n_s__info); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->intersect_time); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_126));
+ PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_kp_s_126));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_126));
+ PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_10);
+ __pyx_t_10 = 0;
+ __pyx_t_10 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
PyErr_SetNone(PyExc_StopIteration);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
- __Pyx_XDECREF(__pyx_t_13);
+ __Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_14);
__Pyx_XDECREF(__pyx_t_15);
__Pyx_XDECREF(__pyx_t_16);
__Pyx_XDECREF(__pyx_t_17);
+ __Pyx_XDECREF(__pyx_t_18);
__Pyx_AddTraceback("input", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_L0:;
__Pyx_XDECREF(__pyx_r);
@@ -51236,7 +51427,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_24generator4(__pyx_Gene
return NULL;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1208
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1214
*
*
* cdef int find_fixpoint(self, # <<<<<<<<<<<<<<
@@ -51266,7 +51457,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("find_fixpoint", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1223
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1229
* cdef int e_low_prev, e_high_prev, f_low_prev, f_high_prev, new_x, new_low_x, new_high_x
*
* e_low[0] = e_in_low # <<<<<<<<<<<<<<
@@ -51275,7 +51466,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
(__pyx_v_e_low[0]) = __pyx_v_e_in_low;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1224
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1230
*
* e_low[0] = e_in_low
* e_high[0] = e_in_high # <<<<<<<<<<<<<<
@@ -51284,19 +51475,19 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
(__pyx_v_e_high[0]) = __pyx_v_e_in_high;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1225
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1231
* e_low[0] = e_in_low
* e_high[0] = e_in_high
* self.find_projection(f_low, f_high, f_links_low, f_links_high, e_low, e_high) # <<<<<<<<<<<<<<
* if e_low[0] == -1:
* # low-priority corner case: if phrase w is unaligned,
*/
- __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_f_high); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, __pyx_v_f_low, __pyx_t_1, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_low, __pyx_v_e_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_f_high); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, __pyx_v_f_low, __pyx_t_1, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_low, __pyx_v_e_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1226
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1232
* e_high[0] = e_in_high
* self.find_projection(f_low, f_high, f_links_low, f_links_high, e_low, e_high)
* if e_low[0] == -1: # <<<<<<<<<<<<<<
@@ -51306,7 +51497,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_3 = ((__pyx_v_e_low[0]) == -1);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1232
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1238
* # rule X -> X_1 w X_2 / X_1 X_2. This is probably
* # not worth the bother, though.
* return 0 # <<<<<<<<<<<<<<
@@ -51318,7 +51509,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
goto __pyx_L3;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1233
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1239
* # not worth the bother, though.
* return 0
* elif e_in_low != -1 and e_low[0] != e_in_low: # <<<<<<<<<<<<<<
@@ -51334,7 +51525,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1234
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1240
* return 0
* elif e_in_low != -1 and e_low[0] != e_in_low:
* if e_in_low - e_low[0] < min_ex_size: # <<<<<<<<<<<<<<
@@ -51344,7 +51535,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_5 = ((__pyx_v_e_in_low - (__pyx_v_e_low[0])) < __pyx_v_min_ex_size);
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1235
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1241
* elif e_in_low != -1 and e_low[0] != e_in_low:
* if e_in_low - e_low[0] < min_ex_size:
* e_low[0] = e_in_low - min_ex_size # <<<<<<<<<<<<<<
@@ -51353,7 +51544,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
(__pyx_v_e_low[0]) = (__pyx_v_e_in_low - __pyx_v_min_ex_size);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1236
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1242
* if e_in_low - e_low[0] < min_ex_size:
* e_low[0] = e_in_low - min_ex_size
* if e_low[0] < 0: # <<<<<<<<<<<<<<
@@ -51363,7 +51554,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_5 = ((__pyx_v_e_low[0]) < 0);
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1237
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1243
* e_low[0] = e_in_low - min_ex_size
* if e_low[0] < 0:
* return 0 # <<<<<<<<<<<<<<
@@ -51382,7 +51573,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1239
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1245
* return 0
*
* if e_high[0] - e_low[0] > max_e_len: # <<<<<<<<<<<<<<
@@ -51392,7 +51583,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_5 = (((__pyx_v_e_high[0]) - (__pyx_v_e_low[0])) > __pyx_v_max_e_len);
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1240
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1246
*
* if e_high[0] - e_low[0] > max_e_len:
* return 0 # <<<<<<<<<<<<<<
@@ -51404,7 +51595,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
goto __pyx_L6;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1241
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1247
* if e_high[0] - e_low[0] > max_e_len:
* return 0
* elif e_in_high != -1 and e_high[0] != e_in_high: # <<<<<<<<<<<<<<
@@ -51420,7 +51611,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1242
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1248
* return 0
* elif e_in_high != -1 and e_high[0] != e_in_high:
* if e_high[0] - e_in_high < min_ex_size: # <<<<<<<<<<<<<<
@@ -51430,7 +51621,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_4 = (((__pyx_v_e_high[0]) - __pyx_v_e_in_high) < __pyx_v_min_ex_size);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1243
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1249
* elif e_in_high != -1 and e_high[0] != e_in_high:
* if e_high[0] - e_in_high < min_ex_size:
* e_high[0] = e_in_high + min_ex_size # <<<<<<<<<<<<<<
@@ -51439,7 +51630,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
(__pyx_v_e_high[0]) = (__pyx_v_e_in_high + __pyx_v_min_ex_size);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1244
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1250
* if e_high[0] - e_in_high < min_ex_size:
* e_high[0] = e_in_high + min_ex_size
* if e_high[0] > e_sent_len: # <<<<<<<<<<<<<<
@@ -51449,7 +51640,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_4 = ((__pyx_v_e_high[0]) > __pyx_v_e_sent_len);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1245
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1251
* e_high[0] = e_in_high + min_ex_size
* if e_high[0] > e_sent_len:
* return 0 # <<<<<<<<<<<<<<
@@ -51468,7 +51659,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L6:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1247
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1253
* return 0
*
* f_back_low[0] = -1 # <<<<<<<<<<<<<<
@@ -51477,7 +51668,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
(__pyx_v_f_back_low[0]) = -1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1248
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1254
*
* f_back_low[0] = -1
* f_back_high[0] = -1 # <<<<<<<<<<<<<<
@@ -51486,7 +51677,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
(__pyx_v_f_back_high[0]) = -1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1249
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1255
* f_back_low[0] = -1
* f_back_high[0] = -1
* f_low_prev = f_low # <<<<<<<<<<<<<<
@@ -51495,17 +51686,17 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_v_f_low_prev = __pyx_v_f_low;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1250
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1256
* f_back_high[0] = -1
* f_low_prev = f_low
* f_high_prev = f_high # <<<<<<<<<<<<<<
* new_x = 0
* new_low_x = 0
*/
- __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_f_high); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_f_high); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_f_high_prev = __pyx_t_1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1251
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1257
* f_low_prev = f_low
* f_high_prev = f_high
* new_x = 0 # <<<<<<<<<<<<<<
@@ -51514,7 +51705,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_v_new_x = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1252
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1258
* f_high_prev = f_high
* new_x = 0
* new_low_x = 0 # <<<<<<<<<<<<<<
@@ -51523,7 +51714,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_v_new_low_x = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1253
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1259
* new_x = 0
* new_low_x = 0
* new_high_x = 0 # <<<<<<<<<<<<<<
@@ -51532,7 +51723,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_v_new_high_x = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1255
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1261
* new_high_x = 0
*
* while True: # <<<<<<<<<<<<<<
@@ -51542,7 +51733,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
while (1) {
if (!1) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1257
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1263
* while True:
*
* if f_back_low[0] == -1: # <<<<<<<<<<<<<<
@@ -51552,45 +51743,45 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_4 = ((__pyx_v_f_back_low[0]) == -1);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1258
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1264
*
* if f_back_low[0] == -1:
* self.find_projection(e_low[0], e_high[0], e_links_low, e_links_high, f_back_low, f_back_high) # <<<<<<<<<<<<<<
* else:
* self.find_projection(e_low[0], e_low_prev, e_links_low, e_links_high, f_back_low, f_back_high)
*/
- __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, (__pyx_v_e_low[0]), (__pyx_v_e_high[0]), __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_f_back_low, __pyx_v_f_back_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, (__pyx_v_e_low[0]), (__pyx_v_e_high[0]), __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_f_back_low, __pyx_v_f_back_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
goto __pyx_L11;
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1260
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1266
* self.find_projection(e_low[0], e_high[0], e_links_low, e_links_high, f_back_low, f_back_high)
* else:
* self.find_projection(e_low[0], e_low_prev, e_links_low, e_links_high, f_back_low, f_back_high) # <<<<<<<<<<<<<<
* self.find_projection(e_high_prev, e_high[0], e_links_low, e_links_high, f_back_low, f_back_high)
*
*/
- __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, (__pyx_v_e_low[0]), __pyx_v_e_low_prev, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_f_back_low, __pyx_v_f_back_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, (__pyx_v_e_low[0]), __pyx_v_e_low_prev, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_f_back_low, __pyx_v_f_back_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1261
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1267
* else:
* self.find_projection(e_low[0], e_low_prev, e_links_low, e_links_high, f_back_low, f_back_high)
* self.find_projection(e_high_prev, e_high[0], e_links_low, e_links_high, f_back_low, f_back_high) # <<<<<<<<<<<<<<
*
* if f_back_low[0] > f_low:
*/
- __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, __pyx_v_e_high_prev, (__pyx_v_e_high[0]), __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_f_back_low, __pyx_v_f_back_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, __pyx_v_e_high_prev, (__pyx_v_e_high[0]), __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_f_back_low, __pyx_v_f_back_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
__pyx_L11:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1263
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1269
* self.find_projection(e_high_prev, e_high[0], e_links_low, e_links_high, f_back_low, f_back_high)
*
* if f_back_low[0] > f_low: # <<<<<<<<<<<<<<
@@ -51600,7 +51791,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_4 = ((__pyx_v_f_back_low[0]) > __pyx_v_f_low);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1264
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1270
*
* if f_back_low[0] > f_low:
* f_back_low[0] = f_low # <<<<<<<<<<<<<<
@@ -51612,35 +51803,35 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L12:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1266
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1272
* f_back_low[0] = f_low
*
* if f_back_high[0] < f_high: # <<<<<<<<<<<<<<
* f_back_high[0] = f_high
*
*/
- __pyx_t_2 = PyInt_FromLong((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_high, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_high, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1267
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1273
*
* if f_back_high[0] < f_high:
* f_back_high[0] = f_high # <<<<<<<<<<<<<<
*
* if f_back_low[0] == f_low_prev and f_back_high[0] == f_high_prev:
*/
- __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_f_high); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_f_high); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
(__pyx_v_f_back_high[0]) = __pyx_t_1;
goto __pyx_L13;
}
__pyx_L13:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1269
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1275
* f_back_high[0] = f_high
*
* if f_back_low[0] == f_low_prev and f_back_high[0] == f_high_prev: # <<<<<<<<<<<<<<
@@ -51656,7 +51847,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1270
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1276
*
* if f_back_low[0] == f_low_prev and f_back_high[0] == f_high_prev:
* return 1 # <<<<<<<<<<<<<<
@@ -51669,7 +51860,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L14:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1272
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1278
* return 1
*
* if allow_low_x == 0 and f_back_low[0] < f_low: # <<<<<<<<<<<<<<
@@ -51685,7 +51876,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1274
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1280
* if allow_low_x == 0 and f_back_low[0] < f_low:
* # FAIL: f phrase is not tight
* return 0 # <<<<<<<<<<<<<<
@@ -51698,7 +51889,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L15:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1276
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1282
* return 0
*
* if f_back_high[0] - f_back_low[0] > max_f_len: # <<<<<<<<<<<<<<
@@ -51708,7 +51899,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_5 = (((__pyx_v_f_back_high[0]) - (__pyx_v_f_back_low[0])) > __pyx_v_max_f_len);
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1278
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1284
* if f_back_high[0] - f_back_low[0] > max_f_len:
* # FAIL: f back projection is too wide
* return 0 # <<<<<<<<<<<<<<
@@ -51721,7 +51912,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L16:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1280
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1286
* return 0
*
* if allow_high_x == 0 and f_back_high[0] > f_high: # <<<<<<<<<<<<<<
@@ -51730,11 +51921,11 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_t_5 = (__pyx_v_allow_high_x == 0);
if (__pyx_t_5) {
- __pyx_t_6 = PyInt_FromLong((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyInt_FromLong((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_v_f_high, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_v_f_high, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_4 = __pyx_t_3;
} else {
@@ -51742,7 +51933,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1282
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1288
* if allow_high_x == 0 and f_back_high[0] > f_high:
* # FAIL: extension on high side not allowed
* return 0 # <<<<<<<<<<<<<<
@@ -51755,7 +51946,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L17:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1284
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1290
* return 0
*
* if f_low != f_back_low[0]: # <<<<<<<<<<<<<<
@@ -51765,7 +51956,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_4 = (__pyx_v_f_low != (__pyx_v_f_back_low[0]));
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1285
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1291
*
* if f_low != f_back_low[0]:
* if new_low_x == 0: # <<<<<<<<<<<<<<
@@ -51775,7 +51966,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_4 = (__pyx_v_new_low_x == 0);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1286
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1292
* if f_low != f_back_low[0]:
* if new_low_x == 0:
* if new_x >= max_new_x: # <<<<<<<<<<<<<<
@@ -51785,7 +51976,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_4 = (__pyx_v_new_x >= __pyx_v_max_new_x);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1288
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1294
* if new_x >= max_new_x:
* # FAIL: extension required on low side violates max # of gaps
* return 0 # <<<<<<<<<<<<<<
@@ -51798,7 +51989,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1290
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1296
* return 0
* else:
* new_x = new_x + 1 # <<<<<<<<<<<<<<
@@ -51807,7 +51998,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_v_new_x = (__pyx_v_new_x + 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1291
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1297
* else:
* new_x = new_x + 1
* new_low_x = 1 # <<<<<<<<<<<<<<
@@ -51821,7 +52012,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L19:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1292
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1298
* new_x = new_x + 1
* new_low_x = 1
* if f_low - f_back_low[0] < min_fx_size: # <<<<<<<<<<<<<<
@@ -51831,7 +52022,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_4 = ((__pyx_v_f_low - (__pyx_v_f_back_low[0])) < __pyx_v_min_fx_size);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1293
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1299
* new_low_x = 1
* if f_low - f_back_low[0] < min_fx_size:
* f_back_low[0] = f_low - min_fx_size # <<<<<<<<<<<<<<
@@ -51840,7 +52031,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
(__pyx_v_f_back_low[0]) = (__pyx_v_f_low - __pyx_v_min_fx_size);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1294
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1300
* if f_low - f_back_low[0] < min_fx_size:
* f_back_low[0] = f_low - min_fx_size
* if f_back_high[0] - f_back_low[0] > max_f_len: # <<<<<<<<<<<<<<
@@ -51850,7 +52041,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_4 = (((__pyx_v_f_back_high[0]) - (__pyx_v_f_back_low[0])) > __pyx_v_max_f_len);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1296
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1302
* if f_back_high[0] - f_back_low[0] > max_f_len:
* # FAIL: extension required on low side violates max initial length
* return 0 # <<<<<<<<<<<<<<
@@ -51863,7 +52054,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L22:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1297
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1303
* # FAIL: extension required on low side violates max initial length
* return 0
* if f_back_low[0] < 0: # <<<<<<<<<<<<<<
@@ -51873,7 +52064,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_4 = ((__pyx_v_f_back_low[0]) < 0);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1299
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1305
* if f_back_low[0] < 0:
* # FAIL: extension required on low side violates sentence boundary
* return 0 # <<<<<<<<<<<<<<
@@ -51892,22 +52083,22 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L18:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1301
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1307
* return 0
*
* if f_high != f_back_high[0]: # <<<<<<<<<<<<<<
* if new_high_x == 0:
* if new_x >= max_new_x:
*/
- __pyx_t_2 = PyInt_FromLong((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = PyObject_RichCompare(__pyx_v_f_high, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_RichCompare(__pyx_v_f_high, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1302
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1308
*
* if f_high != f_back_high[0]:
* if new_high_x == 0: # <<<<<<<<<<<<<<
@@ -51917,7 +52108,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_4 = (__pyx_v_new_high_x == 0);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1303
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1309
* if f_high != f_back_high[0]:
* if new_high_x == 0:
* if new_x >= max_new_x: # <<<<<<<<<<<<<<
@@ -51927,7 +52118,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_4 = (__pyx_v_new_x >= __pyx_v_max_new_x);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1305
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1311
* if new_x >= max_new_x:
* # FAIL: extension required on high side violates max # of gaps
* return 0 # <<<<<<<<<<<<<<
@@ -51940,7 +52131,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1307
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1313
* return 0
* else:
* new_x = new_x + 1 # <<<<<<<<<<<<<<
@@ -51949,7 +52140,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_v_new_x = (__pyx_v_new_x + 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1308
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1314
* else:
* new_x = new_x + 1
* new_high_x = 1 # <<<<<<<<<<<<<<
@@ -51963,44 +52154,44 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L25:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1309
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1315
* new_x = new_x + 1
* new_high_x = 1
* if f_back_high[0] - f_high < min_fx_size: # <<<<<<<<<<<<<<
* f_back_high[0] = f_high + min_fx_size
* if f_back_high[0] - f_back_low[0] > max_f_len:
*/
- __pyx_t_6 = PyInt_FromLong((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyInt_FromLong((__pyx_v_f_back_high[0])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = PyNumber_Subtract(__pyx_t_6, __pyx_v_f_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Subtract(__pyx_t_6, __pyx_v_f_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyInt_FromLong(__pyx_v_min_fx_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyInt_FromLong(__pyx_v_min_fx_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1310
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1316
* new_high_x = 1
* if f_back_high[0] - f_high < min_fx_size:
* f_back_high[0] = f_high + min_fx_size # <<<<<<<<<<<<<<
* if f_back_high[0] - f_back_low[0] > max_f_len:
* # FAIL: extension required on high side violates max initial length
*/
- __pyx_t_7 = PyInt_FromLong(__pyx_v_min_fx_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyInt_FromLong(__pyx_v_min_fx_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = PyNumber_Add(__pyx_v_f_high, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Add(__pyx_v_f_high, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
(__pyx_v_f_back_high[0]) = __pyx_t_1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1311
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1317
* if f_back_high[0] - f_high < min_fx_size:
* f_back_high[0] = f_high + min_fx_size
* if f_back_high[0] - f_back_low[0] > max_f_len: # <<<<<<<<<<<<<<
@@ -52010,7 +52201,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_4 = (((__pyx_v_f_back_high[0]) - (__pyx_v_f_back_low[0])) > __pyx_v_max_f_len);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1313
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1319
* if f_back_high[0] - f_back_low[0] > max_f_len:
* # FAIL: extension required on high side violates max initial length
* return 0 # <<<<<<<<<<<<<<
@@ -52023,7 +52214,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L28:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1314
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1320
* # FAIL: extension required on high side violates max initial length
* return 0
* if f_back_high[0] > f_sent_len: # <<<<<<<<<<<<<<
@@ -52033,7 +52224,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_4 = ((__pyx_v_f_back_high[0]) > __pyx_v_f_sent_len);
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1316
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1322
* if f_back_high[0] > f_sent_len:
* # FAIL: extension required on high side violates sentence boundary
* return 0 # <<<<<<<<<<<<<<
@@ -52052,7 +52243,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L24:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1318
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1324
* return 0
*
* e_low_prev = e_low[0] # <<<<<<<<<<<<<<
@@ -52061,7 +52252,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_v_e_low_prev = (__pyx_v_e_low[0]);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1319
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1325
*
* e_low_prev = e_low[0]
* e_high_prev = e_high[0] # <<<<<<<<<<<<<<
@@ -52070,29 +52261,29 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_v_e_high_prev = (__pyx_v_e_high[0]);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1321
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1327
* e_high_prev = e_high[0]
*
* self.find_projection(f_back_low[0], f_low_prev, f_links_low, f_links_high, e_low, e_high) # <<<<<<<<<<<<<<
* self.find_projection(f_high_prev, f_back_high[0], f_links_low, f_links_high, e_low, e_high)
* if e_low[0] == e_low_prev and e_high[0] == e_high_prev:
*/
- __pyx_t_6 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, (__pyx_v_f_back_low[0]), __pyx_v_f_low_prev, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_low, __pyx_v_e_high); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, (__pyx_v_f_back_low[0]), __pyx_v_f_low_prev, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_low, __pyx_v_e_high); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1322
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1328
*
* self.find_projection(f_back_low[0], f_low_prev, f_links_low, f_links_high, e_low, e_high)
* self.find_projection(f_high_prev, f_back_high[0], f_links_low, f_links_high, e_low, e_high) # <<<<<<<<<<<<<<
* if e_low[0] == e_low_prev and e_high[0] == e_high_prev:
* return 1
*/
- __pyx_t_6 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, __pyx_v_f_high_prev, (__pyx_v_f_back_high[0]), __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_low, __pyx_v_e_high); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_projection(__pyx_v_self, __pyx_v_f_high_prev, (__pyx_v_f_back_high[0]), __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_low, __pyx_v_e_high); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1323
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1329
* self.find_projection(f_back_low[0], f_low_prev, f_links_low, f_links_high, e_low, e_high)
* self.find_projection(f_high_prev, f_back_high[0], f_links_low, f_links_high, e_low, e_high)
* if e_low[0] == e_low_prev and e_high[0] == e_high_prev: # <<<<<<<<<<<<<<
@@ -52108,7 +52299,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1324
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1330
* self.find_projection(f_high_prev, f_back_high[0], f_links_low, f_links_high, e_low, e_high)
* if e_low[0] == e_low_prev and e_high[0] == e_high_prev:
* return 1 # <<<<<<<<<<<<<<
@@ -52121,7 +52312,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L30:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1325
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1331
* if e_low[0] == e_low_prev and e_high[0] == e_high_prev:
* return 1
* if allow_arbitrary_x == 0: # <<<<<<<<<<<<<<
@@ -52131,7 +52322,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_3 = (__pyx_v_allow_arbitrary_x == 0);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1327
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1333
* if allow_arbitrary_x == 0:
* # FAIL: arbitrary expansion not permitted
* return 0 # <<<<<<<<<<<<<<
@@ -52144,7 +52335,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L31:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1328
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1334
* # FAIL: arbitrary expansion not permitted
* return 0
* if e_high[0] - e_low[0] > max_e_len: # <<<<<<<<<<<<<<
@@ -52154,7 +52345,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
__pyx_t_3 = (((__pyx_v_e_high[0]) - (__pyx_v_e_low[0])) > __pyx_v_max_e_len);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1330
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1336
* if e_high[0] - e_low[0] > max_e_len:
* # FAIL: re-projection violates sentence max phrase length
* return 0 # <<<<<<<<<<<<<<
@@ -52167,7 +52358,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
}
__pyx_L32:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1331
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1337
* # FAIL: re-projection violates sentence max phrase length
* return 0
* f_low_prev = f_back_low[0] # <<<<<<<<<<<<<<
@@ -52176,7 +52367,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
*/
__pyx_v_f_low_prev = (__pyx_v_f_back_low[0]);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1332
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1338
* return 0
* f_low_prev = f_back_low[0]
* f_high_prev = f_back_high[0] # <<<<<<<<<<<<<<
@@ -52199,7 +52390,7 @@ static int __pyx_f_3_sa_23HieroCachingRuleFactory_find_fixpoint(struct __pyx_obj
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1335
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1341
*
*
* cdef find_projection(self, int in_low, int in_high, int* in_links_low, int* in_links_high, # <<<<<<<<<<<<<<
@@ -52217,7 +52408,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U
int __pyx_t_4;
__Pyx_RefNannySetupContext("find_projection", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1338
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1344
* int* out_low, int* out_high):
* cdef int i
* for i from in_low <= i < in_high: # <<<<<<<<<<<<<<
@@ -52227,7 +52418,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U
__pyx_t_1 = __pyx_v_in_high;
for (__pyx_v_i = __pyx_v_in_low; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1339
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1345
* cdef int i
* for i from in_low <= i < in_high:
* if in_links_low[i] != -1: # <<<<<<<<<<<<<<
@@ -52237,7 +52428,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U
__pyx_t_2 = ((__pyx_v_in_links_low[__pyx_v_i]) != -1);
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1340
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1346
* for i from in_low <= i < in_high:
* if in_links_low[i] != -1:
* if out_low[0] == -1 or in_links_low[i] < out_low[0]: # <<<<<<<<<<<<<<
@@ -52253,7 +52444,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U
}
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1341
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1347
* if in_links_low[i] != -1:
* if out_low[0] == -1 or in_links_low[i] < out_low[0]:
* out_low[0] = in_links_low[i] # <<<<<<<<<<<<<<
@@ -52265,7 +52456,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U
}
__pyx_L6:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1342
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1348
* if out_low[0] == -1 or in_links_low[i] < out_low[0]:
* out_low[0] = in_links_low[i]
* if out_high[0] == -1 or in_links_high[i] > out_high[0]: # <<<<<<<<<<<<<<
@@ -52281,7 +52472,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U
}
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1343
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1349
* out_low[0] = in_links_low[i]
* if out_high[0] == -1 or in_links_high[i] > out_high[0]:
* out_high[0] = in_links_high[i] # <<<<<<<<<<<<<<
@@ -52303,7 +52494,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_find_projection(CYTHON_U
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1346
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1352
*
*
* cdef int* int_arr_extend(self, int* arr, int* arr_len, int* data, int data_len): # <<<<<<<<<<<<<<
@@ -52317,7 +52508,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("int_arr_extend", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1348
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1354
* cdef int* int_arr_extend(self, int* arr, int* arr_len, int* data, int data_len):
* cdef int new_len
* new_len = arr_len[0] + data_len # <<<<<<<<<<<<<<
@@ -52326,7 +52517,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED
*/
__pyx_v_new_len = ((__pyx_v_arr_len[0]) + __pyx_v_data_len);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1349
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1355
* cdef int new_len
* new_len = arr_len[0] + data_len
* arr = <int*> realloc(arr, new_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -52335,7 +52526,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED
*/
__pyx_v_arr = ((int *)realloc(__pyx_v_arr, (__pyx_v_new_len * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1350
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1356
* new_len = arr_len[0] + data_len
* arr = <int*> realloc(arr, new_len*sizeof(int))
* memcpy(arr+arr_len[0], data, data_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -52344,7 +52535,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED
*/
memcpy((__pyx_v_arr + (__pyx_v_arr_len[0])), __pyx_v_data, (__pyx_v_data_len * (sizeof(int))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1351
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1357
* arr = <int*> realloc(arr, new_len*sizeof(int))
* memcpy(arr+arr_len[0], data, data_len*sizeof(int))
* arr_len[0] = new_len # <<<<<<<<<<<<<<
@@ -52353,7 +52544,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED
*/
(__pyx_v_arr_len[0]) = __pyx_v_new_len;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1352
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1358
* memcpy(arr+arr_len[0], data, data_len*sizeof(int))
* arr_len[0] = new_len
* return arr # <<<<<<<<<<<<<<
@@ -52369,7 +52560,7 @@ static int *__pyx_f_3_sa_23HieroCachingRuleFactory_int_arr_extend(CYTHON_UNUSED
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1355
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1361
*
*
* cdef extract_phrases(self, int e_low, int e_high, int* e_gap_low, int* e_gap_high, int* e_links_low, int num_gaps, # <<<<<<<<<<<<<<
@@ -52415,19 +52606,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("extract_phrases", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1363
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1369
* cdef result
*
* result = [] # <<<<<<<<<<<<<<
* len1 = 0
* e_gaps1 = <int*> malloc(0)
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_result = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1364
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1370
*
* result = []
* len1 = 0 # <<<<<<<<<<<<<<
@@ -52436,7 +52627,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_len1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1365
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1371
* result = []
* len1 = 0
* e_gaps1 = <int*> malloc(0) # <<<<<<<<<<<<<<
@@ -52445,19 +52636,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_gaps1 = ((int *)malloc(0));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1366
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1372
* len1 = 0
* e_gaps1 = <int*> malloc(0)
* ephr_arr = IntList() # <<<<<<<<<<<<<<
*
* e_gap_order = <int*> malloc(num_gaps*sizeof(int))
*/
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ephr_arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1368
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1374
* ephr_arr = IntList()
*
* e_gap_order = <int*> malloc(num_gaps*sizeof(int)) # <<<<<<<<<<<<<<
@@ -52466,7 +52657,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_gap_order = ((int *)malloc((__pyx_v_num_gaps * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1369
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1375
*
* e_gap_order = <int*> malloc(num_gaps*sizeof(int))
* if num_gaps > 0: # <<<<<<<<<<<<<<
@@ -52476,7 +52667,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_2 = (__pyx_v_num_gaps > 0);
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1370
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1376
* e_gap_order = <int*> malloc(num_gaps*sizeof(int))
* if num_gaps > 0:
* e_gap_order[0] = 0 # <<<<<<<<<<<<<<
@@ -52485,7 +52676,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
(__pyx_v_e_gap_order[0]) = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1371
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1377
* if num_gaps > 0:
* e_gap_order[0] = 0
* for i from 1 <= i < num_gaps: # <<<<<<<<<<<<<<
@@ -52495,7 +52686,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_3 = __pyx_v_num_gaps;
for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1372
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1378
* e_gap_order[0] = 0
* for i from 1 <= i < num_gaps:
* for j from 0 <= j < i: # <<<<<<<<<<<<<<
@@ -52505,7 +52696,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_4 = __pyx_v_i;
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1373
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1379
* for i from 1 <= i < num_gaps:
* for j from 0 <= j < i:
* if e_gap_low[i] < e_gap_low[j]: # <<<<<<<<<<<<<<
@@ -52515,7 +52706,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_2 = ((__pyx_v_e_gap_low[__pyx_v_i]) < (__pyx_v_e_gap_low[__pyx_v_j]));
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1374
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1380
* for j from 0 <= j < i:
* if e_gap_low[i] < e_gap_low[j]:
* for k from j <= k < i: # <<<<<<<<<<<<<<
@@ -52525,7 +52716,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_5 = __pyx_v_i;
for (__pyx_v_k = __pyx_v_j; __pyx_v_k < __pyx_t_5; __pyx_v_k++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1375
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1381
* if e_gap_low[i] < e_gap_low[j]:
* for k from j <= k < i:
* e_gap_order[k+1] = e_gap_order[k] # <<<<<<<<<<<<<<
@@ -52535,7 +52726,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
(__pyx_v_e_gap_order[(__pyx_v_k + 1)]) = (__pyx_v_e_gap_order[__pyx_v_k]);
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1376
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1382
* for k from j <= k < i:
* e_gap_order[k+1] = e_gap_order[k]
* e_gap_order[j] = i # <<<<<<<<<<<<<<
@@ -52544,7 +52735,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
(__pyx_v_e_gap_order[__pyx_v_j]) = __pyx_v_i;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1377
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1383
* e_gap_order[k+1] = e_gap_order[k]
* e_gap_order[j] = i
* break # <<<<<<<<<<<<<<
@@ -52558,7 +52749,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1379
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1385
* break
* else:
* e_gap_order[i] = i # <<<<<<<<<<<<<<
@@ -52573,7 +52764,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1381
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1387
* e_gap_order[i] = i
*
* e_x_low = e_low # <<<<<<<<<<<<<<
@@ -52582,7 +52773,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_x_low = __pyx_v_e_low;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1382
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1388
*
* e_x_low = e_low
* e_x_high = e_high # <<<<<<<<<<<<<<
@@ -52591,7 +52782,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_x_high = __pyx_v_e_high;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1383
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1389
* e_x_low = e_low
* e_x_high = e_high
* if not self.tight_phrases: # <<<<<<<<<<<<<<
@@ -52601,7 +52792,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_2 = (!__pyx_v_self->tight_phrases);
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1384
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1390
* e_x_high = e_high
* if not self.tight_phrases:
* while e_x_low > 0 and e_high - e_x_low < self.train_max_initial_size and e_links_low[e_x_low-1] == -1: # <<<<<<<<<<<<<<
@@ -52624,7 +52815,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
if (!__pyx_t_6) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1385
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1391
* if not self.tight_phrases:
* while e_x_low > 0 and e_high - e_x_low < self.train_max_initial_size and e_links_low[e_x_low-1] == -1:
* e_x_low = e_x_low - 1 # <<<<<<<<<<<<<<
@@ -52634,7 +52825,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_v_e_x_low = (__pyx_v_e_x_low - 1);
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1386
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1392
* while e_x_low > 0 and e_high - e_x_low < self.train_max_initial_size and e_links_low[e_x_low-1] == -1:
* e_x_low = e_x_low - 1
* while e_x_high < e_sent_len and e_x_high - e_low < self.train_max_initial_size and e_links_low[e_x_high] == -1: # <<<<<<<<<<<<<<
@@ -52657,7 +52848,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
if (!__pyx_t_2) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1387
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1393
* e_x_low = e_x_low - 1
* while e_x_high < e_sent_len and e_x_high - e_low < self.train_max_initial_size and e_links_low[e_x_high] == -1:
* e_x_high = e_x_high + 1 # <<<<<<<<<<<<<<
@@ -52670,7 +52861,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
__pyx_L11:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1389
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1395
* e_x_high = e_x_high + 1
*
* for i from e_x_low <= i <= e_low: # <<<<<<<<<<<<<<
@@ -52680,7 +52871,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_3 = __pyx_v_e_low;
for (__pyx_v_i = __pyx_v_e_x_low; __pyx_v_i <= __pyx_t_3; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1390
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1396
*
* for i from e_x_low <= i <= e_low:
* e_gaps1 = self.int_arr_extend(e_gaps1, &len1, &i, 1) # <<<<<<<<<<<<<<
@@ -52690,7 +52881,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_v_e_gaps1 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps1, (&__pyx_v_len1), (&__pyx_v_i), 1);
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1392
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1398
* e_gaps1 = self.int_arr_extend(e_gaps1, &len1, &i, 1)
*
* for i from 0 <= i < num_gaps: # <<<<<<<<<<<<<<
@@ -52700,7 +52891,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_3 = __pyx_v_num_gaps;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1393
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1399
*
* for i from 0 <= i < num_gaps:
* e_gaps2 = <int*> malloc(0) # <<<<<<<<<<<<<<
@@ -52709,7 +52900,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_gaps2 = ((int *)malloc(0));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1394
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1400
* for i from 0 <= i < num_gaps:
* e_gaps2 = <int*> malloc(0)
* len2 = 0 # <<<<<<<<<<<<<<
@@ -52718,7 +52909,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_len2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1396
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1402
* len2 = 0
*
* j = e_gap_order[i] # <<<<<<<<<<<<<<
@@ -52727,7 +52918,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_j = (__pyx_v_e_gap_order[__pyx_v_i]);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1397
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1403
*
* j = e_gap_order[i]
* e_x_gap_low = e_gap_low[j] # <<<<<<<<<<<<<<
@@ -52736,7 +52927,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_x_gap_low = (__pyx_v_e_gap_low[__pyx_v_j]);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1398
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1404
* j = e_gap_order[i]
* e_x_gap_low = e_gap_low[j]
* e_x_gap_high = e_gap_high[j] # <<<<<<<<<<<<<<
@@ -52745,7 +52936,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_x_gap_high = (__pyx_v_e_gap_high[__pyx_v_j]);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1399
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1405
* e_x_gap_low = e_gap_low[j]
* e_x_gap_high = e_gap_high[j]
* if not self.tight_phrases: # <<<<<<<<<<<<<<
@@ -52755,7 +52946,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_2 = (!__pyx_v_self->tight_phrases);
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1400
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1406
* e_x_gap_high = e_gap_high[j]
* if not self.tight_phrases:
* while e_x_gap_low > e_x_low and e_links_low[e_x_gap_low-1] == -1: # <<<<<<<<<<<<<<
@@ -52772,7 +52963,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
if (!__pyx_t_7) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1401
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1407
* if not self.tight_phrases:
* while e_x_gap_low > e_x_low and e_links_low[e_x_gap_low-1] == -1:
* e_x_gap_low = e_x_gap_low - 1 # <<<<<<<<<<<<<<
@@ -52782,7 +52973,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_v_e_x_gap_low = (__pyx_v_e_x_gap_low - 1);
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1402
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1408
* while e_x_gap_low > e_x_low and e_links_low[e_x_gap_low-1] == -1:
* e_x_gap_low = e_x_gap_low - 1
* while e_x_gap_high < e_x_high and e_links_low[e_x_gap_high] == -1: # <<<<<<<<<<<<<<
@@ -52799,7 +52990,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
if (!__pyx_t_6) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1403
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1409
* e_x_gap_low = e_x_gap_low - 1
* while e_x_gap_high < e_x_high and e_links_low[e_x_gap_high] == -1:
* e_x_gap_high = e_x_gap_high + 1 # <<<<<<<<<<<<<<
@@ -52812,7 +53003,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
__pyx_L20:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1405
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1411
* e_x_gap_high = e_x_gap_high + 1
*
* k = 0 # <<<<<<<<<<<<<<
@@ -52821,7 +53012,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_k = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1406
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1412
*
* k = 0
* step = 1+(i*2) # <<<<<<<<<<<<<<
@@ -52830,7 +53021,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_step = (1 + (__pyx_v_i * 2));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1407
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1413
* k = 0
* step = 1+(i*2)
* while k < len1: # <<<<<<<<<<<<<<
@@ -52841,7 +53032,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_6 = (__pyx_v_k < __pyx_v_len1);
if (!__pyx_t_6) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1408
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1414
* step = 1+(i*2)
* while k < len1:
* for m from e_x_gap_low <= m <= e_gap_low[j]: # <<<<<<<<<<<<<<
@@ -52851,7 +53042,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_4 = (__pyx_v_e_gap_low[__pyx_v_j]);
for (__pyx_v_m = __pyx_v_e_x_gap_low; __pyx_v_m <= __pyx_t_4; __pyx_v_m++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1409
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1415
* while k < len1:
* for m from e_x_gap_low <= m <= e_gap_low[j]:
* if m >= e_gaps1[k+step-1]: # <<<<<<<<<<<<<<
@@ -52861,7 +53052,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_6 = (__pyx_v_m >= (__pyx_v_e_gaps1[((__pyx_v_k + __pyx_v_step) - 1)]));
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1410
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1416
* for m from e_x_gap_low <= m <= e_gap_low[j]:
* if m >= e_gaps1[k+step-1]:
* for n from e_gap_high[j] <= n <= e_x_gap_high: # <<<<<<<<<<<<<<
@@ -52871,7 +53062,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_5 = __pyx_v_e_x_gap_high;
for (__pyx_v_n = (__pyx_v_e_gap_high[__pyx_v_j]); __pyx_v_n <= __pyx_t_5; __pyx_v_n++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1411
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1417
* if m >= e_gaps1[k+step-1]:
* for n from e_gap_high[j] <= n <= e_x_gap_high:
* if n-m >= 1: # extractor.py doesn't restrict target-side gap length # <<<<<<<<<<<<<<
@@ -52881,7 +53072,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_6 = ((__pyx_v_n - __pyx_v_m) >= 1);
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1412
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1418
* for n from e_gap_high[j] <= n <= e_x_gap_high:
* if n-m >= 1: # extractor.py doesn't restrict target-side gap length
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, e_gaps1+k, step) # <<<<<<<<<<<<<<
@@ -52890,7 +53081,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps2, (&__pyx_v_len2), (__pyx_v_e_gaps1 + __pyx_v_k), __pyx_v_step);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1413
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1419
* if n-m >= 1: # extractor.py doesn't restrict target-side gap length
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, e_gaps1+k, step)
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &m, 1) # <<<<<<<<<<<<<<
@@ -52899,7 +53090,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps2, (&__pyx_v_len2), (&__pyx_v_m), 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1414
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1420
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, e_gaps1+k, step)
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &m, 1)
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &n, 1) # <<<<<<<<<<<<<<
@@ -52916,7 +53107,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_L29:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1415
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1421
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &m, 1)
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &n, 1)
* k = k + step # <<<<<<<<<<<<<<
@@ -52926,7 +53117,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_v_k = (__pyx_v_k + __pyx_v_step);
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1416
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1422
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &n, 1)
* k = k + step
* free(e_gaps1) # <<<<<<<<<<<<<<
@@ -52935,7 +53126,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
free(__pyx_v_e_gaps1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1417
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1423
* k = k + step
* free(e_gaps1)
* e_gaps1 = e_gaps2 # <<<<<<<<<<<<<<
@@ -52944,7 +53135,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_gaps1 = __pyx_v_e_gaps2;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1418
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1424
* free(e_gaps1)
* e_gaps1 = e_gaps2
* len1 = len2 # <<<<<<<<<<<<<<
@@ -52954,7 +53145,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_v_len1 = __pyx_v_len2;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1420
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1426
* len1 = len2
*
* step = 1+(num_gaps*2) # <<<<<<<<<<<<<<
@@ -52963,7 +53154,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_step = (1 + (__pyx_v_num_gaps * 2));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1421
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1427
*
* step = 1+(num_gaps*2)
* e_gaps2 = <int*> malloc(0) # <<<<<<<<<<<<<<
@@ -52972,7 +53163,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_gaps2 = ((int *)malloc(0));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1422
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1428
* step = 1+(num_gaps*2)
* e_gaps2 = <int*> malloc(0)
* len2 = 0 # <<<<<<<<<<<<<<
@@ -52981,7 +53172,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_len2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1423
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1429
* e_gaps2 = <int*> malloc(0)
* len2 = 0
* for i from e_high <= i <= e_x_high: # <<<<<<<<<<<<<<
@@ -52991,7 +53182,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_3 = __pyx_v_e_x_high;
for (__pyx_v_i = __pyx_v_e_high; __pyx_v_i <= __pyx_t_3; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1424
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1430
* len2 = 0
* for i from e_high <= i <= e_x_high:
* j = 0 # <<<<<<<<<<<<<<
@@ -53000,7 +53191,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_j = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1425
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1431
* for i from e_high <= i <= e_x_high:
* j = 0
* while j < len1: # <<<<<<<<<<<<<<
@@ -53011,7 +53202,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_6 = (__pyx_v_j < __pyx_v_len1);
if (!__pyx_t_6) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1426
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1432
* j = 0
* while j < len1:
* if i - e_gaps1[j] <= self.train_max_initial_size and i >= e_gaps1[j+step-1]: # <<<<<<<<<<<<<<
@@ -53027,7 +53218,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1427
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1433
* while j < len1:
* if i - e_gaps1[j] <= self.train_max_initial_size and i >= e_gaps1[j+step-1]:
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, e_gaps1+j, step) # <<<<<<<<<<<<<<
@@ -53036,7 +53227,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_gaps2 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->int_arr_extend(__pyx_v_self, __pyx_v_e_gaps2, (&__pyx_v_len2), (__pyx_v_e_gaps1 + __pyx_v_j), __pyx_v_step);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1428
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1434
* if i - e_gaps1[j] <= self.train_max_initial_size and i >= e_gaps1[j+step-1]:
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, e_gaps1+j, step)
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &i, 1) # <<<<<<<<<<<<<<
@@ -53048,7 +53239,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
__pyx_L37:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1429
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1435
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, e_gaps1+j, step)
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &i, 1)
* j = j + step # <<<<<<<<<<<<<<
@@ -53059,7 +53250,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1430
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1436
* e_gaps2 = self.int_arr_extend(e_gaps2, &len2, &i, 1)
* j = j + step
* free(e_gaps1) # <<<<<<<<<<<<<<
@@ -53068,7 +53259,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
free(__pyx_v_e_gaps1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1431
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1437
* j = j + step
* free(e_gaps1)
* e_gaps1 = e_gaps2 # <<<<<<<<<<<<<<
@@ -53077,7 +53268,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_e_gaps1 = __pyx_v_e_gaps2;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1432
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1438
* free(e_gaps1)
* e_gaps1 = e_gaps2
* len1 = len2 # <<<<<<<<<<<<<<
@@ -53086,7 +53277,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_len1 = __pyx_v_len2;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1434
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1440
* len1 = len2
*
* step = (num_gaps+1)*2 # <<<<<<<<<<<<<<
@@ -53095,7 +53286,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_step = ((__pyx_v_num_gaps + 1) * 2);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1435
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1441
*
* step = (num_gaps+1)*2
* i = 0 # <<<<<<<<<<<<<<
@@ -53104,7 +53295,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_i = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1437
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1443
* i = 0
*
* while i < len1: # <<<<<<<<<<<<<<
@@ -53115,7 +53306,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_2 = (__pyx_v_i < __pyx_v_len1);
if (!__pyx_t_2) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1438
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1444
*
* while i < len1:
* ephr_arr._clear() # <<<<<<<<<<<<<<
@@ -53124,7 +53315,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_ephr_arr->__pyx_vtab)->_clear(__pyx_v_ephr_arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1439
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1445
* while i < len1:
* ephr_arr._clear()
* num_chunks = 0 # <<<<<<<<<<<<<<
@@ -53133,20 +53324,20 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_num_chunks = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1440
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1446
* ephr_arr._clear()
* num_chunks = 0
* indexes = [] # <<<<<<<<<<<<<<
* for j from 0 <= j < num_gaps+1:
* if e_gaps1[i+2*j] < e_gaps1[i+(2*j)+1]:
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_XDECREF(((PyObject *)__pyx_v_indexes));
__pyx_v_indexes = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1441
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1447
* num_chunks = 0
* indexes = []
* for j from 0 <= j < num_gaps+1: # <<<<<<<<<<<<<<
@@ -53156,7 +53347,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_9 = (__pyx_v_num_gaps + 1);
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_9; __pyx_v_j++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1442
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1448
* indexes = []
* for j from 0 <= j < num_gaps+1:
* if e_gaps1[i+2*j] < e_gaps1[i+(2*j)+1]: # <<<<<<<<<<<<<<
@@ -53166,7 +53357,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_2 = ((__pyx_v_e_gaps1[(__pyx_v_i + (2 * __pyx_v_j))]) < (__pyx_v_e_gaps1[((__pyx_v_i + (2 * __pyx_v_j)) + 1)]));
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1443
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1449
* for j from 0 <= j < num_gaps+1:
* if e_gaps1[i+2*j] < e_gaps1[i+(2*j)+1]:
* num_chunks = num_chunks + 1 # <<<<<<<<<<<<<<
@@ -53178,7 +53369,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
__pyx_L42:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1444
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1450
* if e_gaps1[i+2*j] < e_gaps1[i+(2*j)+1]:
* num_chunks = num_chunks + 1
* for k from e_gaps1[i+2*j] <= k < e_gaps1[i+(2*j)+1]: # <<<<<<<<<<<<<<
@@ -53188,19 +53379,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_3 = (__pyx_v_e_gaps1[((__pyx_v_i + (2 * __pyx_v_j)) + 1)]);
for (__pyx_v_k = (__pyx_v_e_gaps1[(__pyx_v_i + (2 * __pyx_v_j))]); __pyx_v_k < __pyx_t_3; __pyx_v_k++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1445
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1451
* num_chunks = num_chunks + 1
* for k from e_gaps1[i+2*j] <= k < e_gaps1[i+(2*j)+1]:
* indexes.append(k) # <<<<<<<<<<<<<<
* ephr_arr._append(self.eid2symid[self.eda.data.arr[e_sent_start+k]])
* if j < num_gaps:
*/
- __pyx_t_1 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_10 = PyList_Append(__pyx_v_indexes, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyList_Append(__pyx_v_indexes, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1446
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1452
* for k from e_gaps1[i+2*j] <= k < e_gaps1[i+(2*j)+1]:
* indexes.append(k)
* ephr_arr._append(self.eid2symid[self.eda.data.arr[e_sent_start+k]]) # <<<<<<<<<<<<<<
@@ -53208,14 +53399,14 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
* indexes.append(sym_setindex(self.category, e_gap_order[j]+1))
*/
__pyx_t_4 = (__pyx_v_self->eda->data->arr[(__pyx_v_e_sent_start + __pyx_v_k)]);
- __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->eid2symid), __pyx_t_4, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->eid2symid), __pyx_t_4, sizeof(int), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_ephr_arr->__pyx_vtab)->_append(__pyx_v_ephr_arr, __pyx_t_4);
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1447
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1453
* indexes.append(k)
* ephr_arr._append(self.eid2symid[self.eda.data.arr[e_sent_start+k]])
* if j < num_gaps: # <<<<<<<<<<<<<<
@@ -53225,19 +53416,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_t_2 = (__pyx_v_j < __pyx_v_num_gaps);
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1448
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1454
* ephr_arr._append(self.eid2symid[self.eda.data.arr[e_sent_start+k]])
* if j < num_gaps:
* indexes.append(sym_setindex(self.category, e_gap_order[j]+1)) # <<<<<<<<<<<<<<
* ephr_arr._append(sym_setindex(self.category, e_gap_order[j]+1))
* i = i + step
*/
- __pyx_t_1 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, ((__pyx_v_e_gap_order[__pyx_v_j]) + 1))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, ((__pyx_v_e_gap_order[__pyx_v_j]) + 1))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_10 = PyList_Append(__pyx_v_indexes, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyList_Append(__pyx_v_indexes, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1449
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1455
* if j < num_gaps:
* indexes.append(sym_setindex(self.category, e_gap_order[j]+1))
* ephr_arr._append(sym_setindex(self.category, e_gap_order[j]+1)) # <<<<<<<<<<<<<<
@@ -53250,7 +53441,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_L45:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1450
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1456
* indexes.append(sym_setindex(self.category, e_gap_order[j]+1))
* ephr_arr._append(sym_setindex(self.category, e_gap_order[j]+1))
* i = i + step # <<<<<<<<<<<<<<
@@ -53259,7 +53450,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
__pyx_v_i = (__pyx_v_i + __pyx_v_step);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1451
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1457
* ephr_arr._append(sym_setindex(self.category, e_gap_order[j]+1))
* i = i + step
* if ephr_arr.len <= self.max_target_length and num_chunks <= self.max_target_chunks: # <<<<<<<<<<<<<<
@@ -53275,22 +53466,22 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
}
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1452
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1458
* i = i + step
* if ephr_arr.len <= self.max_target_length and num_chunks <= self.max_target_chunks:
* result.append((Phrase(ephr_arr),indexes)) # <<<<<<<<<<<<<<
*
* free(e_gaps1)
*/
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_ephr_arr));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_ephr_arr));
__Pyx_GIVEREF(((PyObject *)__pyx_v_ephr_arr));
- __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_11);
__Pyx_GIVEREF(__pyx_t_11);
@@ -53298,7 +53489,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_indexes));
__Pyx_GIVEREF(((PyObject *)__pyx_v_indexes));
__pyx_t_11 = 0;
- __pyx_t_11 = __Pyx_PyObject_Append(__pyx_v_result, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_PyObject_Append(__pyx_v_result, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
@@ -53307,7 +53498,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
__pyx_L46:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1454
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1460
* result.append((Phrase(ephr_arr),indexes))
*
* free(e_gaps1) # <<<<<<<<<<<<<<
@@ -53316,7 +53507,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
free(__pyx_v_e_gaps1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1455
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1461
*
* free(e_gaps1)
* free(e_gap_order) # <<<<<<<<<<<<<<
@@ -53325,7 +53516,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
*/
free(__pyx_v_e_gap_order);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1456
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1462
* free(e_gaps1)
* free(e_gap_order)
* return result # <<<<<<<<<<<<<<
@@ -53353,7 +53544,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract_phrases(struct _
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1458
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1464
* return result
*
* cdef IntList create_alignments(self, int* sent_links, int num_links, findexes, eindexes): # <<<<<<<<<<<<<<
@@ -53381,55 +53572,55 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("create_alignments", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1460
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1466
* cdef IntList create_alignments(self, int* sent_links, int num_links, findexes, eindexes):
* cdef unsigned i
* cdef IntList ret = IntList() # <<<<<<<<<<<<<<
* for i in range(len(findexes)):
* s = findexes[i]
*/
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ret = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1461
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1467
* cdef unsigned i
* cdef IntList ret = IntList()
* for i in range(len(findexes)): # <<<<<<<<<<<<<<
* s = findexes[i]
* if (s<0):
*/
- __pyx_t_2 = PyObject_Length(__pyx_v_findexes); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_v_findexes); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1462
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1468
* cdef IntList ret = IntList()
* for i in range(len(findexes)):
* s = findexes[i] # <<<<<<<<<<<<<<
* if (s<0):
* continue
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_findexes, __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_findexes, __pyx_v_i, sizeof(unsigned int)+1, PyLong_FromUnsignedLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_v_s);
__pyx_v_s = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1463
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1469
* for i in range(len(findexes)):
* s = findexes[i]
* if (s<0): # <<<<<<<<<<<<<<
* continue
* idx = 0
*/
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_s, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_s, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1464
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1470
* s = findexes[i]
* if (s<0):
* continue # <<<<<<<<<<<<<<
@@ -53441,7 +53632,7 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1465
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1471
* if (s<0):
* continue
* idx = 0 # <<<<<<<<<<<<<<
@@ -53452,7 +53643,7 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre
__Pyx_XDECREF(__pyx_v_idx);
__pyx_v_idx = __pyx_int_0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1466
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1472
* continue
* idx = 0
* while (idx < num_links*2): # <<<<<<<<<<<<<<
@@ -53460,51 +53651,51 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre
* j = eindexes.index(sent_links[idx+1])
*/
while (1) {
- __pyx_t_1 = PyInt_FromLong((__pyx_v_num_links * 2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong((__pyx_v_num_links * 2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_idx, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_RichCompare(__pyx_v_idx, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (!__pyx_t_4) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1467
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1473
* idx = 0
* while (idx < num_links*2):
* if (sent_links[idx] == s): # <<<<<<<<<<<<<<
* j = eindexes.index(sent_links[idx+1])
* ret.append(i*65536+j)
*/
- __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_5 = PyInt_FromLong((__pyx_v_sent_links[__pyx_t_6])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromLong((__pyx_v_sent_links[__pyx_t_6])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_v_s, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_v_s, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1468
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1474
* while (idx < num_links*2):
* if (sent_links[idx] == s):
* j = eindexes.index(sent_links[idx+1]) # <<<<<<<<<<<<<<
* ret.append(i*65536+j)
* idx += 2
*/
- __pyx_t_1 = PyObject_GetAttr(__pyx_v_eindexes, __pyx_n_s__index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(__pyx_v_eindexes, __pyx_n_s__index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyNumber_Add(__pyx_v_idx, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyNumber_Add(__pyx_v_idx, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyInt_FromLong((__pyx_v_sent_links[__pyx_t_6])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromLong((__pyx_v_sent_links[__pyx_t_6])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
@@ -53512,19 +53703,19 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre
__pyx_v_j = __pyx_t_5;
__pyx_t_5 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1469
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1475
* if (sent_links[idx] == s):
* j = eindexes.index(sent_links[idx+1])
* ret.append(i*65536+j) # <<<<<<<<<<<<<<
* idx += 2
* return ret
*/
- __pyx_t_5 = PyInt_FromLong((__pyx_v_i * 65536)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromLong((__pyx_v_i * 65536)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_v_j); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_v_j); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_ret), __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_ret), __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -53532,14 +53723,14 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre
}
__pyx_L8:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1470
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1476
* j = eindexes.index(sent_links[idx+1])
* ret.append(i*65536+j)
* idx += 2 # <<<<<<<<<<<<<<
* return ret
*
*/
- __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_idx, __pyx_int_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_idx, __pyx_int_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_v_idx);
__pyx_v_idx = __pyx_t_5;
@@ -53548,7 +53739,7 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre
__pyx_L3_continue:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1471
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1477
* ret.append(i*65536+j)
* idx += 2
* return ret # <<<<<<<<<<<<<<
@@ -53578,7 +53769,7 @@ static struct __pyx_obj_3_sa_IntList *__pyx_f_3_sa_23HieroCachingRuleFactory_cre
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1473
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1479
* return ret
*
* cdef extract(self, Phrase phrase, Matching* matching, int* chunklen, int num_chunks): # <<<<<<<<<<<<<<
@@ -53672,19 +53863,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("extract", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1486
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1492
* cdef reason_for_failure
*
* fphr_arr = IntList() # <<<<<<<<<<<<<<
* phrase_len = phrase.n
* extracts = []
*/
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_IntList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_fphr_arr = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1487
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1493
*
* fphr_arr = IntList()
* phrase_len = phrase.n # <<<<<<<<<<<<<<
@@ -53693,19 +53884,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_phrase_len = __pyx_v_phrase->n;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1488
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1494
* fphr_arr = IntList()
* phrase_len = phrase.n
* extracts = [] # <<<<<<<<<<<<<<
* sent_links = self.alignment._get_sent_links(matching.sent_id, &num_links)
*
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_extracts = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1489
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1495
* phrase_len = phrase.n
* extracts = []
* sent_links = self.alignment._get_sent_links(matching.sent_id, &num_links) # <<<<<<<<<<<<<<
@@ -53714,7 +53905,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_sent_links = ((struct __pyx_vtabstruct_3_sa_Alignment *)__pyx_v_self->alignment->__pyx_vtab)->_get_sent_links(__pyx_v_self->alignment, __pyx_v_matching->sent_id, (&__pyx_v_num_links));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1491
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1497
* sent_links = self.alignment._get_sent_links(matching.sent_id, &num_links)
*
* e_sent_start = self.eda.sent_index.arr[matching.sent_id] # <<<<<<<<<<<<<<
@@ -53723,7 +53914,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_e_sent_start = (__pyx_v_self->eda->sent_index->arr[__pyx_v_matching->sent_id]);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1492
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1498
*
* e_sent_start = self.eda.sent_index.arr[matching.sent_id]
* e_sent_end = self.eda.sent_index.arr[matching.sent_id+1] # <<<<<<<<<<<<<<
@@ -53732,7 +53923,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_e_sent_end = (__pyx_v_self->eda->sent_index->arr[(__pyx_v_matching->sent_id + 1)]);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1493
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1499
* e_sent_start = self.eda.sent_index.arr[matching.sent_id]
* e_sent_end = self.eda.sent_index.arr[matching.sent_id+1]
* e_sent_len = e_sent_end - e_sent_start - 1 # <<<<<<<<<<<<<<
@@ -53741,7 +53932,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_e_sent_len = ((__pyx_v_e_sent_end - __pyx_v_e_sent_start) - 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1494
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1500
* e_sent_end = self.eda.sent_index.arr[matching.sent_id+1]
* e_sent_len = e_sent_end - e_sent_start - 1
* f_sent_start = self.fda.sent_index.arr[matching.sent_id] # <<<<<<<<<<<<<<
@@ -53750,7 +53941,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_sent_start = (__pyx_v_self->fda->sent_index->arr[__pyx_v_matching->sent_id]);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1495
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1501
* e_sent_len = e_sent_end - e_sent_start - 1
* f_sent_start = self.fda.sent_index.arr[matching.sent_id]
* f_sent_end = self.fda.sent_index.arr[matching.sent_id+1] # <<<<<<<<<<<<<<
@@ -53759,7 +53950,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_sent_end = (__pyx_v_self->fda->sent_index->arr[(__pyx_v_matching->sent_id + 1)]);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1496
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1502
* f_sent_start = self.fda.sent_index.arr[matching.sent_id]
* f_sent_end = self.fda.sent_index.arr[matching.sent_id+1]
* f_sent_len = f_sent_end - f_sent_start - 1 # <<<<<<<<<<<<<<
@@ -53768,21 +53959,21 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_sent_len = ((__pyx_v_f_sent_end - __pyx_v_f_sent_start) - 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1498
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1504
* f_sent_len = f_sent_end - f_sent_start - 1
*
* self.findexes1.reset() # <<<<<<<<<<<<<<
* sofar = 0
* for i in range(num_chunks):
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes1), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes1), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1499
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1505
*
* self.findexes1.reset()
* sofar = 0 # <<<<<<<<<<<<<<
@@ -53792,7 +53983,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_INCREF(__pyx_int_0);
__pyx_v_sofar = __pyx_int_0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1500
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1506
* self.findexes1.reset()
* sofar = 0
* for i in range(num_chunks): # <<<<<<<<<<<<<<
@@ -53803,7 +53994,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_i = __pyx_t_4;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1501
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1507
* sofar = 0
* for i in range(num_chunks):
* for j in range(chunklen[i]): # <<<<<<<<<<<<<<
@@ -53814,35 +54005,35 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
__pyx_v_j = __pyx_t_6;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1502
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1508
* for i in range(num_chunks):
* for j in range(chunklen[i]):
* self.findexes1.append(matching.arr[matching.start+i]+j-f_sent_start); # <<<<<<<<<<<<<<
* sofar += 1
* if (i+1<num_chunks):
*/
- __pyx_t_2 = PyInt_FromLong((((__pyx_v_matching->arr[(__pyx_v_matching->start + __pyx_v_i)]) + __pyx_v_j) - __pyx_v_f_sent_start)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong((((__pyx_v_matching->arr[(__pyx_v_matching->start + __pyx_v_i)]) + __pyx_v_j) - __pyx_v_f_sent_start)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1503
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1509
* for j in range(chunklen[i]):
* self.findexes1.append(matching.arr[matching.start+i]+j-f_sent_start);
* sofar += 1 # <<<<<<<<<<<<<<
* if (i+1<num_chunks):
* self.findexes1.append(phrase[sofar])
*/
- __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sofar, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_sofar, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_v_sofar);
__pyx_v_sofar = __pyx_t_1;
__pyx_t_1 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1504
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1510
* self.findexes1.append(matching.arr[matching.start+i]+j-f_sent_start);
* sofar += 1
* if (i+1<num_chunks): # <<<<<<<<<<<<<<
@@ -53852,28 +54043,28 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_7 = ((__pyx_v_i + 1) < __pyx_v_num_chunks);
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1505
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1511
* sofar += 1
* if (i+1<num_chunks):
* self.findexes1.append(phrase[sofar]) # <<<<<<<<<<<<<<
* sofar += 1
*
*/
- __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_phrase), __pyx_v_sofar); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_phrase), __pyx_v_sofar); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes1), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1506
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1512
* if (i+1<num_chunks):
* self.findexes1.append(phrase[sofar])
* sofar += 1 # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_sofar, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_sofar, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_v_sofar);
__pyx_v_sofar = __pyx_t_2;
@@ -53883,7 +54074,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_L7:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1509
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1515
*
*
* e_links_low = <int*> malloc(e_sent_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -53892,7 +54083,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_e_links_low = ((int *)malloc((__pyx_v_e_sent_len * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1510
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1516
*
* e_links_low = <int*> malloc(e_sent_len*sizeof(int))
* e_links_high = <int*> malloc(e_sent_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -53901,7 +54092,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_e_links_high = ((int *)malloc((__pyx_v_e_sent_len * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1511
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1517
* e_links_low = <int*> malloc(e_sent_len*sizeof(int))
* e_links_high = <int*> malloc(e_sent_len*sizeof(int))
* f_links_low = <int*> malloc(f_sent_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -53910,7 +54101,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_links_low = ((int *)malloc((__pyx_v_f_sent_len * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1512
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1518
* e_links_high = <int*> malloc(e_sent_len*sizeof(int))
* f_links_low = <int*> malloc(f_sent_len*sizeof(int))
* f_links_high = <int*> malloc(f_sent_len*sizeof(int)) # <<<<<<<<<<<<<<
@@ -53919,7 +54110,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_links_high = ((int *)malloc((__pyx_v_f_sent_len * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1513
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1519
* f_links_low = <int*> malloc(f_sent_len*sizeof(int))
* f_links_high = <int*> malloc(f_sent_len*sizeof(int))
* f_gap_low = <int*> malloc((num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<<
@@ -53928,7 +54119,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_gap_low = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1514
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1520
* f_links_high = <int*> malloc(f_sent_len*sizeof(int))
* f_gap_low = <int*> malloc((num_chunks+1)*sizeof(int))
* f_gap_high = <int*> malloc((num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<<
@@ -53937,7 +54128,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_gap_high = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1515
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1521
* f_gap_low = <int*> malloc((num_chunks+1)*sizeof(int))
* f_gap_high = <int*> malloc((num_chunks+1)*sizeof(int))
* e_gap_low = <int*> malloc((num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<<
@@ -53946,7 +54137,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_e_gap_low = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1516
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1522
* f_gap_high = <int*> malloc((num_chunks+1)*sizeof(int))
* e_gap_low = <int*> malloc((num_chunks+1)*sizeof(int))
* e_gap_high = <int*> malloc((num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<<
@@ -53955,7 +54146,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_e_gap_high = ((int *)malloc(((__pyx_v_num_chunks + 1) * (sizeof(int)))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1517
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1523
* e_gap_low = <int*> malloc((num_chunks+1)*sizeof(int))
* e_gap_high = <int*> malloc((num_chunks+1)*sizeof(int))
* memset(f_gap_low, 0, (num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<<
@@ -53964,7 +54155,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
memset(__pyx_v_f_gap_low, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1518
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1524
* e_gap_high = <int*> malloc((num_chunks+1)*sizeof(int))
* memset(f_gap_low, 0, (num_chunks+1)*sizeof(int))
* memset(f_gap_high, 0, (num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<<
@@ -53973,7 +54164,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
memset(__pyx_v_f_gap_high, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1519
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1525
* memset(f_gap_low, 0, (num_chunks+1)*sizeof(int))
* memset(f_gap_high, 0, (num_chunks+1)*sizeof(int))
* memset(e_gap_low, 0, (num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<<
@@ -53982,7 +54173,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
memset(__pyx_v_e_gap_low, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1520
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1526
* memset(f_gap_high, 0, (num_chunks+1)*sizeof(int))
* memset(e_gap_low, 0, (num_chunks+1)*sizeof(int))
* memset(e_gap_high, 0, (num_chunks+1)*sizeof(int)) # <<<<<<<<<<<<<<
@@ -53991,7 +54182,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
memset(__pyx_v_e_gap_high, 0, ((__pyx_v_num_chunks + 1) * (sizeof(int))));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1522
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1528
* memset(e_gap_high, 0, (num_chunks+1)*sizeof(int))
*
* reason_for_failure = "" # <<<<<<<<<<<<<<
@@ -54001,7 +54192,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_INCREF(((PyObject *)__pyx_kp_s_45));
__pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_45);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1524
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1530
* reason_for_failure = ""
*
* for i from 0 <= i < e_sent_len: # <<<<<<<<<<<<<<
@@ -54011,7 +54202,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_3 = __pyx_v_e_sent_len;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1525
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1531
*
* for i from 0 <= i < e_sent_len:
* e_links_low[i] = -1 # <<<<<<<<<<<<<<
@@ -54020,7 +54211,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
(__pyx_v_e_links_low[__pyx_v_i]) = -1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1526
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1532
* for i from 0 <= i < e_sent_len:
* e_links_low[i] = -1
* e_links_high[i] = -1 # <<<<<<<<<<<<<<
@@ -54030,7 +54221,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
(__pyx_v_e_links_high[__pyx_v_i]) = -1;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1527
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1533
* e_links_low[i] = -1
* e_links_high[i] = -1
* for i from 0 <= i < f_sent_len: # <<<<<<<<<<<<<<
@@ -54040,7 +54231,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_3 = __pyx_v_f_sent_len;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1528
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1534
* e_links_high[i] = -1
* for i from 0 <= i < f_sent_len:
* f_links_low[i] = -1 # <<<<<<<<<<<<<<
@@ -54049,7 +54240,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
(__pyx_v_f_links_low[__pyx_v_i]) = -1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1529
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1535
* for i from 0 <= i < f_sent_len:
* f_links_low[i] = -1
* f_links_high[i] = -1 # <<<<<<<<<<<<<<
@@ -54059,7 +54250,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
(__pyx_v_f_links_high[__pyx_v_i]) = -1;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1535
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1541
* # links that we care about (but then how to look up
* # when we want to check something on the e side?)
* i = 0 # <<<<<<<<<<<<<<
@@ -54068,7 +54259,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_i = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1536
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1542
* # when we want to check something on the e side?)
* i = 0
* while i < num_links*2: # <<<<<<<<<<<<<<
@@ -54079,7 +54270,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_7 = (__pyx_v_i < (__pyx_v_num_links * 2));
if (!__pyx_t_7) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1537
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1543
* i = 0
* while i < num_links*2:
* f_i = sent_links[i] # <<<<<<<<<<<<<<
@@ -54088,7 +54279,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_i = (__pyx_v_sent_links[__pyx_v_i]);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1538
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1544
* while i < num_links*2:
* f_i = sent_links[i]
* e_i = sent_links[i+1] # <<<<<<<<<<<<<<
@@ -54097,7 +54288,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_e_i = (__pyx_v_sent_links[(__pyx_v_i + 1)]);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1539
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1545
* f_i = sent_links[i]
* e_i = sent_links[i+1]
* if f_links_low[f_i] == -1 or f_links_low[f_i] > e_i: # <<<<<<<<<<<<<<
@@ -54113,7 +54304,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1540
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1546
* e_i = sent_links[i+1]
* if f_links_low[f_i] == -1 or f_links_low[f_i] > e_i:
* f_links_low[f_i] = e_i # <<<<<<<<<<<<<<
@@ -54125,7 +54316,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L14:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1541
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1547
* if f_links_low[f_i] == -1 or f_links_low[f_i] > e_i:
* f_links_low[f_i] = e_i
* if f_links_high[f_i] == -1 or f_links_high[f_i] < e_i + 1: # <<<<<<<<<<<<<<
@@ -54141,7 +54332,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_8) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1542
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1548
* f_links_low[f_i] = e_i
* if f_links_high[f_i] == -1 or f_links_high[f_i] < e_i + 1:
* f_links_high[f_i] = e_i + 1 # <<<<<<<<<<<<<<
@@ -54153,7 +54344,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L15:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1543
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1549
* if f_links_high[f_i] == -1 or f_links_high[f_i] < e_i + 1:
* f_links_high[f_i] = e_i + 1
* if e_links_low[e_i] == -1 or e_links_low[e_i] > f_i: # <<<<<<<<<<<<<<
@@ -54169,7 +54360,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1544
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1550
* f_links_high[f_i] = e_i + 1
* if e_links_low[e_i] == -1 or e_links_low[e_i] > f_i:
* e_links_low[e_i] = f_i # <<<<<<<<<<<<<<
@@ -54181,7 +54372,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L16:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1545
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1551
* if e_links_low[e_i] == -1 or e_links_low[e_i] > f_i:
* e_links_low[e_i] = f_i
* if e_links_high[e_i] == -1 or e_links_high[e_i] < f_i + 1: # <<<<<<<<<<<<<<
@@ -54197,7 +54388,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1546
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1552
* e_links_low[e_i] = f_i
* if e_links_high[e_i] == -1 or e_links_high[e_i] < f_i + 1:
* e_links_high[e_i] = f_i + 1 # <<<<<<<<<<<<<<
@@ -54209,7 +54400,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L17:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1547
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1553
* if e_links_high[e_i] == -1 or e_links_high[e_i] < f_i + 1:
* e_links_high[e_i] = f_i + 1
* i = i + 2 # <<<<<<<<<<<<<<
@@ -54219,19 +54410,19 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_v_i = (__pyx_v_i + 2);
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1549
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1555
* i = i + 2
*
* als = [] # <<<<<<<<<<<<<<
* for x in range(matching.start,matching.end):
* al = (matching.arr[x]-f_sent_start,f_links_low[matching.arr[x]-f_sent_start])
*/
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_als = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1550
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1556
*
* als = []
* for x in range(matching.start,matching.end): # <<<<<<<<<<<<<<
@@ -54242,18 +54433,18 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
for (__pyx_t_4 = __pyx_v_matching->start; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
__pyx_v_x = __pyx_t_4;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1551
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1557
* als = []
* for x in range(matching.start,matching.end):
* al = (matching.arr[x]-f_sent_start,f_links_low[matching.arr[x]-f_sent_start]) # <<<<<<<<<<<<<<
* als.append(al)
* # check all source-side alignment constraints
*/
- __pyx_t_2 = PyInt_FromLong(((__pyx_v_matching->arr[__pyx_v_x]) - __pyx_v_f_sent_start)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(((__pyx_v_matching->arr[__pyx_v_x]) - __pyx_v_f_sent_start)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyInt_FromLong((__pyx_v_f_links_low[((__pyx_v_matching->arr[__pyx_v_x]) - __pyx_v_f_sent_start)])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong((__pyx_v_f_links_low[((__pyx_v_matching->arr[__pyx_v_x]) - __pyx_v_f_sent_start)])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
@@ -54265,17 +54456,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_v_al = __pyx_t_10;
__pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1552
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1558
* for x in range(matching.start,matching.end):
* al = (matching.arr[x]-f_sent_start,f_links_low[matching.arr[x]-f_sent_start])
* als.append(al) # <<<<<<<<<<<<<<
* # check all source-side alignment constraints
* met_constraints = 1
*/
- __pyx_t_11 = PyList_Append(__pyx_v_als, ((PyObject *)__pyx_v_al)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyList_Append(__pyx_v_als, ((PyObject *)__pyx_v_al)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1554
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1560
* als.append(al)
* # check all source-side alignment constraints
* met_constraints = 1 # <<<<<<<<<<<<<<
@@ -54284,7 +54475,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_met_constraints = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1555
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1561
* # check all source-side alignment constraints
* met_constraints = 1
* if self.require_aligned_terminal: # <<<<<<<<<<<<<<
@@ -54293,7 +54484,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_self->require_aligned_terminal) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1556
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1562
* met_constraints = 1
* if self.require_aligned_terminal:
* num_aligned_chunks = 0 # <<<<<<<<<<<<<<
@@ -54302,7 +54493,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_num_aligned_chunks = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1557
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1563
* if self.require_aligned_terminal:
* num_aligned_chunks = 0
* for i from 0 <= i < num_chunks: # <<<<<<<<<<<<<<
@@ -54312,7 +54503,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_3 = __pyx_v_num_chunks;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1558
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1564
* num_aligned_chunks = 0
* for i from 0 <= i < num_chunks:
* for j from 0 <= j < chunklen[i]: # <<<<<<<<<<<<<<
@@ -54322,7 +54513,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_4 = (__pyx_v_chunklen[__pyx_v_i]);
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_4; __pyx_v_j++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1559
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1565
* for i from 0 <= i < num_chunks:
* for j from 0 <= j < chunklen[i]:
* if f_links_low[matching.arr[matching.start+i]+j-f_sent_start] > -1: # <<<<<<<<<<<<<<
@@ -54332,7 +54523,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = ((__pyx_v_f_links_low[(((__pyx_v_matching->arr[(__pyx_v_matching->start + __pyx_v_i)]) + __pyx_v_j) - __pyx_v_f_sent_start)]) > -1);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1560
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1566
* for j from 0 <= j < chunklen[i]:
* if f_links_low[matching.arr[matching.start+i]+j-f_sent_start] > -1:
* num_aligned_chunks = num_aligned_chunks + 1 # <<<<<<<<<<<<<<
@@ -54341,7 +54532,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_num_aligned_chunks = (__pyx_v_num_aligned_chunks + 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1561
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1567
* if f_links_low[matching.arr[matching.start+i]+j-f_sent_start] > -1:
* num_aligned_chunks = num_aligned_chunks + 1
* break # <<<<<<<<<<<<<<
@@ -54356,7 +54547,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_L24_break:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1562
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1568
* num_aligned_chunks = num_aligned_chunks + 1
* break
* if num_aligned_chunks == 0: # <<<<<<<<<<<<<<
@@ -54366,18 +54557,18 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = (__pyx_v_num_aligned_chunks == 0);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1563
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1569
* break
* if num_aligned_chunks == 0:
* reason_for_failure = "No aligned terminals" # <<<<<<<<<<<<<<
* met_constraints = 0
* if self.require_aligned_chunks and num_aligned_chunks < num_chunks:
*/
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_126));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_127));
__Pyx_DECREF(__pyx_v_reason_for_failure);
- __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_126);
+ __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_127);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1564
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1570
* if num_aligned_chunks == 0:
* reason_for_failure = "No aligned terminals"
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -54389,7 +54580,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L26:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1565
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1571
* reason_for_failure = "No aligned terminals"
* met_constraints = 0
* if self.require_aligned_chunks and num_aligned_chunks < num_chunks: # <<<<<<<<<<<<<<
@@ -54404,18 +54595,18 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1566
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1572
* met_constraints = 0
* if self.require_aligned_chunks and num_aligned_chunks < num_chunks:
* reason_for_failure = "Unaligned chunk" # <<<<<<<<<<<<<<
* met_constraints = 0
*
*/
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_127));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_128));
__Pyx_DECREF(__pyx_v_reason_for_failure);
- __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_127);
+ __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_128);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1567
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1573
* if self.require_aligned_chunks and num_aligned_chunks < num_chunks:
* reason_for_failure = "Unaligned chunk"
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -54430,7 +54621,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L20:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1569
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1575
* met_constraints = 0
*
* if met_constraints and self.tight_phrases: # <<<<<<<<<<<<<<
@@ -54445,7 +54636,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1571
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1577
* if met_constraints and self.tight_phrases:
* # outside edge constraints are checked later
* for i from 0 <= i < num_chunks-1: # <<<<<<<<<<<<<<
@@ -54455,7 +54646,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_12 = (__pyx_v_num_chunks - 1);
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_12; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1572
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1578
* # outside edge constraints are checked later
* for i from 0 <= i < num_chunks-1:
* if f_links_low[matching.arr[matching.start+i]+chunklen[i]-f_sent_start] == -1: # <<<<<<<<<<<<<<
@@ -54465,18 +54656,18 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = ((__pyx_v_f_links_low[(((__pyx_v_matching->arr[(__pyx_v_matching->start + __pyx_v_i)]) + (__pyx_v_chunklen[__pyx_v_i])) - __pyx_v_f_sent_start)]) == -1);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1573
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1579
* for i from 0 <= i < num_chunks-1:
* if f_links_low[matching.arr[matching.start+i]+chunklen[i]-f_sent_start] == -1:
* reason_for_failure = "Gaps are not tight phrases" # <<<<<<<<<<<<<<
* met_constraints = 0
* break
*/
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_128));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_129));
__Pyx_DECREF(__pyx_v_reason_for_failure);
- __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_128);
+ __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_129);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1574
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1580
* if f_links_low[matching.arr[matching.start+i]+chunklen[i]-f_sent_start] == -1:
* reason_for_failure = "Gaps are not tight phrases"
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -54485,7 +54676,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_met_constraints = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1575
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1581
* reason_for_failure = "Gaps are not tight phrases"
* met_constraints = 0
* break # <<<<<<<<<<<<<<
@@ -54497,7 +54688,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L31:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1576
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1582
* met_constraints = 0
* break
* if f_links_low[matching.arr[matching.start+i+1]-1-f_sent_start] == -1: # <<<<<<<<<<<<<<
@@ -54507,18 +54698,18 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = ((__pyx_v_f_links_low[(((__pyx_v_matching->arr[((__pyx_v_matching->start + __pyx_v_i) + 1)]) - 1) - __pyx_v_f_sent_start)]) == -1);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1577
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1583
* break
* if f_links_low[matching.arr[matching.start+i+1]-1-f_sent_start] == -1:
* reason_for_failure = "Gaps are not tight phrases" # <<<<<<<<<<<<<<
* met_constraints = 0
* break
*/
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_128));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_129));
__Pyx_DECREF(__pyx_v_reason_for_failure);
- __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_128);
+ __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_129);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1578
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1584
* if f_links_low[matching.arr[matching.start+i+1]-1-f_sent_start] == -1:
* reason_for_failure = "Gaps are not tight phrases"
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -54527,7 +54718,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_met_constraints = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1579
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1585
* reason_for_failure = "Gaps are not tight phrases"
* met_constraints = 0
* break # <<<<<<<<<<<<<<
@@ -54544,7 +54735,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L28:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1581
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1587
* break
*
* f_low = matching.arr[matching.start] - f_sent_start # <<<<<<<<<<<<<<
@@ -54553,7 +54744,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_low = ((__pyx_v_matching->arr[__pyx_v_matching->start]) - __pyx_v_f_sent_start);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1582
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1588
*
* f_low = matching.arr[matching.start] - f_sent_start
* f_high = matching.arr[matching.start + matching.size - 1] + chunklen[num_chunks-1] - f_sent_start # <<<<<<<<<<<<<<
@@ -54562,7 +54753,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_high = (((__pyx_v_matching->arr[((__pyx_v_matching->start + __pyx_v_matching->size) - 1)]) + (__pyx_v_chunklen[(__pyx_v_num_chunks - 1)])) - __pyx_v_f_sent_start);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1583
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1589
* f_low = matching.arr[matching.start] - f_sent_start
* f_high = matching.arr[matching.start + matching.size - 1] + chunklen[num_chunks-1] - f_sent_start
* if met_constraints: # <<<<<<<<<<<<<<
@@ -54571,17 +54762,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_met_constraints) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1585
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1591
* if met_constraints:
*
* if self.find_fixpoint(f_low, f_high, f_links_low, f_links_high, e_links_low, e_links_high, # <<<<<<<<<<<<<<
* -1, -1, &e_low, &e_high, &f_back_low, &f_back_high, f_sent_len, e_sent_len,
* self.train_max_initial_size, self.train_max_initial_size,
*/
- __pyx_t_10 = PyInt_FromLong(__pyx_v_f_high); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromLong(__pyx_v_f_high); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1589
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1595
* self.train_max_initial_size, self.train_max_initial_size,
* self.train_min_gap_size, 0,
* self.max_nonterminals - num_chunks + 1, 1, 1, 0, 0): # <<<<<<<<<<<<<<
@@ -54592,7 +54783,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1590
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1596
* self.train_min_gap_size, 0,
* self.max_nonterminals - num_chunks + 1, 1, 1, 0, 0):
* gap_error = 0 # <<<<<<<<<<<<<<
@@ -54601,7 +54792,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_gap_error = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1591
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1597
* self.max_nonterminals - num_chunks + 1, 1, 1, 0, 0):
* gap_error = 0
* num_gaps = 0 # <<<<<<<<<<<<<<
@@ -54610,7 +54801,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_num_gaps = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1593
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1599
* num_gaps = 0
*
* if f_back_low < f_low: # <<<<<<<<<<<<<<
@@ -54620,7 +54811,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = (__pyx_v_f_back_low < __pyx_v_f_low);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1594
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1600
*
* if f_back_low < f_low:
* f_gap_low[0] = f_back_low # <<<<<<<<<<<<<<
@@ -54629,7 +54820,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
(__pyx_v_f_gap_low[0]) = __pyx_v_f_back_low;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1595
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1601
* if f_back_low < f_low:
* f_gap_low[0] = f_back_low
* f_gap_high[0] = f_low # <<<<<<<<<<<<<<
@@ -54638,7 +54829,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
(__pyx_v_f_gap_high[0]) = __pyx_v_f_low;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1596
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1602
* f_gap_low[0] = f_back_low
* f_gap_high[0] = f_low
* num_gaps = 1 # <<<<<<<<<<<<<<
@@ -54647,7 +54838,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_num_gaps = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1597
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1603
* f_gap_high[0] = f_low
* num_gaps = 1
* gap_start = 0 # <<<<<<<<<<<<<<
@@ -54656,7 +54847,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_gap_start = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1598
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1604
* num_gaps = 1
* gap_start = 0
* phrase_len = phrase_len+1 # <<<<<<<<<<<<<<
@@ -54665,7 +54856,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_phrase_len = (__pyx_v_phrase_len + 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1599
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1605
* gap_start = 0
* phrase_len = phrase_len+1
* if phrase_len > self.max_length: # <<<<<<<<<<<<<<
@@ -54675,7 +54866,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = (__pyx_v_phrase_len > __pyx_v_self->max_length);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1600
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1606
* phrase_len = phrase_len+1
* if phrase_len > self.max_length:
* gap_error = 1 # <<<<<<<<<<<<<<
@@ -54687,7 +54878,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L36:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1601
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1607
* if phrase_len > self.max_length:
* gap_error = 1
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -54696,7 +54887,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_self->tight_phrases) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1602
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1608
* gap_error = 1
* if self.tight_phrases:
* if f_links_low[f_back_low] == -1 or f_links_low[f_low-1] == -1: # <<<<<<<<<<<<<<
@@ -54712,7 +54903,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_8) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1603
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1609
* if self.tight_phrases:
* if f_links_low[f_back_low] == -1 or f_links_low[f_low-1] == -1:
* gap_error = 1 # <<<<<<<<<<<<<<
@@ -54721,16 +54912,16 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_gap_error = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1604
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1610
* if f_links_low[f_back_low] == -1 or f_links_low[f_low-1] == -1:
* gap_error = 1
* reason_for_failure = "Inside edges of preceding subphrase are not tight" # <<<<<<<<<<<<<<
* else:
* gap_start = 1
*/
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_129));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_130));
__Pyx_DECREF(__pyx_v_reason_for_failure);
- __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_129);
+ __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_130);
goto __pyx_L38;
}
__pyx_L38:;
@@ -54741,7 +54932,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1606
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1612
* reason_for_failure = "Inside edges of preceding subphrase are not tight"
* else:
* gap_start = 1 # <<<<<<<<<<<<<<
@@ -54750,7 +54941,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_gap_start = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1607
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1613
* else:
* gap_start = 1
* if self.tight_phrases and f_links_low[f_low] == -1: # <<<<<<<<<<<<<<
@@ -54765,7 +54956,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1610
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1616
* # this is not a hard error. we can't extract this phrase
* # but we still might be able to extract a superphrase
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -54779,7 +54970,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L35:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1612
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1618
* met_constraints = 0
*
* for i from 0 <= i < matching.size - 1: # <<<<<<<<<<<<<<
@@ -54789,7 +54980,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_12 = (__pyx_v_matching->size - 1);
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_12; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1613
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1619
*
* for i from 0 <= i < matching.size - 1:
* f_gap_low[1+i] = matching.arr[matching.start+i] + chunklen[i] - f_sent_start # <<<<<<<<<<<<<<
@@ -54798,7 +54989,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
(__pyx_v_f_gap_low[(1 + __pyx_v_i)]) = (((__pyx_v_matching->arr[(__pyx_v_matching->start + __pyx_v_i)]) + (__pyx_v_chunklen[__pyx_v_i])) - __pyx_v_f_sent_start);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1614
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1620
* for i from 0 <= i < matching.size - 1:
* f_gap_low[1+i] = matching.arr[matching.start+i] + chunklen[i] - f_sent_start
* f_gap_high[1+i] = matching.arr[matching.start+i+1] - f_sent_start # <<<<<<<<<<<<<<
@@ -54807,7 +54998,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
(__pyx_v_f_gap_high[(1 + __pyx_v_i)]) = ((__pyx_v_matching->arr[((__pyx_v_matching->start + __pyx_v_i) + 1)]) - __pyx_v_f_sent_start);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1615
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1621
* f_gap_low[1+i] = matching.arr[matching.start+i] + chunklen[i] - f_sent_start
* f_gap_high[1+i] = matching.arr[matching.start+i+1] - f_sent_start
* num_gaps = num_gaps + 1 # <<<<<<<<<<<<<<
@@ -54817,7 +55008,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_v_num_gaps = (__pyx_v_num_gaps + 1);
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1617
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1623
* num_gaps = num_gaps + 1
*
* if f_high < f_back_high: # <<<<<<<<<<<<<<
@@ -54827,7 +55018,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = (__pyx_v_f_high < __pyx_v_f_back_high);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1618
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1624
*
* if f_high < f_back_high:
* f_gap_low[gap_start+num_gaps] = f_high # <<<<<<<<<<<<<<
@@ -54836,7 +55027,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
(__pyx_v_f_gap_low[(__pyx_v_gap_start + __pyx_v_num_gaps)]) = __pyx_v_f_high;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1619
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1625
* if f_high < f_back_high:
* f_gap_low[gap_start+num_gaps] = f_high
* f_gap_high[gap_start+num_gaps] = f_back_high # <<<<<<<<<<<<<<
@@ -54845,7 +55036,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
(__pyx_v_f_gap_high[(__pyx_v_gap_start + __pyx_v_num_gaps)]) = __pyx_v_f_back_high;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1620
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1626
* f_gap_low[gap_start+num_gaps] = f_high
* f_gap_high[gap_start+num_gaps] = f_back_high
* num_gaps = num_gaps + 1 # <<<<<<<<<<<<<<
@@ -54854,7 +55045,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_num_gaps = (__pyx_v_num_gaps + 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1621
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1627
* f_gap_high[gap_start+num_gaps] = f_back_high
* num_gaps = num_gaps + 1
* phrase_len = phrase_len+1 # <<<<<<<<<<<<<<
@@ -54863,7 +55054,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_phrase_len = (__pyx_v_phrase_len + 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1622
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1628
* num_gaps = num_gaps + 1
* phrase_len = phrase_len+1
* if phrase_len > self.max_length: # <<<<<<<<<<<<<<
@@ -54873,7 +55064,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = (__pyx_v_phrase_len > __pyx_v_self->max_length);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1623
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1629
* phrase_len = phrase_len+1
* if phrase_len > self.max_length:
* gap_error = 1 # <<<<<<<<<<<<<<
@@ -54885,7 +55076,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L43:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1624
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1630
* if phrase_len > self.max_length:
* gap_error = 1
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -54894,7 +55085,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_self->tight_phrases) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1625
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1631
* gap_error = 1
* if self.tight_phrases:
* if f_links_low[f_back_high-1] == -1 or f_links_low[f_high] == -1: # <<<<<<<<<<<<<<
@@ -54910,7 +55101,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1626
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1632
* if self.tight_phrases:
* if f_links_low[f_back_high-1] == -1 or f_links_low[f_high] == -1:
* gap_error = 1 # <<<<<<<<<<<<<<
@@ -54919,16 +55110,16 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_gap_error = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1627
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1633
* if f_links_low[f_back_high-1] == -1 or f_links_low[f_high] == -1:
* gap_error = 1
* reason_for_failure = "Inside edges of following subphrase are not tight" # <<<<<<<<<<<<<<
* else:
* if self.tight_phrases and f_links_low[f_high-1] == -1:
*/
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_130));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_131));
__Pyx_DECREF(__pyx_v_reason_for_failure);
- __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_130);
+ __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_131);
goto __pyx_L45;
}
__pyx_L45:;
@@ -54939,7 +55130,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1629
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1635
* reason_for_failure = "Inside edges of following subphrase are not tight"
* else:
* if self.tight_phrases and f_links_low[f_high-1] == -1: # <<<<<<<<<<<<<<
@@ -54954,7 +55145,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1630
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1636
* else:
* if self.tight_phrases and f_links_low[f_high-1] == -1:
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -54968,7 +55159,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L42:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1632
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1638
* met_constraints = 0
*
* if gap_error == 0: # <<<<<<<<<<<<<<
@@ -54978,7 +55169,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = (__pyx_v_gap_error == 0);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1633
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1639
*
* if gap_error == 0:
* e_word_count = e_high - e_low # <<<<<<<<<<<<<<
@@ -54987,7 +55178,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_e_word_count = (__pyx_v_e_high - __pyx_v_e_low);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1634
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1640
* if gap_error == 0:
* e_word_count = e_high - e_low
* for i from 0 <= i < num_gaps: # check integrity of subphrases # <<<<<<<<<<<<<<
@@ -54997,17 +55188,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_3 = __pyx_v_num_gaps;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1635
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1641
* e_word_count = e_high - e_low
* for i from 0 <= i < num_gaps: # check integrity of subphrases
* if self.find_fixpoint(f_gap_low[gap_start+i], f_gap_high[gap_start+i], # <<<<<<<<<<<<<<
* f_links_low, f_links_high, e_links_low, e_links_high,
* -1, -1, e_gap_low+gap_start+i, e_gap_high+gap_start+i,
*/
- __pyx_t_10 = PyInt_FromLong((__pyx_v_f_gap_high[(__pyx_v_gap_start + __pyx_v_i)])); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromLong((__pyx_v_f_gap_high[(__pyx_v_gap_start + __pyx_v_i)])); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1640
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1646
* f_gap_low+gap_start+i, f_gap_high+gap_start+i,
* f_sent_len, e_sent_len,
* self.train_max_initial_size, self.train_max_initial_size, # <<<<<<<<<<<<<<
@@ -55018,7 +55209,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1642
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1648
* self.train_max_initial_size, self.train_max_initial_size,
* 0, 0, 0, 0, 0, 0, 0) == 0:
* gap_error = 1 # <<<<<<<<<<<<<<
@@ -55027,18 +55218,18 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_gap_error = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1643
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1649
* 0, 0, 0, 0, 0, 0, 0) == 0:
* gap_error = 1
* reason_for_failure = "Subphrase [%d, %d] failed integrity check" % (f_gap_low[gap_start+i], f_gap_high[gap_start+i]) # <<<<<<<<<<<<<<
* break
*
*/
- __pyx_t_10 = PyInt_FromLong((__pyx_v_f_gap_low[(__pyx_v_gap_start + __pyx_v_i)])); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromLong((__pyx_v_f_gap_low[(__pyx_v_gap_start + __pyx_v_i)])); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_1 = PyInt_FromLong((__pyx_v_f_gap_high[(__pyx_v_gap_start + __pyx_v_i)])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong((__pyx_v_f_gap_high[(__pyx_v_gap_start + __pyx_v_i)])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10);
__Pyx_GIVEREF(__pyx_t_10);
@@ -55046,14 +55237,14 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_10 = 0;
__pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_131), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_132), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_v_reason_for_failure);
__pyx_v_reason_for_failure = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1644
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1650
* gap_error = 1
* reason_for_failure = "Subphrase [%d, %d] failed integrity check" % (f_gap_low[gap_start+i], f_gap_high[gap_start+i])
* break # <<<<<<<<<<<<<<
@@ -55070,7 +55261,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L47:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1646
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1652
* break
*
* if gap_error == 0: # <<<<<<<<<<<<<<
@@ -55080,7 +55271,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = (__pyx_v_gap_error == 0);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1647
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1653
*
* if gap_error == 0:
* i = 1 # <<<<<<<<<<<<<<
@@ -55089,21 +55280,21 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_i = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1648
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1654
* if gap_error == 0:
* i = 1
* self.findexes.reset() # <<<<<<<<<<<<<<
* if f_back_low < f_low:
* fphr_arr._append(sym_setindex(self.category, i))
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1649
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1655
* i = 1
* self.findexes.reset()
* if f_back_low < f_low: # <<<<<<<<<<<<<<
@@ -55113,7 +55304,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = (__pyx_v_f_back_low < __pyx_v_f_low);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1650
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1656
* self.findexes.reset()
* if f_back_low < f_low:
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -55122,7 +55313,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1651
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1657
* if f_back_low < f_low:
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1 # <<<<<<<<<<<<<<
@@ -55131,16 +55322,16 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_i = (__pyx_v_i + 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1652
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1658
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1
* self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n:
*/
- __pyx_t_2 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -55148,27 +55339,27 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L52:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1653
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1659
* i = i+1
* self.findexes.append(sym_setindex(self.category, i))
* self.findexes.extend(self.findexes1) # <<<<<<<<<<<<<<
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]):
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_v_self->findexes1));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self->findexes1));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->findexes1));
- __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1654
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1660
* self.findexes.append(sym_setindex(self.category, i))
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<<
@@ -55178,7 +55369,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_3 = __pyx_v_phrase->n;
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1655
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1661
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<<
@@ -55188,7 +55379,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_4 = __pyx_f_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j]));
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1656
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1662
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -55197,7 +55388,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1657
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1663
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i))
* i = i + 1 # <<<<<<<<<<<<<<
@@ -55209,7 +55400,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1659
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1665
* i = i + 1
* else:
* fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<<
@@ -55221,7 +55412,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_L55:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1660
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1666
* else:
* fphr_arr._append(phrase.syms[j])
* if f_back_high > f_high: # <<<<<<<<<<<<<<
@@ -55231,7 +55422,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = (__pyx_v_f_back_high > __pyx_v_f_high);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1661
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1667
* fphr_arr._append(phrase.syms[j])
* if f_back_high > f_high:
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -55240,16 +55431,16 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1662
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1668
* if f_back_high > f_high:
* fphr_arr._append(sym_setindex(self.category, i))
* self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
*
* fphr = Phrase(fphr_arr)
*/
- __pyx_t_10 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_2 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -55257,25 +55448,25 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L56:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1664
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1670
* self.findexes.append(sym_setindex(self.category, i))
*
* fphr = Phrase(fphr_arr) # <<<<<<<<<<<<<<
* if met_constraints:
* phrase_list = self.extract_phrases(e_low, e_high, e_gap_low + gap_start, e_gap_high + gap_start, e_links_low, num_gaps,
*/
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(((PyObject *)__pyx_v_fphr_arr));
PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_fphr_arr));
__Pyx_GIVEREF(((PyObject *)__pyx_v_fphr_arr));
- __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_v_fphr = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_10);
__pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1665
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1671
*
* fphr = Phrase(fphr_arr)
* if met_constraints: # <<<<<<<<<<<<<<
@@ -55284,47 +55475,47 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_met_constraints) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1668
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1674
* phrase_list = self.extract_phrases(e_low, e_high, e_gap_low + gap_start, e_gap_high + gap_start, e_links_low, num_gaps,
* f_back_low, f_back_high, f_gap_low + gap_start, f_gap_high + gap_start, f_links_low,
* matching.sent_id, e_sent_len, e_sent_start) # <<<<<<<<<<<<<<
* if len(phrase_list) > 0:
* pair_count = 1.0 / len(phrase_list)
*/
- __pyx_t_10 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->extract_phrases(__pyx_v_self, __pyx_v_e_low, __pyx_v_e_high, (__pyx_v_e_gap_low + __pyx_v_gap_start), (__pyx_v_e_gap_high + __pyx_v_gap_start), __pyx_v_e_links_low, __pyx_v_num_gaps, __pyx_v_f_back_low, __pyx_v_f_back_high, (__pyx_v_f_gap_low + __pyx_v_gap_start), (__pyx_v_f_gap_high + __pyx_v_gap_start), __pyx_v_f_links_low, __pyx_v_matching->sent_id, __pyx_v_e_sent_len, __pyx_v_e_sent_start); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->extract_phrases(__pyx_v_self, __pyx_v_e_low, __pyx_v_e_high, (__pyx_v_e_gap_low + __pyx_v_gap_start), (__pyx_v_e_gap_high + __pyx_v_gap_start), __pyx_v_e_links_low, __pyx_v_num_gaps, __pyx_v_f_back_low, __pyx_v_f_back_high, (__pyx_v_f_gap_low + __pyx_v_gap_start), (__pyx_v_f_gap_high + __pyx_v_gap_start), __pyx_v_f_links_low, __pyx_v_matching->sent_id, __pyx_v_e_sent_len, __pyx_v_e_sent_start); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1672; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__pyx_v_phrase_list = __pyx_t_10;
__pyx_t_10 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1669
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1675
* f_back_low, f_back_high, f_gap_low + gap_start, f_gap_high + gap_start, f_links_low,
* matching.sent_id, e_sent_len, e_sent_start)
* if len(phrase_list) > 0: # <<<<<<<<<<<<<<
* pair_count = 1.0 / len(phrase_list)
* else:
*/
- __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_9 = (__pyx_t_13 > 0);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1670
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1676
* matching.sent_id, e_sent_len, e_sent_start)
* if len(phrase_list) > 0:
* pair_count = 1.0 / len(phrase_list) # <<<<<<<<<<<<<<
* else:
* pair_count = 0
*/
- __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(__pyx_t_13 == 0)) {
PyErr_Format(PyExc_ZeroDivisionError, "float division");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_v_pair_count = (1.0 / __pyx_t_13);
goto __pyx_L58;
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1672
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1678
* pair_count = 1.0 / len(phrase_list)
* else:
* pair_count = 0 # <<<<<<<<<<<<<<
@@ -55333,22 +55524,22 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_pair_count = 0.0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1673
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1679
* else:
* pair_count = 0
* reason_for_failure = "Didn't extract anything from [%d, %d] -> [%d, %d]" % (f_back_low, f_back_high, e_low, e_high) # <<<<<<<<<<<<<<
* for (phrase2,eindexes) in phrase_list:
* als1 = self.create_alignments(sent_links,num_links,self.findexes,eindexes)
*/
- __pyx_t_10 = PyInt_FromLong(__pyx_v_f_back_low); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyInt_FromLong(__pyx_v_f_back_low); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_2 = PyInt_FromLong(__pyx_v_f_back_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_v_f_back_high); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyInt_FromLong(__pyx_v_e_low); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_e_low); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_14 = PyInt_FromLong(__pyx_v_e_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyInt_FromLong(__pyx_v_e_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
- __pyx_t_15 = PyTuple_New(4); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(4); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_10);
__Pyx_GIVEREF(__pyx_t_10);
@@ -55362,7 +55553,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_2 = 0;
__pyx_t_1 = 0;
__pyx_t_14 = 0;
- __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_132), ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_133), ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_14));
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_v_reason_for_failure);
@@ -55371,7 +55562,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L58:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1674
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1680
* pair_count = 0
* reason_for_failure = "Didn't extract anything from [%d, %d] -> [%d, %d]" % (f_back_low, f_back_high, e_low, e_high)
* for (phrase2,eindexes) in phrase_list: # <<<<<<<<<<<<<<
@@ -55382,7 +55573,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_14 = __pyx_v_phrase_list; __Pyx_INCREF(__pyx_t_14); __pyx_t_13 = 0;
__pyx_t_16 = NULL;
} else {
- __pyx_t_13 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__pyx_t_16 = Py_TYPE(__pyx_t_14)->tp_iternext;
}
@@ -55390,23 +55581,23 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_14)) {
if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_14)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_15 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_15 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_14)) {
if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_15 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_15 = __pyx_t_16(__pyx_t_14);
if (unlikely(!__pyx_t_15)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -55422,7 +55613,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -55435,14 +55626,14 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_2);
#else
- __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_10 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__pyx_t_17 = Py_TYPE(__pyx_t_10)->tp_iternext;
@@ -55450,7 +55641,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_2 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L61_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_17 = NULL;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L62_unpacking_done;
@@ -55458,7 +55649,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_17 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L62_unpacking_done:;
}
__Pyx_XDECREF(__pyx_v_phrase2);
@@ -55468,40 +55659,40 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_v_eindexes = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1675
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1681
* reason_for_failure = "Didn't extract anything from [%d, %d] -> [%d, %d]" % (f_back_low, f_back_high, e_low, e_high)
* for (phrase2,eindexes) in phrase_list:
* als1 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<<
* extracts.append((fphr, phrase2, pair_count, tuple(als1)))
- *
+ * if (num_gaps < self.max_nonterminals and
*/
__pyx_t_15 = ((PyObject *)__pyx_v_self->findexes);
__Pyx_INCREF(__pyx_t_15);
- __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_15, __pyx_v_eindexes)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_15, __pyx_v_eindexes)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_XDECREF(((PyObject *)__pyx_v_als1));
__pyx_v_als1 = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1676
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1682
* for (phrase2,eindexes) in phrase_list:
* als1 = self.create_alignments(sent_links,num_links,self.findexes,eindexes)
* extracts.append((fphr, phrase2, pair_count, tuple(als1))) # <<<<<<<<<<<<<<
- *
* if (num_gaps < self.max_nonterminals and
+ * phrase_len < self.max_length and
*/
- __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(((PyObject *)__pyx_v_als1));
PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_als1));
__Pyx_GIVEREF(((PyObject *)__pyx_v_als1));
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
- __pyx_t_15 = PyTuple_New(4); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(4); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(((PyObject *)__pyx_v_fphr));
PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_fphr));
@@ -55515,7 +55706,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_extracts, ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_extracts, ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -55525,9 +55716,9 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L57:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1678
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1683
+ * als1 = self.create_alignments(sent_links,num_links,self.findexes,eindexes)
* extracts.append((fphr, phrase2, pair_count, tuple(als1)))
- *
* if (num_gaps < self.max_nonterminals and # <<<<<<<<<<<<<<
* phrase_len < self.max_length and
* f_back_high - f_back_low + self.train_min_gap_size <= self.train_max_initial_size):
@@ -55535,8 +55726,8 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = (__pyx_v_num_gaps < __pyx_v_self->max_nonterminals);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1679
- *
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1684
+ * extracts.append((fphr, phrase2, pair_count, tuple(als1)))
* if (num_gaps < self.max_nonterminals and
* phrase_len < self.max_length and # <<<<<<<<<<<<<<
* f_back_high - f_back_low + self.train_min_gap_size <= self.train_max_initial_size):
@@ -55545,7 +55736,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_7 = (__pyx_v_phrase_len < __pyx_v_self->max_length);
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1680
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1685
* if (num_gaps < self.max_nonterminals and
* phrase_len < self.max_length and
* f_back_high - f_back_low + self.train_min_gap_size <= self.train_max_initial_size): # <<<<<<<<<<<<<<
@@ -55563,7 +55754,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1681
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1686
* phrase_len < self.max_length and
* f_back_high - f_back_low + self.train_min_gap_size <= self.train_max_initial_size):
* if (f_back_low == f_low and # <<<<<<<<<<<<<<
@@ -55573,7 +55764,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_7 = (__pyx_v_f_back_low == __pyx_v_f_low);
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1682
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1687
* f_back_high - f_back_low + self.train_min_gap_size <= self.train_max_initial_size):
* if (f_back_low == f_low and
* f_low >= self.train_min_gap_size and # <<<<<<<<<<<<<<
@@ -55583,7 +55774,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = (__pyx_v_f_low >= __pyx_v_self->train_min_gap_size);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1683
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1688
* if (f_back_low == f_low and
* f_low >= self.train_min_gap_size and
* ((not self.tight_phrases) or (f_links_low[f_low-1] != -1 and f_links_low[f_back_high-1] != -1))): # <<<<<<<<<<<<<<
@@ -55613,7 +55804,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1684
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1689
* f_low >= self.train_min_gap_size and
* ((not self.tight_phrases) or (f_links_low[f_low-1] != -1 and f_links_low[f_back_high-1] != -1))):
* f_x_low = f_low-self.train_min_gap_size # <<<<<<<<<<<<<<
@@ -55622,7 +55813,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_x_low = (__pyx_v_f_low - __pyx_v_self->train_min_gap_size);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1685
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1690
* ((not self.tight_phrases) or (f_links_low[f_low-1] != -1 and f_links_low[f_back_high-1] != -1))):
* f_x_low = f_low-self.train_min_gap_size
* met_constraints = 1 # <<<<<<<<<<<<<<
@@ -55631,7 +55822,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_met_constraints = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1686
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1691
* f_x_low = f_low-self.train_min_gap_size
* met_constraints = 1
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -55640,7 +55831,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_self->tight_phrases) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1687
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1692
* met_constraints = 1
* if self.tight_phrases:
* while f_x_low >= 0 and f_links_low[f_x_low] == -1: # <<<<<<<<<<<<<<
@@ -55657,7 +55848,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (!__pyx_t_18) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1688
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1693
* if self.tight_phrases:
* while f_x_low >= 0 and f_links_low[f_x_low] == -1:
* f_x_low = f_x_low - 1 # <<<<<<<<<<<<<<
@@ -55670,7 +55861,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L65:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1689
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1694
* while f_x_low >= 0 and f_links_low[f_x_low] == -1:
* f_x_low = f_x_low - 1
* if f_x_low < 0 or f_back_high - f_x_low > self.train_max_initial_size: # <<<<<<<<<<<<<<
@@ -55686,7 +55877,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1690
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1695
* f_x_low = f_x_low - 1
* if f_x_low < 0 or f_back_high - f_x_low > self.train_max_initial_size:
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -55698,7 +55889,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L68:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1692
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1697
* met_constraints = 0
*
* if (met_constraints and # <<<<<<<<<<<<<<
@@ -55707,17 +55898,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_met_constraints) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1693
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1698
*
* if (met_constraints and
* self.find_fixpoint(f_x_low, f_back_high, # <<<<<<<<<<<<<<
* f_links_low, f_links_high, e_links_low, e_links_high,
* e_low, e_high, &e_x_low, &e_x_high, &f_x_low, &f_x_high,
*/
- __pyx_t_14 = PyInt_FromLong(__pyx_v_f_back_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyInt_FromLong(__pyx_v_f_back_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1697
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1702
* e_low, e_high, &e_x_low, &e_x_high, &f_x_low, &f_x_high,
* f_sent_len, e_sent_len,
* self.train_max_initial_size, self.train_max_initial_size, # <<<<<<<<<<<<<<
@@ -55727,7 +55918,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
if (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_x_low, __pyx_t_14, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 1, 1, 0, 1, 0)) {
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1699
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1704
* self.train_max_initial_size, self.train_max_initial_size,
* 1, 1, 1, 1, 0, 1, 0) and
* ((not self.tight_phrases) or f_links_low[f_x_low] != -1) and # <<<<<<<<<<<<<<
@@ -55743,17 +55934,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1700
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1705
* 1, 1, 1, 1, 0, 1, 0) and
* ((not self.tight_phrases) or f_links_low[f_x_low] != -1) and
* self.find_fixpoint(f_x_low, f_low, # check integrity of new subphrase # <<<<<<<<<<<<<<
* f_links_low, f_links_high, e_links_low, e_links_high,
* -1, -1, e_gap_low, e_gap_high, f_gap_low, f_gap_high,
*/
- __pyx_t_1 = PyInt_FromLong(__pyx_v_f_low); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_f_low); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1704
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1709
* -1, -1, e_gap_low, e_gap_high, f_gap_low, f_gap_high,
* f_sent_len, e_sent_len,
* self.train_max_initial_size, self.train_max_initial_size, # <<<<<<<<<<<<<<
@@ -55776,7 +55967,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1706
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1711
* self.train_max_initial_size, self.train_max_initial_size,
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear() # <<<<<<<<<<<<<<
@@ -55785,7 +55976,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1707
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1712
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear()
* i = 1 # <<<<<<<<<<<<<<
@@ -55794,35 +55985,35 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_i = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1708
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1713
* fphr_arr._clear()
* i = 1
* self.findexes.reset() # <<<<<<<<<<<<<<
* self.findexes.append(sym_setindex(self.category, i))
* fphr_arr._append(sym_setindex(self.category, i))
*/
- __pyx_t_14 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
- __pyx_t_1 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1709
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1714
* i = 1
* self.findexes.reset()
* self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1
*/
- __pyx_t_1 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_14 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1710
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1715
* self.findexes.reset()
* self.findexes.append(sym_setindex(self.category, i))
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -55831,7 +56022,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1711
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1716
* self.findexes.append(sym_setindex(self.category, i))
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1 # <<<<<<<<<<<<<<
@@ -55840,27 +56031,27 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_i = (__pyx_v_i + 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1712
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1717
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1
* self.findexes.extend(self.findexes1) # <<<<<<<<<<<<<<
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]):
*/
- __pyx_t_14 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_self->findexes1));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->findexes1));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->findexes1));
- __pyx_t_15 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_Call(__pyx_t_14, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1713
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1718
* i = i+1
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<<
@@ -55870,7 +56061,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_3 = __pyx_v_phrase->n;
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1714
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1719
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<<
@@ -55880,7 +56071,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_4 = __pyx_f_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j]));
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1715
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1720
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -55889,7 +56080,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1716
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1721
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i))
* i = i + 1 # <<<<<<<<<<<<<<
@@ -55901,7 +56092,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1718
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1723
* i = i + 1
* else:
* fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<<
@@ -55913,7 +56104,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_L72:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1719
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1724
* else:
* fphr_arr._append(phrase.syms[j])
* if f_back_high > f_high: # <<<<<<<<<<<<<<
@@ -55923,7 +56114,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_7 = (__pyx_v_f_back_high > __pyx_v_f_high);
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1720
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1725
* fphr_arr._append(phrase.syms[j])
* if f_back_high > f_high:
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -55932,16 +56123,16 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1721
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1726
* if f_back_high > f_high:
* fphr_arr._append(sym_setindex(self.category, i))
* self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
* fphr = Phrase(fphr_arr)
* phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low, e_gap_high, e_links_low, num_gaps+1,
*/
- __pyx_t_15 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_15); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_15); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -55949,67 +56140,67 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L73:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1722
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1727
* fphr_arr._append(sym_setindex(self.category, i))
* self.findexes.append(sym_setindex(self.category, i))
* fphr = Phrase(fphr_arr) # <<<<<<<<<<<<<<
* phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low, e_gap_high, e_links_low, num_gaps+1,
* f_x_low, f_x_high, f_gap_low, f_gap_high, f_links_low, matching.sent_id,
*/
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_fphr_arr));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_fphr_arr));
__Pyx_GIVEREF(((PyObject *)__pyx_v_fphr_arr));
- __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_v_fphr));
__pyx_v_fphr = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_15);
__pyx_t_15 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1725
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1730
* phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low, e_gap_high, e_links_low, num_gaps+1,
* f_x_low, f_x_high, f_gap_low, f_gap_high, f_links_low, matching.sent_id,
* e_sent_len, e_sent_start) # <<<<<<<<<<<<<<
* if len(phrase_list) > 0:
* pair_count = 1.0 / len(phrase_list)
*/
- __pyx_t_15 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->extract_phrases(__pyx_v_self, __pyx_v_e_x_low, __pyx_v_e_x_high, __pyx_v_e_gap_low, __pyx_v_e_gap_high, __pyx_v_e_links_low, (__pyx_v_num_gaps + 1), __pyx_v_f_x_low, __pyx_v_f_x_high, __pyx_v_f_gap_low, __pyx_v_f_gap_high, __pyx_v_f_links_low, __pyx_v_matching->sent_id, __pyx_v_e_sent_len, __pyx_v_e_sent_start); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->extract_phrases(__pyx_v_self, __pyx_v_e_x_low, __pyx_v_e_x_high, __pyx_v_e_gap_low, __pyx_v_e_gap_high, __pyx_v_e_links_low, (__pyx_v_num_gaps + 1), __pyx_v_f_x_low, __pyx_v_f_x_high, __pyx_v_f_gap_low, __pyx_v_f_gap_high, __pyx_v_f_links_low, __pyx_v_matching->sent_id, __pyx_v_e_sent_len, __pyx_v_e_sent_start); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_XDECREF(__pyx_v_phrase_list);
__pyx_v_phrase_list = __pyx_t_15;
__pyx_t_15 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1726
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1731
* f_x_low, f_x_high, f_gap_low, f_gap_high, f_links_low, matching.sent_id,
* e_sent_len, e_sent_start)
* if len(phrase_list) > 0: # <<<<<<<<<<<<<<
* pair_count = 1.0 / len(phrase_list)
* else:
*/
- __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_7 = (__pyx_t_13 > 0);
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1727
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1732
* e_sent_len, e_sent_start)
* if len(phrase_list) > 0:
* pair_count = 1.0 / len(phrase_list) # <<<<<<<<<<<<<<
* else:
* pair_count = 0
*/
- __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(__pyx_t_13 == 0)) {
PyErr_Format(PyExc_ZeroDivisionError, "float division");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_v_pair_count = (1.0 / __pyx_t_13);
goto __pyx_L74;
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1729
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1734
* pair_count = 1.0 / len(phrase_list)
* else:
* pair_count = 0 # <<<<<<<<<<<<<<
@@ -56020,7 +56211,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L74:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1730
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1735
* else:
* pair_count = 0
* for phrase2,eindexes in phrase_list: # <<<<<<<<<<<<<<
@@ -56031,7 +56222,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_15 = __pyx_v_phrase_list; __Pyx_INCREF(__pyx_t_15); __pyx_t_13 = 0;
__pyx_t_16 = NULL;
} else {
- __pyx_t_13 = -1; __pyx_t_15 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = -1; __pyx_t_15 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__pyx_t_16 = Py_TYPE(__pyx_t_15)->tp_iternext;
}
@@ -56039,23 +56230,23 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_15)) {
if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_15)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_15, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_15, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_15, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_15)) {
if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_15)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_15, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_15, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_15, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_1 = __pyx_t_16(__pyx_t_15);
if (unlikely(!__pyx_t_1)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -56071,7 +56262,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -56084,14 +56275,14 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_INCREF(__pyx_t_14);
__Pyx_INCREF(__pyx_t_2);
#else
- __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_17 = Py_TYPE(__pyx_t_10)->tp_iternext;
@@ -56099,7 +56290,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_GOTREF(__pyx_t_14);
index = 1; __pyx_t_2 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L77_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_17 = NULL;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L78_unpacking_done;
@@ -56107,7 +56298,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_17 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L78_unpacking_done:;
}
__Pyx_XDECREF(__pyx_v_phrase2);
@@ -56117,7 +56308,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_v_eindexes = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1731
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1736
* pair_count = 0
* for phrase2,eindexes in phrase_list:
* als2 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<<
@@ -56126,31 +56317,31 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_t_1 = ((PyObject *)__pyx_v_self->findexes);
__Pyx_INCREF(__pyx_t_1);
- __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_1, __pyx_v_eindexes)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_1, __pyx_v_eindexes)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(((PyObject *)__pyx_v_als2));
__pyx_v_als2 = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1732
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1737
* for phrase2,eindexes in phrase_list:
* als2 = self.create_alignments(sent_links,num_links,self.findexes,eindexes)
* extracts.append((fphr, phrase2, pair_count, tuple(als2))) # <<<<<<<<<<<<<<
*
* if (f_back_high == f_high and
*/
- __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_als2));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_als2));
__Pyx_GIVEREF(((PyObject *)__pyx_v_als2));
- __pyx_t_14 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_fphr));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_fphr));
@@ -56164,7 +56355,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_GIVEREF(__pyx_t_14);
__pyx_t_2 = 0;
__pyx_t_14 = 0;
- __pyx_t_14 = __Pyx_PyObject_Append(__pyx_v_extracts, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_Append(__pyx_v_extracts, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
@@ -56177,7 +56368,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L64:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1734
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1739
* extracts.append((fphr, phrase2, pair_count, tuple(als2)))
*
* if (f_back_high == f_high and # <<<<<<<<<<<<<<
@@ -56187,7 +56378,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_7 = (__pyx_v_f_back_high == __pyx_v_f_high);
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1735
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1740
*
* if (f_back_high == f_high and
* f_sent_len - f_high >= self.train_min_gap_size and # <<<<<<<<<<<<<<
@@ -56197,7 +56388,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = ((__pyx_v_f_sent_len - __pyx_v_f_high) >= __pyx_v_self->train_min_gap_size);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1736
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1741
* if (f_back_high == f_high and
* f_sent_len - f_high >= self.train_min_gap_size and
* ((not self.tight_phrases) or (f_links_low[f_high] != -1 and f_links_low[f_back_low] != -1))): # <<<<<<<<<<<<<<
@@ -56227,7 +56418,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1737
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1742
* f_sent_len - f_high >= self.train_min_gap_size and
* ((not self.tight_phrases) or (f_links_low[f_high] != -1 and f_links_low[f_back_low] != -1))):
* f_x_high = f_high+self.train_min_gap_size # <<<<<<<<<<<<<<
@@ -56236,7 +56427,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_x_high = (__pyx_v_f_high + __pyx_v_self->train_min_gap_size);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1738
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1743
* ((not self.tight_phrases) or (f_links_low[f_high] != -1 and f_links_low[f_back_low] != -1))):
* f_x_high = f_high+self.train_min_gap_size
* met_constraints = 1 # <<<<<<<<<<<<<<
@@ -56245,7 +56436,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_met_constraints = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1739
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1744
* f_x_high = f_high+self.train_min_gap_size
* met_constraints = 1
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -56254,7 +56445,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_self->tight_phrases) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1740
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1745
* met_constraints = 1
* if self.tight_phrases:
* while f_x_high <= f_sent_len and f_links_low[f_x_high-1] == -1: # <<<<<<<<<<<<<<
@@ -56271,7 +56462,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (!__pyx_t_18) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1741
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1746
* if self.tight_phrases:
* while f_x_high <= f_sent_len and f_links_low[f_x_high-1] == -1:
* f_x_high = f_x_high + 1 # <<<<<<<<<<<<<<
@@ -56284,7 +56475,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L80:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1742
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1747
* while f_x_high <= f_sent_len and f_links_low[f_x_high-1] == -1:
* f_x_high = f_x_high + 1
* if f_x_high > f_sent_len or f_x_high - f_back_low > self.train_max_initial_size: # <<<<<<<<<<<<<<
@@ -56300,7 +56491,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1743
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1748
* f_x_high = f_x_high + 1
* if f_x_high > f_sent_len or f_x_high - f_back_low > self.train_max_initial_size:
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -56312,7 +56503,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L83:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1745
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1750
* met_constraints = 0
*
* if (met_constraints and # <<<<<<<<<<<<<<
@@ -56321,17 +56512,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_met_constraints) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1746
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1751
*
* if (met_constraints and
* self.find_fixpoint(f_back_low, f_x_high, # <<<<<<<<<<<<<<
* f_links_low, f_links_high, e_links_low, e_links_high,
* e_low, e_high, &e_x_low, &e_x_high, &f_x_low, &f_x_high,
*/
- __pyx_t_15 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1750
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1755
* e_low, e_high, &e_x_low, &e_x_high, &f_x_low, &f_x_high,
* f_sent_len, e_sent_len,
* self.train_max_initial_size, self.train_max_initial_size, # <<<<<<<<<<<<<<
@@ -56341,7 +56532,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
if (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_back_low, __pyx_t_15, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 1, 0, 1, 1, 0)) {
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1752
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1757
* self.train_max_initial_size, self.train_max_initial_size,
* 1, 1, 1, 0, 1, 1, 0) and
* ((not self.tight_phrases) or f_links_low[f_x_high-1] != -1) and # <<<<<<<<<<<<<<
@@ -56357,17 +56548,17 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1753
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1758
* 1, 1, 1, 0, 1, 1, 0) and
* ((not self.tight_phrases) or f_links_low[f_x_high-1] != -1) and
* self.find_fixpoint(f_high, f_x_high, # <<<<<<<<<<<<<<
* f_links_low, f_links_high, e_links_low, e_links_high,
* -1, -1, e_gap_low+gap_start+num_gaps, e_gap_high+gap_start+num_gaps,
*/
- __pyx_t_14 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1758
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1763
* f_gap_low+gap_start+num_gaps, f_gap_high+gap_start+num_gaps,
* f_sent_len, e_sent_len,
* self.train_max_initial_size, self.train_max_initial_size, # <<<<<<<<<<<<<<
@@ -56390,7 +56581,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1760
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1765
* self.train_max_initial_size, self.train_max_initial_size,
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear() # <<<<<<<<<<<<<<
@@ -56399,7 +56590,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1761
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1766
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear()
* i = 1 # <<<<<<<<<<<<<<
@@ -56408,21 +56599,21 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_i = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1762
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1767
* fphr_arr._clear()
* i = 1
* self.findexes.reset() # <<<<<<<<<<<<<<
* if f_back_low < f_low:
* fphr_arr._append(sym_setindex(self.category, i))
*/
- __pyx_t_15 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_14 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1763
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1768
* i = 1
* self.findexes.reset()
* if f_back_low < f_low: # <<<<<<<<<<<<<<
@@ -56432,7 +56623,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_7 = (__pyx_v_f_back_low < __pyx_v_f_low);
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1764
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1769
* self.findexes.reset()
* if f_back_low < f_low:
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -56441,7 +56632,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1765
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1770
* if f_back_low < f_low:
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1 # <<<<<<<<<<<<<<
@@ -56450,16 +56641,16 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_i = (__pyx_v_i + 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1766
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1771
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1
* self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n:
*/
- __pyx_t_14 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
- __pyx_t_15 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_14); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_14); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
@@ -56467,27 +56658,27 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L85:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1767
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1772
* i = i+1
* self.findexes.append(sym_setindex(self.category, i))
* self.findexes.extend(self.findexes1) # <<<<<<<<<<<<<<
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]):
*/
- __pyx_t_15 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_INCREF(((PyObject *)__pyx_v_self->findexes1));
PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_v_self->findexes1));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->findexes1));
- __pyx_t_1 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1768
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1773
* self.findexes.append(sym_setindex(self.category, i))
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<<
@@ -56497,7 +56688,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_3 = __pyx_v_phrase->n;
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1769
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1774
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<<
@@ -56507,7 +56698,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_4 = __pyx_f_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j]));
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1770
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1775
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -56516,7 +56707,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1771
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1776
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i))
* i = i + 1 # <<<<<<<<<<<<<<
@@ -56528,7 +56719,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1773
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1778
* i = i + 1
* else:
* fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<<
@@ -56540,7 +56731,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_L88:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1774
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1779
* else:
* fphr_arr._append(phrase.syms[j])
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -56549,81 +56740,81 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1775
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1780
* fphr_arr._append(phrase.syms[j])
* fphr_arr._append(sym_setindex(self.category, i))
* self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
* fphr = Phrase(fphr_arr)
* phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low+gap_start, e_gap_high+gap_start, e_links_low, num_gaps+1,
*/
- __pyx_t_1 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_14 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1776
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1781
* fphr_arr._append(sym_setindex(self.category, i))
* self.findexes.append(sym_setindex(self.category, i))
* fphr = Phrase(fphr_arr) # <<<<<<<<<<<<<<
* phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low+gap_start, e_gap_high+gap_start, e_links_low, num_gaps+1,
* f_x_low, f_x_high, f_gap_low+gap_start, f_gap_high+gap_start, f_links_low,
*/
- __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_INCREF(((PyObject *)__pyx_v_fphr_arr));
PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_v_fphr_arr));
__Pyx_GIVEREF(((PyObject *)__pyx_v_fphr_arr));
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1776; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
__Pyx_DECREF(((PyObject *)__pyx_v_fphr));
__pyx_v_fphr = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1779
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1784
* phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low+gap_start, e_gap_high+gap_start, e_links_low, num_gaps+1,
* f_x_low, f_x_high, f_gap_low+gap_start, f_gap_high+gap_start, f_links_low,
* matching.sent_id, e_sent_len, e_sent_start) # <<<<<<<<<<<<<<
* if len(phrase_list) > 0:
* pair_count = 1.0 / len(phrase_list)
*/
- __pyx_t_1 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->extract_phrases(__pyx_v_self, __pyx_v_e_x_low, __pyx_v_e_x_high, (__pyx_v_e_gap_low + __pyx_v_gap_start), (__pyx_v_e_gap_high + __pyx_v_gap_start), __pyx_v_e_links_low, (__pyx_v_num_gaps + 1), __pyx_v_f_x_low, __pyx_v_f_x_high, (__pyx_v_f_gap_low + __pyx_v_gap_start), (__pyx_v_f_gap_high + __pyx_v_gap_start), __pyx_v_f_links_low, __pyx_v_matching->sent_id, __pyx_v_e_sent_len, __pyx_v_e_sent_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1777; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->extract_phrases(__pyx_v_self, __pyx_v_e_x_low, __pyx_v_e_x_high, (__pyx_v_e_gap_low + __pyx_v_gap_start), (__pyx_v_e_gap_high + __pyx_v_gap_start), __pyx_v_e_links_low, (__pyx_v_num_gaps + 1), __pyx_v_f_x_low, __pyx_v_f_x_high, (__pyx_v_f_gap_low + __pyx_v_gap_start), (__pyx_v_f_gap_high + __pyx_v_gap_start), __pyx_v_f_links_low, __pyx_v_matching->sent_id, __pyx_v_e_sent_len, __pyx_v_e_sent_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1782; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_v_phrase_list);
__pyx_v_phrase_list = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1780
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1785
* f_x_low, f_x_high, f_gap_low+gap_start, f_gap_high+gap_start, f_links_low,
* matching.sent_id, e_sent_len, e_sent_start)
* if len(phrase_list) > 0: # <<<<<<<<<<<<<<
* pair_count = 1.0 / len(phrase_list)
* else:
*/
- __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_7 = (__pyx_t_13 > 0);
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1781
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1786
* matching.sent_id, e_sent_len, e_sent_start)
* if len(phrase_list) > 0:
* pair_count = 1.0 / len(phrase_list) # <<<<<<<<<<<<<<
* else:
* pair_count = 0
*/
- __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(__pyx_t_13 == 0)) {
PyErr_Format(PyExc_ZeroDivisionError, "float division");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_v_pair_count = (1.0 / __pyx_t_13);
goto __pyx_L89;
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1783
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1788
* pair_count = 1.0 / len(phrase_list)
* else:
* pair_count = 0 # <<<<<<<<<<<<<<
@@ -56634,7 +56825,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L89:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1784
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1789
* else:
* pair_count = 0
* for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<<
@@ -56645,7 +56836,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_1 = __pyx_v_phrase_list; __Pyx_INCREF(__pyx_t_1); __pyx_t_13 = 0;
__pyx_t_16 = NULL;
} else {
- __pyx_t_13 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_16 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -56653,23 +56844,23 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_14 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_14); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_14); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_14 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_14); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_14); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_14 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_14 = __pyx_t_16(__pyx_t_1);
if (unlikely(!__pyx_t_14)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -56685,7 +56876,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -56698,14 +56889,14 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_INCREF(__pyx_t_15);
__Pyx_INCREF(__pyx_t_2);
#else
- __pyx_t_15 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_10 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__pyx_t_17 = Py_TYPE(__pyx_t_10)->tp_iternext;
@@ -56713,7 +56904,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_GOTREF(__pyx_t_15);
index = 1; __pyx_t_2 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L92_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_17 = NULL;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L93_unpacking_done;
@@ -56721,7 +56912,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_17 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L93_unpacking_done:;
}
__Pyx_XDECREF(__pyx_v_phrase2);
@@ -56731,7 +56922,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_v_eindexes = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1785
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1790
* pair_count = 0
* for phrase2, eindexes in phrase_list:
* als3 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<<
@@ -56740,31 +56931,31 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_t_14 = ((PyObject *)__pyx_v_self->findexes);
__Pyx_INCREF(__pyx_t_14);
- __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_14, __pyx_v_eindexes)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_14, __pyx_v_eindexes)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_XDECREF(((PyObject *)__pyx_v_als3));
__pyx_v_als3 = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1786
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1791
* for phrase2, eindexes in phrase_list:
* als3 = self.create_alignments(sent_links,num_links,self.findexes,eindexes)
* extracts.append((fphr, phrase2, pair_count, tuple(als3))) # <<<<<<<<<<<<<<
* if (num_gaps < self.max_nonterminals - 1 and
* phrase_len+1 < self.max_length and
*/
- __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_INCREF(((PyObject *)__pyx_v_als3));
PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_v_als3));
__Pyx_GIVEREF(((PyObject *)__pyx_v_als3));
- __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
- __pyx_t_14 = PyTuple_New(4); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyTuple_New(4); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_INCREF(((PyObject *)__pyx_v_fphr));
PyTuple_SET_ITEM(__pyx_t_14, 0, ((PyObject *)__pyx_v_fphr));
@@ -56778,7 +56969,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_GIVEREF(__pyx_t_15);
__pyx_t_2 = 0;
__pyx_t_15 = 0;
- __pyx_t_15 = __Pyx_PyObject_Append(__pyx_v_extracts, ((PyObject *)__pyx_t_14)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyObject_Append(__pyx_v_extracts, ((PyObject *)__pyx_t_14)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
@@ -56791,7 +56982,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L79:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1787
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1792
* als3 = self.create_alignments(sent_links,num_links,self.findexes,eindexes)
* extracts.append((fphr, phrase2, pair_count, tuple(als3)))
* if (num_gaps < self.max_nonterminals - 1 and # <<<<<<<<<<<<<<
@@ -56801,7 +56992,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_7 = (__pyx_v_num_gaps < (__pyx_v_self->max_nonterminals - 1));
if (__pyx_t_7) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1788
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1793
* extracts.append((fphr, phrase2, pair_count, tuple(als3)))
* if (num_gaps < self.max_nonterminals - 1 and
* phrase_len+1 < self.max_length and # <<<<<<<<<<<<<<
@@ -56811,7 +57002,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_9 = ((__pyx_v_phrase_len + 1) < __pyx_v_self->max_length);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1789
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1794
* if (num_gaps < self.max_nonterminals - 1 and
* phrase_len+1 < self.max_length and
* f_back_high == f_high and # <<<<<<<<<<<<<<
@@ -56821,7 +57012,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_18 = (__pyx_v_f_back_high == __pyx_v_f_high);
if (__pyx_t_18) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1790
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1795
* phrase_len+1 < self.max_length and
* f_back_high == f_high and
* f_back_low == f_low and # <<<<<<<<<<<<<<
@@ -56831,7 +57022,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_8 = (__pyx_v_f_back_low == __pyx_v_f_low);
if (__pyx_t_8) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1791
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1796
* f_back_high == f_high and
* f_back_low == f_low and
* f_back_high - f_back_low + (2*self.train_min_gap_size) <= self.train_max_initial_size and # <<<<<<<<<<<<<<
@@ -56841,7 +57032,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_19 = (((__pyx_v_f_back_high - __pyx_v_f_back_low) + (2 * __pyx_v_self->train_min_gap_size)) <= __pyx_v_self->train_max_initial_size);
if (__pyx_t_19) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1792
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1797
* f_back_low == f_low and
* f_back_high - f_back_low + (2*self.train_min_gap_size) <= self.train_max_initial_size and
* f_low >= self.train_min_gap_size and # <<<<<<<<<<<<<<
@@ -56851,7 +57042,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_20 = (__pyx_v_f_low >= __pyx_v_self->train_min_gap_size);
if (__pyx_t_20) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1793
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1798
* f_back_high - f_back_low + (2*self.train_min_gap_size) <= self.train_max_initial_size and
* f_low >= self.train_min_gap_size and
* f_high <= f_sent_len - self.train_min_gap_size and # <<<<<<<<<<<<<<
@@ -56861,7 +57052,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_21 = (__pyx_v_f_high <= (__pyx_v_f_sent_len - __pyx_v_self->train_min_gap_size));
if (__pyx_t_21) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1794
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1799
* f_low >= self.train_min_gap_size and
* f_high <= f_sent_len - self.train_min_gap_size and
* ((not self.tight_phrases) or (f_links_low[f_low-1] != -1 and f_links_low[f_high] != -1))): # <<<<<<<<<<<<<<
@@ -56911,7 +57102,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1796
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1801
* ((not self.tight_phrases) or (f_links_low[f_low-1] != -1 and f_links_low[f_high] != -1))):
*
* met_constraints = 1 # <<<<<<<<<<<<<<
@@ -56920,7 +57111,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_met_constraints = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1797
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1802
*
* met_constraints = 1
* f_x_low = f_low-self.train_min_gap_size # <<<<<<<<<<<<<<
@@ -56929,7 +57120,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_x_low = (__pyx_v_f_low - __pyx_v_self->train_min_gap_size);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1798
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1803
* met_constraints = 1
* f_x_low = f_low-self.train_min_gap_size
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -56938,7 +57129,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_self->tight_phrases) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1799
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1804
* f_x_low = f_low-self.train_min_gap_size
* if self.tight_phrases:
* while f_x_low >= 0 and f_links_low[f_x_low] == -1: # <<<<<<<<<<<<<<
@@ -56955,7 +57146,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (!__pyx_t_18) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1800
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1805
* if self.tight_phrases:
* while f_x_low >= 0 and f_links_low[f_x_low] == -1:
* f_x_low = f_x_low - 1 # <<<<<<<<<<<<<<
@@ -56968,7 +57159,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L95:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1801
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1806
* while f_x_low >= 0 and f_links_low[f_x_low] == -1:
* f_x_low = f_x_low - 1
* if f_x_low < 0: # <<<<<<<<<<<<<<
@@ -56978,7 +57169,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_18 = (__pyx_v_f_x_low < 0);
if (__pyx_t_18) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1802
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1807
* f_x_low = f_x_low - 1
* if f_x_low < 0:
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -56990,7 +57181,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L98:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1804
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1809
* met_constraints = 0
*
* f_x_high = f_high+self.train_min_gap_size # <<<<<<<<<<<<<<
@@ -56999,7 +57190,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_f_x_high = (__pyx_v_f_high + __pyx_v_self->train_min_gap_size);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1805
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1810
*
* f_x_high = f_high+self.train_min_gap_size
* if self.tight_phrases: # <<<<<<<<<<<<<<
@@ -57008,7 +57199,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
if (__pyx_v_self->tight_phrases) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1806
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1811
* f_x_high = f_high+self.train_min_gap_size
* if self.tight_phrases:
* while f_x_high <= f_sent_len and f_links_low[f_x_high-1] == -1: # <<<<<<<<<<<<<<
@@ -57025,7 +57216,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (!__pyx_t_7) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1807
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1812
* if self.tight_phrases:
* while f_x_high <= f_sent_len and f_links_low[f_x_high-1] == -1:
* f_x_high = f_x_high + 1 # <<<<<<<<<<<<<<
@@ -57038,7 +57229,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L99:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1808
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1813
* while f_x_high <= f_sent_len and f_links_low[f_x_high-1] == -1:
* f_x_high = f_x_high + 1
* if f_x_high > f_sent_len or f_x_high - f_x_low > self.train_max_initial_size: # <<<<<<<<<<<<<<
@@ -57054,7 +57245,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1809
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1814
* f_x_high = f_x_high + 1
* if f_x_high > f_sent_len or f_x_high - f_x_low > self.train_max_initial_size:
* met_constraints = 0 # <<<<<<<<<<<<<<
@@ -57066,117 +57257,117 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L102:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1811
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1816
* met_constraints = 0
*
* if (met_constraints and # <<<<<<<<<<<<<<
- * self.find_fixpoint(f_x_low, f_x_high,
+ * (self.find_fixpoint(f_x_low, f_x_high,
* f_links_low, f_links_high, e_links_low, e_links_high,
*/
if (__pyx_v_met_constraints) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1812
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1817
*
* if (met_constraints and
- * self.find_fixpoint(f_x_low, f_x_high, # <<<<<<<<<<<<<<
+ * (self.find_fixpoint(f_x_low, f_x_high, # <<<<<<<<<<<<<<
* f_links_low, f_links_high, e_links_low, e_links_high,
* e_low, e_high, &e_x_low, &e_x_high, &f_x_low, &f_x_high,
*/
- __pyx_t_1 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1816
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1821
* e_low, e_high, &e_x_low, &e_x_high, &f_x_low, &f_x_high,
* f_sent_len, e_sent_len,
* self.train_max_initial_size, self.train_max_initial_size, # <<<<<<<<<<<<<<
- * 1, 1, 2, 1, 1, 1, 1) and
+ * 1, 1, 2, 1, 1, 1, 1) == 1) and
* ((not self.tight_phrases) or (f_links_low[f_x_low] != -1 and f_links_low[f_x_high-1] != -1)) and
*/
- if (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_x_low, __pyx_t_1, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 2, 1, 1, 1, 1)) {
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_9 = (((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_x_low, __pyx_t_1, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 2, 1, 1, 1, 1) == 1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1818
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1823
* self.train_max_initial_size, self.train_max_initial_size,
- * 1, 1, 2, 1, 1, 1, 1) and
+ * 1, 1, 2, 1, 1, 1, 1) == 1) and
* ((not self.tight_phrases) or (f_links_low[f_x_low] != -1 and f_links_low[f_x_high-1] != -1)) and # <<<<<<<<<<<<<<
* self.find_fixpoint(f_x_low, f_low,
* f_links_low, f_links_high, e_links_low, e_links_high,
*/
- __pyx_t_9 = (!__pyx_v_self->tight_phrases);
- if (!__pyx_t_9) {
- __pyx_t_7 = ((__pyx_v_f_links_low[__pyx_v_f_x_low]) != -1);
- if (__pyx_t_7) {
- __pyx_t_18 = ((__pyx_v_f_links_low[(__pyx_v_f_x_high - 1)]) != -1);
- __pyx_t_8 = __pyx_t_18;
+ __pyx_t_7 = (!__pyx_v_self->tight_phrases);
+ if (!__pyx_t_7) {
+ __pyx_t_18 = ((__pyx_v_f_links_low[__pyx_v_f_x_low]) != -1);
+ if (__pyx_t_18) {
+ __pyx_t_8 = ((__pyx_v_f_links_low[(__pyx_v_f_x_high - 1)]) != -1);
+ __pyx_t_19 = __pyx_t_8;
} else {
- __pyx_t_8 = __pyx_t_7;
+ __pyx_t_19 = __pyx_t_18;
}
- __pyx_t_7 = __pyx_t_8;
+ __pyx_t_18 = __pyx_t_19;
} else {
- __pyx_t_7 = __pyx_t_9;
+ __pyx_t_18 = __pyx_t_7;
}
- if (__pyx_t_7) {
+ if (__pyx_t_18) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1819
- * 1, 1, 2, 1, 1, 1, 1) and
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1824
+ * 1, 1, 2, 1, 1, 1, 1) == 1) and
* ((not self.tight_phrases) or (f_links_low[f_x_low] != -1 and f_links_low[f_x_high-1] != -1)) and
* self.find_fixpoint(f_x_low, f_low, # <<<<<<<<<<<<<<
* f_links_low, f_links_high, e_links_low, e_links_high,
* -1, -1, e_gap_low, e_gap_high, f_gap_low, f_gap_high,
*/
- __pyx_t_15 = PyInt_FromLong(__pyx_v_f_low); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_f_low); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1823
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1828
* -1, -1, e_gap_low, e_gap_high, f_gap_low, f_gap_high,
* f_sent_len, e_sent_len,
* self.train_max_initial_size, self.train_max_initial_size, # <<<<<<<<<<<<<<
* 0, 0, 0, 0, 0, 0, 0) and
* self.find_fixpoint(f_high, f_x_high,
*/
- __pyx_t_3 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_x_low, __pyx_t_15, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, -1, -1, __pyx_v_e_gap_low, __pyx_v_e_gap_high, __pyx_v_f_gap_low, __pyx_v_f_gap_high, __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 0, 0, 0, 0, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __pyx_t_3 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_x_low, __pyx_t_1, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, -1, -1, __pyx_v_e_gap_low, __pyx_v_e_gap_high, __pyx_v_f_gap_low, __pyx_v_f_gap_high, __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 0, 0, 0, 0, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1825
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1830
* self.train_max_initial_size, self.train_max_initial_size,
* 0, 0, 0, 0, 0, 0, 0) and
* self.find_fixpoint(f_high, f_x_high, # <<<<<<<<<<<<<<
* f_links_low, f_links_high, e_links_low, e_links_high,
* -1, -1, e_gap_low+1+num_gaps, e_gap_high+1+num_gaps,
*/
- __pyx_t_15 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_f_x_high); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1830
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1835
* f_gap_low+1+num_gaps, f_gap_high+1+num_gaps,
* f_sent_len, e_sent_len,
* self.train_max_initial_size, self.train_max_initial_size, # <<<<<<<<<<<<<<
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear()
*/
- __pyx_t_4 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_high, __pyx_t_15, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, -1, -1, ((__pyx_v_e_gap_low + 1) + __pyx_v_num_gaps), ((__pyx_v_e_gap_high + 1) + __pyx_v_num_gaps), ((__pyx_v_f_gap_low + 1) + __pyx_v_num_gaps), ((__pyx_v_f_gap_high + 1) + __pyx_v_num_gaps), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 0, 0, 0, 0, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_9 = __pyx_t_4;
+ __pyx_t_4 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_high, __pyx_t_1, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, -1, -1, ((__pyx_v_e_gap_low + 1) + __pyx_v_num_gaps), ((__pyx_v_e_gap_high + 1) + __pyx_v_num_gaps), ((__pyx_v_f_gap_low + 1) + __pyx_v_num_gaps), ((__pyx_v_f_gap_high + 1) + __pyx_v_num_gaps), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 0, 0, 0, 0, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_7 = __pyx_t_4;
} else {
- __pyx_t_9 = __pyx_t_3;
+ __pyx_t_7 = __pyx_t_3;
}
- __pyx_t_8 = __pyx_t_9;
+ __pyx_t_19 = __pyx_t_7;
} else {
- __pyx_t_8 = __pyx_t_7;
+ __pyx_t_19 = __pyx_t_18;
}
- __pyx_t_7 = __pyx_t_8;
+ __pyx_t_18 = __pyx_t_19;
} else {
- __pyx_t_7 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->find_fixpoint(__pyx_v_self, __pyx_v_f_x_low, __pyx_t_1, __pyx_v_f_links_low, __pyx_v_f_links_high, __pyx_v_e_links_low, __pyx_v_e_links_high, __pyx_v_e_low, __pyx_v_e_high, (&__pyx_v_e_x_low), (&__pyx_v_e_x_high), (&__pyx_v_f_x_low), (&__pyx_v_f_x_high), __pyx_v_f_sent_len, __pyx_v_e_sent_len, __pyx_v_self->train_max_initial_size, __pyx_v_self->train_max_initial_size, 1, 1, 2, 1, 1, 1, 1);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_18 = __pyx_t_9;
}
- __pyx_t_8 = __pyx_t_7;
+ __pyx_t_9 = __pyx_t_18;
} else {
- __pyx_t_8 = __pyx_v_met_constraints;
+ __pyx_t_9 = __pyx_v_met_constraints;
}
- if (__pyx_t_8) {
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1832
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1837
* self.train_max_initial_size, self.train_max_initial_size,
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear() # <<<<<<<<<<<<<<
@@ -57185,7 +57376,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_clear(__pyx_v_fphr_arr);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1833
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1838
* 0, 0, 0, 0, 0, 0, 0)):
* fphr_arr._clear()
* i = 1 # <<<<<<<<<<<<<<
@@ -57194,35 +57385,35 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_i = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1834
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1839
* fphr_arr._clear()
* i = 1
* self.findexes.reset() # <<<<<<<<<<<<<<
* self.findexes.append(sym_setindex(self.category, i))
* fphr_arr._append(sym_setindex(self.category, i))
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__reset); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_15 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1835
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1840
* i = 1
* self.findexes.reset()
* self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1
*/
- __pyx_t_15 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_15); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_15); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1836
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1841
* self.findexes.reset()
* self.findexes.append(sym_setindex(self.category, i))
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -57231,7 +57422,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1837
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1842
* self.findexes.append(sym_setindex(self.category, i))
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1 # <<<<<<<<<<<<<<
@@ -57240,27 +57431,27 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_v_i = (__pyx_v_i + 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1838
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1843
* fphr_arr._append(sym_setindex(self.category, i))
* i = i+1
* self.findexes.extend(self.findexes1) # <<<<<<<<<<<<<<
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]):
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->findexes), __pyx_n_s__extend); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(((PyObject *)__pyx_v_self->findexes1));
PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_self->findexes1));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self->findexes1));
- __pyx_t_14 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1839
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1844
* i = i+1
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n: # <<<<<<<<<<<<<<
@@ -57270,7 +57461,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_3 = __pyx_v_phrase->n;
for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_3; __pyx_v_j++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1840
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1845
* self.findexes.extend(self.findexes1)
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]): # <<<<<<<<<<<<<<
@@ -57280,7 +57471,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_4 = __pyx_f_3_sa_sym_isvar((__pyx_v_phrase->syms[__pyx_v_j]));
if (__pyx_t_4) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1841
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1846
* for j from 0 <= j < phrase.n:
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -57289,7 +57480,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1842
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1847
* if sym_isvar(phrase.syms[j]):
* fphr_arr._append(sym_setindex(self.category, i))
* i = i + 1 # <<<<<<<<<<<<<<
@@ -57301,7 +57492,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1844
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1849
* i = i + 1
* else:
* fphr_arr._append(phrase.syms[j]) # <<<<<<<<<<<<<<
@@ -57313,7 +57504,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_L106:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1845
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1850
* else:
* fphr_arr._append(phrase.syms[j])
* fphr_arr._append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
@@ -57322,81 +57513,81 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
((struct __pyx_vtabstruct_3_sa_IntList *)__pyx_v_fphr_arr->__pyx_vtab)->_append(__pyx_v_fphr_arr, __pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1846
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1851
* fphr_arr._append(phrase.syms[j])
* fphr_arr._append(sym_setindex(self.category, i))
* self.findexes.append(sym_setindex(self.category, i)) # <<<<<<<<<<<<<<
* fphr = Phrase(fphr_arr)
* phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low, e_gap_high, e_links_low, num_gaps+2,
*/
- __pyx_t_14 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_v_self->category, __pyx_v_i)); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
- __pyx_t_15 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_14); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyObject_Append(((PyObject *)__pyx_v_self->findexes), __pyx_t_14); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1847
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1852
* fphr_arr._append(sym_setindex(self.category, i))
* self.findexes.append(sym_setindex(self.category, i))
* fphr = Phrase(fphr_arr) # <<<<<<<<<<<<<<
* phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low, e_gap_high, e_links_low, num_gaps+2,
* f_x_low, f_x_high, f_gap_low, f_gap_high, f_links_low,
*/
- __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(((PyObject *)__pyx_v_fphr_arr));
PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_fphr_arr));
__Pyx_GIVEREF(((PyObject *)__pyx_v_fphr_arr));
- __pyx_t_14 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
__Pyx_DECREF(((PyObject *)__pyx_v_fphr));
__pyx_v_fphr = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_14);
__pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1850
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1855
* phrase_list = self.extract_phrases(e_x_low, e_x_high, e_gap_low, e_gap_high, e_links_low, num_gaps+2,
* f_x_low, f_x_high, f_gap_low, f_gap_high, f_links_low,
* matching.sent_id, e_sent_len, e_sent_start) # <<<<<<<<<<<<<<
* if len(phrase_list) > 0:
* pair_count = 1.0 / len(phrase_list)
*/
- __pyx_t_14 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->extract_phrases(__pyx_v_self, __pyx_v_e_x_low, __pyx_v_e_x_high, __pyx_v_e_gap_low, __pyx_v_e_gap_high, __pyx_v_e_links_low, (__pyx_v_num_gaps + 2), __pyx_v_f_x_low, __pyx_v_f_x_high, __pyx_v_f_gap_low, __pyx_v_f_gap_high, __pyx_v_f_links_low, __pyx_v_matching->sent_id, __pyx_v_e_sent_len, __pyx_v_e_sent_start); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = ((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->extract_phrases(__pyx_v_self, __pyx_v_e_x_low, __pyx_v_e_x_high, __pyx_v_e_gap_low, __pyx_v_e_gap_high, __pyx_v_e_links_low, (__pyx_v_num_gaps + 2), __pyx_v_f_x_low, __pyx_v_f_x_high, __pyx_v_f_gap_low, __pyx_v_f_gap_high, __pyx_v_f_links_low, __pyx_v_matching->sent_id, __pyx_v_e_sent_len, __pyx_v_e_sent_start); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_XDECREF(__pyx_v_phrase_list);
__pyx_v_phrase_list = __pyx_t_14;
__pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1851
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1856
* f_x_low, f_x_high, f_gap_low, f_gap_high, f_links_low,
* matching.sent_id, e_sent_len, e_sent_start)
* if len(phrase_list) > 0: # <<<<<<<<<<<<<<
* pair_count = 1.0 / len(phrase_list)
* else:
*/
- __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1851; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_8 = (__pyx_t_13 > 0);
- if (__pyx_t_8) {
+ __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = (__pyx_t_13 > 0);
+ if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1852
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1857
* matching.sent_id, e_sent_len, e_sent_start)
* if len(phrase_list) > 0:
* pair_count = 1.0 / len(phrase_list) # <<<<<<<<<<<<<<
* else:
* pair_count = 0
*/
- __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_Length(__pyx_v_phrase_list); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (unlikely(__pyx_t_13 == 0)) {
PyErr_Format(PyExc_ZeroDivisionError, "float division");
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__pyx_v_pair_count = (1.0 / __pyx_t_13);
goto __pyx_L107;
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1854
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1859
* pair_count = 1.0 / len(phrase_list)
* else:
* pair_count = 0 # <<<<<<<<<<<<<<
@@ -57407,7 +57598,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
__pyx_L107:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1855
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1860
* else:
* pair_count = 0
* for phrase2, eindexes in phrase_list: # <<<<<<<<<<<<<<
@@ -57418,7 +57609,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_t_14 = __pyx_v_phrase_list; __Pyx_INCREF(__pyx_t_14); __pyx_t_13 = 0;
__pyx_t_16 = NULL;
} else {
- __pyx_t_13 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_v_phrase_list); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__pyx_t_16 = Py_TYPE(__pyx_t_14)->tp_iternext;
}
@@ -57426,23 +57617,23 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_14)) {
if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_14)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_15 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_15 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_14)) {
if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_13); __Pyx_INCREF(__pyx_t_15); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_15 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PySequence_ITEM(__pyx_t_14, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_15 = __pyx_t_16(__pyx_t_14);
if (unlikely(!__pyx_t_15)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -57458,7 +57649,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -57471,14 +57662,14 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_2);
#else
- __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_10 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__pyx_t_17 = Py_TYPE(__pyx_t_10)->tp_iternext;
@@ -57486,7 +57677,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_2 = __pyx_t_17(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L110_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_17 = NULL;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L111_unpacking_done;
@@ -57494,7 +57685,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_17 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1855; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L111_unpacking_done:;
}
__Pyx_XDECREF(__pyx_v_phrase2);
@@ -57504,7 +57695,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__pyx_v_eindexes = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1856
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1861
* pair_count = 0
* for phrase2, eindexes in phrase_list:
* als4 = self.create_alignments(sent_links,num_links,self.findexes,eindexes) # <<<<<<<<<<<<<<
@@ -57513,31 +57704,31 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
__pyx_t_15 = ((PyObject *)__pyx_v_self->findexes);
__Pyx_INCREF(__pyx_t_15);
- __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_15, __pyx_v_eindexes)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_3_sa_HieroCachingRuleFactory *)__pyx_v_self->__pyx_vtab)->create_alignments(__pyx_v_self, __pyx_v_sent_links, __pyx_v_num_links, __pyx_t_15, __pyx_v_eindexes)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_XDECREF(((PyObject *)__pyx_v_als4));
__pyx_v_als4 = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1857
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1862
* for phrase2, eindexes in phrase_list:
* als4 = self.create_alignments(sent_links,num_links,self.findexes,eindexes)
* extracts.append((fphr, phrase2, pair_count, tuple(als4))) # <<<<<<<<<<<<<<
* else:
* reason_for_failure = "Unable to extract basic phrase"
*/
- __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyFloat_FromDouble(__pyx_v_pair_count); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(((PyObject *)__pyx_v_als4));
PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_als4));
__Pyx_GIVEREF(((PyObject *)__pyx_v_als4));
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
- __pyx_t_15 = PyTuple_New(4); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(4); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(((PyObject *)__pyx_v_fphr));
PyTuple_SET_ITEM(__pyx_t_15, 0, ((PyObject *)__pyx_v_fphr));
@@ -57551,7 +57742,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_extracts, ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_extracts, ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -57573,23 +57764,23 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1859
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1864
* extracts.append((fphr, phrase2, pair_count, tuple(als4)))
* else:
* reason_for_failure = "Unable to extract basic phrase" # <<<<<<<<<<<<<<
*
* free(sent_links)
*/
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_133));
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_134));
__Pyx_DECREF(__pyx_v_reason_for_failure);
- __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_133);
+ __pyx_v_reason_for_failure = ((PyObject *)__pyx_kp_s_134);
}
__pyx_L34:;
goto __pyx_L33;
}
__pyx_L33:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1861
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1866
* reason_for_failure = "Unable to extract basic phrase"
*
* free(sent_links) # <<<<<<<<<<<<<<
@@ -57598,7 +57789,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
free(__pyx_v_sent_links);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1862
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1867
*
* free(sent_links)
* free(f_links_low) # <<<<<<<<<<<<<<
@@ -57607,7 +57798,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
free(__pyx_v_f_links_low);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1863
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1868
* free(sent_links)
* free(f_links_low)
* free(f_links_high) # <<<<<<<<<<<<<<
@@ -57616,7 +57807,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
free(__pyx_v_f_links_high);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1864
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1869
* free(f_links_low)
* free(f_links_high)
* free(e_links_low) # <<<<<<<<<<<<<<
@@ -57625,7 +57816,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
free(__pyx_v_e_links_low);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1865
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1870
* free(f_links_high)
* free(e_links_low)
* free(e_links_high) # <<<<<<<<<<<<<<
@@ -57634,7 +57825,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
free(__pyx_v_e_links_high);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1866
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1871
* free(e_links_low)
* free(e_links_high)
* free(f_gap_low) # <<<<<<<<<<<<<<
@@ -57643,7 +57834,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
free(__pyx_v_f_gap_low);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1867
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1872
* free(e_links_high)
* free(f_gap_low)
* free(f_gap_high) # <<<<<<<<<<<<<<
@@ -57652,7 +57843,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
free(__pyx_v_f_gap_high);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1868
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1873
* free(f_gap_low)
* free(f_gap_high)
* free(e_gap_low) # <<<<<<<<<<<<<<
@@ -57661,7 +57852,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
free(__pyx_v_e_gap_low);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1869
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1874
* free(f_gap_high)
* free(e_gap_low)
* free(e_gap_high) # <<<<<<<<<<<<<<
@@ -57670,7 +57861,7 @@ static PyObject *__pyx_f_3_sa_23HieroCachingRuleFactory_extract(struct __pyx_obj
*/
free(__pyx_v_e_gap_high);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1871
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1876
* free(e_gap_high)
*
* return extracts # <<<<<<<<<<<<<<
@@ -57742,16 +57933,16 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_26add_instance(PyObject
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_words)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("add_instance", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("add_instance", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alignment)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("add_instance", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("add_instance", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_instance") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_instance") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
@@ -57766,7 +57957,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_26add_instance(PyObject
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("add_instance", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("add_instance", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.add_instance", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -57820,46 +58011,46 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_12add_instance_1extract
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_j)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_i)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_j)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__min_bound)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__wc)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__links)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nt)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 7); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 7); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nt_open)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 8); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, 8); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extract") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extract") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -57886,7 +58077,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_12add_instance_1extract
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.add_instance.extract", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -57897,7 +58088,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_12add_instance_1extract
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1913
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1918
* # f_ i and j are current, e_ i and j are previous
* # We care _considering_ f_j, so it is not yet in counts
* def extract(f_i, f_j, e_i, e_j, min_bound, wc, links, nt, nt_open): # <<<<<<<<<<<<<<
@@ -57943,33 +58134,33 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__pyx_outer_scope = (struct __pyx_obj_3_sa___pyx_scope_struct_21_add_instance *) __Pyx_CyFunction_GetClosure(__pyx_self);
__pyx_cur_scope = __pyx_outer_scope;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1915
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1920
* def extract(f_i, f_j, e_i, e_j, min_bound, wc, links, nt, nt_open):
* # Phrase extraction limits
* if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: # <<<<<<<<<<<<<<
* return
* # Unaligned word
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_f_len)) { __Pyx_RaiseClosureNameError("f_len"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_1 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_f_len)) { __Pyx_RaiseClosureNameError("f_len"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_1 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!__pyx_t_3) {
- __pyx_t_2 = PyNumber_Subtract(__pyx_v_f_j, __pyx_v_f_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Subtract(__pyx_v_f_j, __pyx_v_f_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_6 = __pyx_t_5;
} else {
@@ -57977,7 +58168,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1916
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1921
* # Phrase extraction limits
* if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size:
* return # <<<<<<<<<<<<<<
@@ -57991,41 +58182,41 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1918
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1923
* return
* # Unaligned word
* if not al[f_j]: # <<<<<<<<<<<<<<
* # Adjacent to non-terminal: extend (non-terminal now open)
* if nt and nt[-1][2] == f_j - 1:
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_al)) { __Pyx_RaiseClosureNameError("al"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_al)) { __Pyx_RaiseClosureNameError("al"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_3 = (!__pyx_t_6);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1920
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1925
* if not al[f_j]:
* # Adjacent to non-terminal: extend (non-terminal now open)
* if nt and nt[-1][2] == f_j - 1: # <<<<<<<<<<<<<<
* nt[-1][2] += 1
* extract(f_i, f_j + 1, e_i, e_j, min_bound, wc, links, nt, True)
*/
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_3) {
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Subtract(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Subtract(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_5 = __pyx_t_6;
} else {
@@ -58033,38 +58224,38 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1921
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1926
* # Adjacent to non-terminal: extend (non-terminal now open)
* if nt and nt[-1][2] == f_j - 1:
* nt[-1][2] += 1 # <<<<<<<<<<<<<<
* extract(f_i, f_j + 1, e_i, e_j, min_bound, wc, links, nt, True)
* nt[-1][2] -= 1
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_7 = 2;
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, __pyx_t_7, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, __pyx_t_7, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__Pyx_SetItemInt(__pyx_t_1, __pyx_t_7, __pyx_t_2, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_1, __pyx_t_7, __pyx_t_2, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1922
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1927
* if nt and nt[-1][2] == f_j - 1:
* nt[-1][2] += 1
* extract(f_i, f_j + 1, e_i, e_j, min_bound, wc, links, nt, True) # <<<<<<<<<<<<<<
* nt[-1][2] -= 1
* # Unless non-terminal already open, always extend with word
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyTuple_New(9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_f_i);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_f_i);
@@ -58093,48 +58284,48 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1923
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1928
* nt[-1][2] += 1
* extract(f_i, f_j + 1, e_i, e_j, min_bound, wc, links, nt, True)
* nt[-1][2] -= 1 # <<<<<<<<<<<<<<
* # Unless non-terminal already open, always extend with word
* # Make sure adding a word doesn't exceed length
*/
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_7 = 2;
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, __pyx_t_7, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, __pyx_t_7, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__Pyx_SetItemInt(__pyx_t_2, __pyx_t_7, __pyx_t_1, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1923; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_2, __pyx_t_7, __pyx_t_1, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
goto __pyx_L5;
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1926
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1931
* # Unless non-terminal already open, always extend with word
* # Make sure adding a word doesn't exceed length
* if not nt_open and wc < self.max_length: # <<<<<<<<<<<<<<
* extract(f_i, f_j + 1, e_i, e_j, min_bound, wc + 1, links, nt, False)
* return
*/
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_nt_open); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_nt_open); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_3 = (!__pyx_t_5);
if (__pyx_t_3) {
- __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_6 = __pyx_t_5;
} else {
@@ -58142,21 +58333,21 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1927
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1932
* # Make sure adding a word doesn't exceed length
* if not nt_open and wc < self.max_length:
* extract(f_i, f_j + 1, e_i, e_j, min_bound, wc + 1, links, nt, False) # <<<<<<<<<<<<<<
* return
* # Aligned word
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = PyTuple_New(9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(__pyx_v_f_i);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_f_i);
@@ -58185,7 +58376,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -58193,7 +58384,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L6:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1928
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1933
* if not nt_open and wc < self.max_length:
* extract(f_i, f_j + 1, e_i, e_j, min_bound, wc + 1, links, nt, False)
* return # <<<<<<<<<<<<<<
@@ -58207,38 +58398,38 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1930
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1935
* return
* # Aligned word
* link_i = fe_span[f_j][0] # <<<<<<<<<<<<<<
* link_j = fe_span[f_j][1]
* new_e_i = min(link_i, e_i)
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_fe_span)) { __Pyx_RaiseClosureNameError("fe_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f_j); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_fe_span)) { __Pyx_RaiseClosureNameError("fe_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f_j); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_link_i = __pyx_t_8;
__pyx_t_8 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1931
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1936
* # Aligned word
* link_i = fe_span[f_j][0]
* link_j = fe_span[f_j][1] # <<<<<<<<<<<<<<
* new_e_i = min(link_i, e_i)
* new_e_j = max(link_j, e_j)
*/
- __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f_j); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f_j); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_v_link_j = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1932
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1937
* link_i = fe_span[f_j][0]
* link_j = fe_span[f_j][1]
* new_e_i = min(link_i, e_i) # <<<<<<<<<<<<<<
@@ -58249,8 +58440,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__pyx_t_4 = __pyx_v_e_i;
__Pyx_INCREF(__pyx_v_link_i);
__pyx_t_8 = __pyx_v_link_i;
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_6) {
__Pyx_INCREF(__pyx_t_4);
@@ -58265,7 +58456,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__pyx_v_new_e_i = __pyx_t_2;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1933
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1938
* link_j = fe_span[f_j][1]
* new_e_i = min(link_i, e_i)
* new_e_j = max(link_j, e_j) # <<<<<<<<<<<<<<
@@ -58276,8 +58467,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__pyx_t_2 = __pyx_v_e_j;
__Pyx_INCREF(__pyx_v_link_j);
__pyx_t_4 = __pyx_v_link_j;
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_6) {
__Pyx_INCREF(__pyx_t_2);
@@ -58292,7 +58483,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__pyx_v_new_e_j = __pyx_t_8;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1936
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1941
* # Check reverse links of newly covered words to see if they violate left
* # bound (return) or extend minimum right bound for chunk
* new_min_bound = min_bound # <<<<<<<<<<<<<<
@@ -58302,54 +58493,54 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_INCREF(__pyx_v_min_bound);
__pyx_v_new_min_bound = __pyx_v_min_bound;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1938
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1943
* new_min_bound = min_bound
* # First aligned word creates span
* if e_j == -1: # <<<<<<<<<<<<<<
* for i from new_e_i <= i <= new_e_j:
* if ef_span[i][0] < f_i:
*/
- __pyx_t_8 = PyObject_RichCompare(__pyx_v_e_j, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_RichCompare(__pyx_v_e_j, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1939
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1944
* # First aligned word creates span
* if e_j == -1:
* for i from new_e_i <= i <= new_e_j: # <<<<<<<<<<<<<<
* if ef_span[i][0] < f_i:
* return
*/
- __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_new_e_i); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_v_new_e_j); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_new_e_i); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_v_new_e_j); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
for (__pyx_t_11 = __pyx_t_9; __pyx_t_11 <= __pyx_t_10; __pyx_t_11++) {
- __pyx_t_8 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_8;
__pyx_t_8 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1940
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1945
* if e_j == -1:
* for i from new_e_i <= i <= new_e_j:
* if ef_span[i][0] < f_i: # <<<<<<<<<<<<<<
* return
* new_min_bound = max(new_min_bound, ef_span[i][1])
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1941
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1946
* for i from new_e_i <= i <= new_e_j:
* if ef_span[i][0] < f_i:
* return # <<<<<<<<<<<<<<
@@ -58363,22 +58554,22 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L10:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1942
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1947
* if ef_span[i][0] < f_i:
* return
* new_min_bound = max(new_min_bound, ef_span[i][1]) # <<<<<<<<<<<<<<
* # Other aligned words extend span
* else:
*/
- __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_INCREF(__pyx_v_new_min_bound);
__pyx_t_8 = __pyx_v_new_min_bound;
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_6) {
__Pyx_INCREF(__pyx_t_2);
@@ -58393,17 +58584,17 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_DECREF(__pyx_v_new_min_bound);
__pyx_v_new_min_bound = __pyx_t_4;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1939
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1944
* # First aligned word creates span
* if e_j == -1:
* for i from new_e_i <= i <= new_e_j: # <<<<<<<<<<<<<<
* if ef_span[i][0] < f_i:
* return
*/
- __pyx_t_4 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_4;
@@ -58412,42 +58603,42 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
/*else*/ {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1945
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1950
* # Other aligned words extend span
* else:
* for i from new_e_i <= i < e_i: # <<<<<<<<<<<<<<
* if ef_span[i][0] < f_i:
* return
*/
- __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_new_e_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_v_e_i); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_new_e_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_v_e_i); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
for (__pyx_t_9 = __pyx_t_11; __pyx_t_9 < __pyx_t_10; __pyx_t_9++) {
- __pyx_t_4 = PyInt_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1946
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1951
* else:
* for i from new_e_i <= i < e_i:
* if ef_span[i][0] < f_i: # <<<<<<<<<<<<<<
* return
* new_min_bound = max(new_min_bound, ef_span[i][1])
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1947
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1952
* for i from new_e_i <= i < e_i:
* if ef_span[i][0] < f_i:
* return # <<<<<<<<<<<<<<
@@ -58461,22 +58652,22 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L13:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1948
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1953
* if ef_span[i][0] < f_i:
* return
* new_min_bound = max(new_min_bound, ef_span[i][1]) # <<<<<<<<<<<<<<
* for i from e_j < i <= new_e_j:
* if ef_span[i][0] < f_i:
*/
- __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_INCREF(__pyx_v_new_min_bound);
__pyx_t_4 = __pyx_v_new_min_bound;
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_6) {
__Pyx_INCREF(__pyx_t_2);
@@ -58491,58 +58682,58 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_DECREF(__pyx_v_new_min_bound);
__pyx_v_new_min_bound = __pyx_t_8;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1945
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1950
* # Other aligned words extend span
* else:
* for i from new_e_i <= i < e_i: # <<<<<<<<<<<<<<
* if ef_span[i][0] < f_i:
* return
*/
- __pyx_t_8 = PyInt_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyInt_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_8;
__pyx_t_8 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1949
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1954
* return
* new_min_bound = max(new_min_bound, ef_span[i][1])
* for i from e_j < i <= new_e_j: # <<<<<<<<<<<<<<
* if ef_span[i][0] < f_i:
* return
*/
- __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_e_j); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_v_new_e_j); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_e_j); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_v_new_e_j); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
for (__pyx_t_11 = __pyx_t_9+1; __pyx_t_11 <= __pyx_t_10; __pyx_t_11++) {
- __pyx_t_8 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_8;
__pyx_t_8 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1950
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1955
* new_min_bound = max(new_min_bound, ef_span[i][1])
* for i from e_j < i <= new_e_j:
* if ef_span[i][0] < f_i: # <<<<<<<<<<<<<<
* return
* new_min_bound = max(new_min_bound, ef_span[i][1])
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_ef_span)) { __Pyx_RaiseClosureNameError("ef_span"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_v_f_i, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1951
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1956
* for i from e_j < i <= new_e_j:
* if ef_span[i][0] < f_i:
* return # <<<<<<<<<<<<<<
@@ -58556,22 +58747,22 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L16:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1952
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1957
* if ef_span[i][0] < f_i:
* return
* new_min_bound = max(new_min_bound, ef_span[i][1]) # <<<<<<<<<<<<<<
* # Extract, extend with word (unless non-terminal open)
* if not nt_open:
*/
- __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_i); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_INCREF(__pyx_v_new_min_bound);
__pyx_t_8 = __pyx_v_new_min_bound;
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_6) {
__Pyx_INCREF(__pyx_t_2);
@@ -58586,17 +58777,17 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_DECREF(__pyx_v_new_min_bound);
__pyx_v_new_min_bound = __pyx_t_4;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_PyInt_AsInt(__pyx_v_i); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1949
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1954
* return
* new_min_bound = max(new_min_bound, ef_span[i][1])
* for i from e_j < i <= new_e_j: # <<<<<<<<<<<<<<
* if ef_span[i][0] < f_i:
* return
*/
- __pyx_t_4 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_4;
@@ -58604,18 +58795,18 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L7:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1954
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1959
* new_min_bound = max(new_min_bound, ef_span[i][1])
* # Extract, extend with word (unless non-terminal open)
* if not nt_open: # <<<<<<<<<<<<<<
* nt_collision = False
* for link in al[f_j]:
*/
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_nt_open); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_nt_open); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_3 = (!__pyx_t_6);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1955
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1960
* # Extract, extend with word (unless non-terminal open)
* if not nt_open:
* nt_collision = False # <<<<<<<<<<<<<<
@@ -58624,20 +58815,20 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
*/
__pyx_v_nt_collision = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1956
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1961
* if not nt_open:
* nt_collision = False
* for link in al[f_j]: # <<<<<<<<<<<<<<
* if e_nt_cover[link]:
* nt_collision = True
*/
- __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
__pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
__pyx_t_12 = NULL;
} else {
- __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext;
}
@@ -58646,23 +58837,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_2)) {
if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_2)) {
if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_12(__pyx_t_2);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -58672,21 +58863,21 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__pyx_v_link = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1957
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1962
* nt_collision = False
* for link in al[f_j]:
* if e_nt_cover[link]: # <<<<<<<<<<<<<<
* nt_collision = True
* # Non-terminal collisions block word extraction and extension, but
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_e_nt_cover, __pyx_v_link); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_e_nt_cover, __pyx_v_link); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1958
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1963
* for link in al[f_j]:
* if e_nt_cover[link]:
* nt_collision = True # <<<<<<<<<<<<<<
@@ -58700,7 +58891,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1961
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1966
* # Non-terminal collisions block word extraction and extension, but
* # may be okay for continuing non-terminals
* if not nt_collision and wc < self.max_length: # <<<<<<<<<<<<<<
@@ -58709,11 +58900,11 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
*/
__pyx_t_3 = (!__pyx_v_nt_collision);
if (__pyx_t_3) {
- __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_5 = __pyx_t_6;
} else {
@@ -58721,32 +58912,32 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1962
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1967
* # may be okay for continuing non-terminals
* if not nt_collision and wc < self.max_length:
* plus_links = [] # <<<<<<<<<<<<<<
* for link in al[f_j]:
* plus_links.append((f_j, link))
*/
- __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1962; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_v_plus_links = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1963
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1968
* if not nt_collision and wc < self.max_length:
* plus_links = []
* for link in al[f_j]: # <<<<<<<<<<<<<<
* plus_links.append((f_j, link))
* cover[link] += 1
*/
- __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
__pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
__pyx_t_12 = NULL;
} else {
- __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext;
}
@@ -58755,23 +58946,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_2)) {
if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_2)) {
if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_12(__pyx_t_2);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -58781,14 +58972,14 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__pyx_v_link = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1964
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1969
* plus_links = []
* for link in al[f_j]:
* plus_links.append((f_j, link)) # <<<<<<<<<<<<<<
* cover[link] += 1
* links.append(plus_links)
*/
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_f_j);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_f_j);
@@ -58796,10 +58987,10 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_INCREF(__pyx_v_link);
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_link);
__Pyx_GIVEREF(__pyx_v_link);
- __pyx_t_13 = PyList_Append(__pyx_v_plus_links, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyList_Append(__pyx_v_plus_links, ((PyObject *)__pyx_t_4)); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1965
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1970
* for link in al[f_j]:
* plus_links.append((f_j, link))
* cover[link] += 1 # <<<<<<<<<<<<<<
@@ -58808,41 +58999,41 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
*/
__Pyx_INCREF(__pyx_v_link);
__pyx_t_4 = __pyx_v_link;
- if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_cover, __pyx_t_4); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_8 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_cover, __pyx_t_4); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- if (PyObject_SetItem(__pyx_cur_scope->__pyx_v_cover, __pyx_t_4, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (PyObject_SetItem(__pyx_cur_scope->__pyx_v_cover, __pyx_t_4, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1966
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1971
* plus_links.append((f_j, link))
* cover[link] += 1
* links.append(plus_links) # <<<<<<<<<<<<<<
* if links and f_j >= new_min_bound:
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links))
*/
- __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_links, ((PyObject *)__pyx_v_plus_links)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_links, ((PyObject *)__pyx_v_plus_links)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1967
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1972
* cover[link] += 1
* links.append(plus_links)
* if links and f_j >= new_min_bound: # <<<<<<<<<<<<<<
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links))
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False)
*/
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_links); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_links); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_5) {
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_6 = __pyx_t_3;
} else {
@@ -58850,35 +59041,35 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1968
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1973
* links.append(plus_links)
* if links and f_j >= new_min_bound:
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) # <<<<<<<<<<<<<<
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False)
* links.pop()
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_rules)) { __Pyx_RaiseClosureNameError("rules"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_2 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_rules, __pyx_n_s__add); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_rules)) { __Pyx_RaiseClosureNameError("rules"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_2 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_rules, __pyx_n_s__add); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_f_words, __pyx_t_7, __pyx_t_14); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_f_words, __pyx_t_7, __pyx_t_14); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_new_e_i); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_8 = PyNumber_Add(__pyx_v_new_e_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_new_e_i); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyNumber_Add(__pyx_v_new_e_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_e_words, __pyx_t_14, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_e_words, __pyx_t_14, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_15 = PyTuple_New(6); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(6); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(__pyx_v_f_i);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_f_i);
@@ -58898,16 +59089,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_GIVEREF(__pyx_v_links);
__pyx_t_1 = 0;
__pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
- __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
__pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
@@ -58916,21 +59107,21 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L24:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1969
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1974
* if links and f_j >= new_min_bound:
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links))
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False) # <<<<<<<<<<<<<<
* links.pop()
* for link in al[f_j]:
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_8 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_8 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_15 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyTuple_New(9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_f_i);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_f_i);
@@ -58959,36 +59150,36 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__pyx_t_8 = 0;
__pyx_t_15 = 0;
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1970
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1975
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links))
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False)
* links.pop() # <<<<<<<<<<<<<<
* for link in al[f_j]:
* cover[link] -= 1
*/
- __pyx_t_2 = __Pyx_PyObject_Pop(__pyx_v_links); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Pop(__pyx_v_links); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1971
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1976
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False)
* links.pop()
* for link in al[f_j]: # <<<<<<<<<<<<<<
* cover[link] -= 1
* # Try to add a word to current non-terminal (if any), extract, extend
*/
- __pyx_t_2 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_j); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
__pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0;
__pyx_t_12 = NULL;
} else {
- __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_12 = Py_TYPE(__pyx_t_4)->tp_iternext;
}
@@ -58997,23 +59188,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
if (!__pyx_t_12 && PyList_CheckExact(__pyx_t_4)) {
if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_12 && PyTuple_CheckExact(__pyx_t_4)) {
if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_2 = __pyx_t_12(__pyx_t_4);
if (unlikely(!__pyx_t_2)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -59023,7 +59214,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__pyx_v_link = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1972
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1977
* links.pop()
* for link in al[f_j]:
* cover[link] -= 1 # <<<<<<<<<<<<<<
@@ -59032,14 +59223,14 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
*/
__Pyx_INCREF(__pyx_v_link);
__pyx_t_2 = __pyx_v_link;
- if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_15 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_cover, __pyx_t_2); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_15 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_cover, __pyx_t_2); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_8 = PyNumber_InPlaceSubtract(__pyx_t_15, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyNumber_InPlaceSubtract(__pyx_t_15, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- if (PyObject_SetItem(__pyx_cur_scope->__pyx_v_cover, __pyx_t_2, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (PyObject_SetItem(__pyx_cur_scope->__pyx_v_cover, __pyx_t_2, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
@@ -59051,26 +59242,26 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L17:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1974
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1979
* cover[link] -= 1
* # Try to add a word to current non-terminal (if any), extract, extend
* if nt and nt[-1][2] == f_j - 1: # <<<<<<<<<<<<<<
* # Add to non-terminal, checking for collisions
* old_last_nt = nt[-1][:]
*/
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_6) {
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Subtract(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Subtract(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_3 = __pyx_t_5;
} else {
@@ -59078,70 +59269,70 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1976
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1981
* if nt and nt[-1][2] == f_j - 1:
* # Add to non-terminal, checking for collisions
* old_last_nt = nt[-1][:] # <<<<<<<<<<<<<<
* nt[-1][2] = f_j
* if link_i < nt[-1][3]:
*/
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_t_8, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1976; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_t_8, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_v_old_last_nt = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1977
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1982
* # Add to non-terminal, checking for collisions
* old_last_nt = nt[-1][:]
* nt[-1][2] = f_j # <<<<<<<<<<<<<<
* if link_i < nt[-1][3]:
* if not span_check(cover, link_i, nt[-1][3] - 1):
*/
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (__Pyx_SetItemInt(__pyx_t_4, 2, __pyx_v_f_j, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_4, 2, __pyx_v_f_j, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1978
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1983
* old_last_nt = nt[-1][:]
* nt[-1][2] = f_j
* if link_i < nt[-1][3]: # <<<<<<<<<<<<<<
* if not span_check(cover, link_i, nt[-1][3] - 1):
* nt[-1] = old_last_nt
*/
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_link_i, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_v_link_i, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1979
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1984
* nt[-1][2] = f_j
* if link_i < nt[-1][3]:
* if not span_check(cover, link_i, nt[-1][3] - 1): # <<<<<<<<<<<<<<
* nt[-1] = old_last_nt
* return
*/
- __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_check); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_check); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyNumber_Subtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyNumber_Subtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_cover);
@@ -59152,25 +59343,25 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
__pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_6 = (!__pyx_t_3);
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1980
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1985
* if link_i < nt[-1][3]:
* if not span_check(cover, link_i, nt[-1][3] - 1):
* nt[-1] = old_last_nt # <<<<<<<<<<<<<<
* return
* span_inc(cover, link_i, nt[-1][3] - 1)
*/
- if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1981
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1986
* if not span_check(cover, link_i, nt[-1][3] - 1):
* nt[-1] = old_last_nt
* return # <<<<<<<<<<<<<<
@@ -59184,24 +59375,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L29:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1982
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1987
* nt[-1] = old_last_nt
* return
* span_inc(cover, link_i, nt[-1][3] - 1) # <<<<<<<<<<<<<<
* span_inc(e_nt_cover, link_i, nt[-1][3] - 1)
* nt[-1][3] = link_i
*/
- __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Subtract(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Subtract(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_cover);
@@ -59212,31 +59403,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1983
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1988
* return
* span_inc(cover, link_i, nt[-1][3] - 1)
* span_inc(e_nt_cover, link_i, nt[-1][3] - 1) # <<<<<<<<<<<<<<
* nt[-1][3] = link_i
* if link_j > nt[-1][4]:
*/
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Subtract(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Subtract(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_nt_cover);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_e_nt_cover);
@@ -59247,64 +59438,64 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1984
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1989
* span_inc(cover, link_i, nt[-1][3] - 1)
* span_inc(e_nt_cover, link_i, nt[-1][3] - 1)
* nt[-1][3] = link_i # <<<<<<<<<<<<<<
* if link_j > nt[-1][4]:
* if not span_check(cover, nt[-1][4] + 1, link_j):
*/
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (__Pyx_SetItemInt(__pyx_t_4, 3, __pyx_v_link_i, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_4, 3, __pyx_v_link_i, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L28;
}
__pyx_L28:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1985
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1990
* span_inc(e_nt_cover, link_i, nt[-1][3] - 1)
* nt[-1][3] = link_i
* if link_j > nt[-1][4]: # <<<<<<<<<<<<<<
* if not span_check(cover, nt[-1][4] + 1, link_j):
* nt[-1] = old_last_nt
*/
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_link_j, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_v_link_j, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1986
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1991
* nt[-1][3] = link_i
* if link_j > nt[-1][4]:
* if not span_check(cover, nt[-1][4] + 1, link_j): # <<<<<<<<<<<<<<
* nt[-1] = old_last_nt
* return
*/
- __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_check); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_check); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_cover);
@@ -59315,25 +59506,25 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
__pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_3 = (!__pyx_t_6);
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1987
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1992
* if link_j > nt[-1][4]:
* if not span_check(cover, nt[-1][4] + 1, link_j):
* nt[-1] = old_last_nt # <<<<<<<<<<<<<<
* return
* span_inc(cover, nt[-1][4] + 1, link_j)
*/
- if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1987; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1988
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1993
* if not span_check(cover, nt[-1][4] + 1, link_j):
* nt[-1] = old_last_nt
* return # <<<<<<<<<<<<<<
@@ -59347,24 +59538,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L31:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1989
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1994
* nt[-1] = old_last_nt
* return
* span_inc(cover, nt[-1][4] + 1, link_j) # <<<<<<<<<<<<<<
* span_inc(e_nt_cover, nt[-1][4] + 1, link_j)
* nt[-1][4] = link_j
*/
- __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_cover);
@@ -59375,31 +59566,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1990
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1995
* return
* span_inc(cover, nt[-1][4] + 1, link_j)
* span_inc(e_nt_cover, nt[-1][4] + 1, link_j) # <<<<<<<<<<<<<<
* nt[-1][4] = link_j
* if links and f_j >= new_min_bound:
*/
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Add(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(__pyx_t_8, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_nt_cover);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_e_nt_cover);
@@ -59410,38 +59601,38 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1991
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1996
* span_inc(cover, nt[-1][4] + 1, link_j)
* span_inc(e_nt_cover, nt[-1][4] + 1, link_j)
* nt[-1][4] = link_j # <<<<<<<<<<<<<<
* if links and f_j >= new_min_bound:
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links))
*/
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (__Pyx_SetItemInt(__pyx_t_4, 4, __pyx_v_link_j, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1991; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_4, 4, __pyx_v_link_j, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
goto __pyx_L30;
}
__pyx_L30:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1992
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1997
* span_inc(e_nt_cover, nt[-1][4] + 1, link_j)
* nt[-1][4] = link_j
* if links and f_j >= new_min_bound: # <<<<<<<<<<<<<<
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links))
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc, links, nt, False)
*/
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_links); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_links); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_3) {
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_5 = __pyx_t_6;
} else {
@@ -59449,35 +59640,35 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1993
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1998
* nt[-1][4] = link_j
* if links and f_j >= new_min_bound:
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) # <<<<<<<<<<<<<<
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc, links, nt, False)
* nt[-1] = old_last_nt
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_rules)) { __Pyx_RaiseClosureNameError("rules"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_4 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_rules, __pyx_n_s__add); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_rules)) { __Pyx_RaiseClosureNameError("rules"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_rules, __pyx_n_s__add); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_f_words, __pyx_t_7, __pyx_t_14); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_f_words, __pyx_t_7, __pyx_t_14); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_new_e_i); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_15 = PyNumber_Add(__pyx_v_new_e_j, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_new_e_i); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyNumber_Add(__pyx_v_new_e_j, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_15); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_15); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_e_words, __pyx_t_14, __pyx_t_7); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_e_words, __pyx_t_14, __pyx_t_7); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_f_i);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_f_i);
@@ -59497,16 +59688,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_GIVEREF(__pyx_v_links);
__pyx_t_2 = 0;
__pyx_t_15 = 0;
- __pyx_t_15 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_15);
__Pyx_GIVEREF(__pyx_t_15);
__pyx_t_15 = 0;
- __pyx_t_15 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
@@ -59515,19 +59706,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L32:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1994
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1999
* if links and f_j >= new_min_bound:
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links))
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc, links, nt, False) # <<<<<<<<<<<<<<
* nt[-1] = old_last_nt
* if link_i < nt[-1][3]:
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_15 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_15 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyTuple_New(9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_f_i);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_f_i);
@@ -59556,57 +59747,57 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_15 = 0;
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1995
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2000
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links))
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc, links, nt, False)
* nt[-1] = old_last_nt # <<<<<<<<<<<<<<
* if link_i < nt[-1][3]:
* span_dec(cover, link_i, nt[-1][3] - 1)
*/
- if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_v_nt, -1, __pyx_v_old_last_nt, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1996
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2001
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc, links, nt, False)
* nt[-1] = old_last_nt
* if link_i < nt[-1][3]: # <<<<<<<<<<<<<<
* span_dec(cover, link_i, nt[-1][3] - 1)
* span_dec(e_nt_cover, link_i, nt[-1][3] - 1)
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_link_i, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_link_i, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1997
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2002
* nt[-1] = old_last_nt
* if link_i < nt[-1][3]:
* span_dec(cover, link_i, nt[-1][3] - 1) # <<<<<<<<<<<<<<
* span_dec(e_nt_cover, link_i, nt[-1][3] - 1)
* if link_j > nt[-1][4]:
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_4, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Subtract(__pyx_t_15, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Subtract(__pyx_t_15, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_cover);
@@ -59617,31 +59808,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1998
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2003
* if link_i < nt[-1][3]:
* span_dec(cover, link_i, nt[-1][3] - 1)
* span_dec(e_nt_cover, link_i, nt[-1][3] - 1) # <<<<<<<<<<<<<<
* if link_j > nt[-1][4]:
* span_dec(cover, nt[-1][4] + 1, link_j)
*/
- __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_15, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_15, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = PyNumber_Subtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyNumber_Subtract(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_nt_cover);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_e_nt_cover);
@@ -59652,7 +59843,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_15);
__Pyx_GIVEREF(__pyx_t_15);
__pyx_t_15 = 0;
- __pyx_t_15 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
@@ -59661,43 +59852,43 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L33:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1999
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2004
* span_dec(cover, link_i, nt[-1][3] - 1)
* span_dec(e_nt_cover, link_i, nt[-1][3] - 1)
* if link_j > nt[-1][4]: # <<<<<<<<<<<<<<
* span_dec(cover, nt[-1][4] + 1, link_j)
* span_dec(e_nt_cover, nt[-1][4] + 1, link_j)
*/
- __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_15, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_15, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = PyObject_RichCompare(__pyx_v_link_j, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_RichCompare(__pyx_v_link_j, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
if (__pyx_t_5) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2000
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2005
* span_dec(e_nt_cover, link_i, nt[-1][3] - 1)
* if link_j > nt[-1][4]:
* span_dec(cover, nt[-1][4] + 1, link_j) # <<<<<<<<<<<<<<
* span_dec(e_nt_cover, nt[-1][4] + 1, link_j)
* # Try to start a new non-terminal, extract, extend
*/
- __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_cover);
@@ -59708,31 +59899,31 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2000; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2001
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2006
* if link_j > nt[-1][4]:
* span_dec(cover, nt[-1][4] + 1, link_j)
* span_dec(e_nt_cover, nt[-1][4] + 1, link_j) # <<<<<<<<<<<<<<
* # Try to start a new non-terminal, extract, extend
* if (not nt or f_j - nt[-1][2] > 1) and wc < self.max_length and len(nt) < self.max_nonterminals:
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_4, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_4, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Add(__pyx_t_15, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(__pyx_t_15, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_nt_cover);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_e_nt_cover);
@@ -59743,7 +59934,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
@@ -59755,41 +59946,41 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L27:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2003
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2008
* span_dec(e_nt_cover, nt[-1][4] + 1, link_j)
* # Try to start a new non-terminal, extract, extend
* if (not nt or f_j - nt[-1][2] > 1) and wc < self.max_length and len(nt) < self.max_nonterminals: # <<<<<<<<<<<<<<
* # Check for collisions
* if not span_check(cover, link_i, link_j):
*/
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_3 = (!__pyx_t_5);
if (!__pyx_t_3) {
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_4, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Subtract(__pyx_v_f_j, __pyx_t_15); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Subtract(__pyx_v_f_j, __pyx_t_15); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = PyObject_RichCompare(__pyx_t_4, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_RichCompare(__pyx_t_4, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_15); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_15); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__pyx_t_6 = __pyx_t_5;
} else {
__pyx_t_6 = __pyx_t_3;
}
if (__pyx_t_6) {
- __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_15, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_v_wc, __pyx_t_15, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_3) {
- __pyx_t_7 = PyObject_Length(__pyx_v_nt); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_Length(__pyx_v_nt); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_5 = (__pyx_t_7 < __pyx_cur_scope->__pyx_v_self->max_nonterminals);
__pyx_t_16 = __pyx_t_5;
} else {
@@ -59801,17 +59992,17 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2005
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2010
* if (not nt or f_j - nt[-1][2] > 1) and wc < self.max_length and len(nt) < self.max_nonterminals:
* # Check for collisions
* if not span_check(cover, link_i, link_j): # <<<<<<<<<<<<<<
* return
* span_inc(cover, link_i, link_j)
*/
- __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_check); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_check); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_cover)) { __Pyx_RaiseClosureNameError("cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_cover);
@@ -59822,16 +60013,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_INCREF(__pyx_v_link_j);
PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
- __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_6 = (!__pyx_t_3);
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2006
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2011
* # Check for collisions
* if not span_check(cover, link_i, link_j):
* return # <<<<<<<<<<<<<<
@@ -59845,16 +60036,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L36:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2007
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2012
* if not span_check(cover, link_i, link_j):
* return
* span_inc(cover, link_i, link_j) # <<<<<<<<<<<<<<
* span_inc(e_nt_cover, link_i, link_j)
* nt.append([(nt[-1][0] + 1) if nt else 1, f_j, f_j, link_i, link_j])
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_cover);
@@ -59865,23 +60056,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_INCREF(__pyx_v_link_j);
PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
- __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2008
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2013
* return
* span_inc(cover, link_i, link_j)
* span_inc(e_nt_cover, link_i, link_j) # <<<<<<<<<<<<<<
* nt.append([(nt[-1][0] + 1) if nt else 1, f_j, f_j, link_i, link_j])
* # Require at least one word in phrase
*/
- __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_inc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_e_nt_cover)) { __Pyx_RaiseClosureNameError("e_nt_cover"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_nt_cover);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_e_nt_cover);
@@ -59892,27 +60083,27 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_INCREF(__pyx_v_link_j);
PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
- __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2009
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2014
* span_inc(cover, link_i, link_j)
* span_inc(e_nt_cover, link_i, link_j)
* nt.append([(nt[-1][0] + 1) if nt else 1, f_j, f_j, link_i, link_j]) # <<<<<<<<<<<<<<
* # Require at least one word in phrase
* if links and f_j >= new_min_bound:
*/
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_6) {
- __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_15) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_15, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_15, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- __pyx_t_15 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_1 = __pyx_t_15;
@@ -59921,7 +60112,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_INCREF(__pyx_int_1);
__pyx_t_1 = __pyx_int_1;
}
- __pyx_t_15 = PyList_New(5); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyList_New(5); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
PyList_SET_ITEM(__pyx_t_15, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
@@ -59938,22 +60129,22 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
PyList_SET_ITEM(__pyx_t_15, 4, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_nt, ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_nt, ((PyObject *)__pyx_t_15)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2011
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2016
* nt.append([(nt[-1][0] + 1) if nt else 1, f_j, f_j, link_i, link_j])
* # Require at least one word in phrase
* if links and f_j >= new_min_bound: # <<<<<<<<<<<<<<
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links))
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False)
*/
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_links); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_links); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_6) {
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_f_j, __pyx_v_new_min_bound, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_16 = __pyx_t_3;
} else {
@@ -59961,35 +60152,35 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
if (__pyx_t_16) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2012
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2017
* # Require at least one word in phrase
* if links and f_j >= new_min_bound:
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links)) # <<<<<<<<<<<<<<
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False)
* nt.pop()
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_rules)) { __Pyx_RaiseClosureNameError("rules"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_1 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_rules, __pyx_n_s__add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_rules)) { __Pyx_RaiseClosureNameError("rules"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_1 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_rules, __pyx_n_s__add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_15 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__form_rule); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
- if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_f_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_f_words, __pyx_t_7, __pyx_t_14); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_f_words, __pyx_t_7, __pyx_t_14); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_new_e_i); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_8 = PyNumber_Add(__pyx_v_new_e_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_e_words)) { __Pyx_RaiseClosureNameError("e_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_14 = __Pyx_PyIndex_AsSsize_t(__pyx_v_new_e_i); if (unlikely((__pyx_t_14 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyNumber_Add(__pyx_v_new_e_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_e_words, __pyx_t_14, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PySequence_GetSlice(__pyx_cur_scope->__pyx_v_e_words, __pyx_t_14, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_f_i);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_f_i);
@@ -60009,16 +60200,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_GIVEREF(__pyx_v_links);
__pyx_t_4 = 0;
__pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(__pyx_t_15, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
__pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
@@ -60027,21 +60218,21 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
}
__pyx_L37:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2013
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2018
* if links and f_j >= new_min_bound:
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links))
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False) # <<<<<<<<<<<<<<
* nt.pop()
* span_dec(cover, link_i, link_j)
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_8 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_8 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_15 = PyTuple_New(9); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(9); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(__pyx_v_f_i);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_f_i);
@@ -60070,32 +60261,32 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__pyx_t_8 = 0;
__pyx_t_2 = 0;
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2013; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2014
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2019
* rules.add(self.form_rule(f_i, new_e_i, f_words[f_i:f_j + 1], e_words[new_e_i:new_e_j + 1], nt, links))
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False)
* nt.pop() # <<<<<<<<<<<<<<
* span_dec(cover, link_i, link_j)
* span_dec(e_nt_cover, link_i, link_j)
*/
- __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_nt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_nt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2015
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2020
* extract(f_i, f_j + 1, new_e_i, new_e_j, new_min_bound, wc + 1, links, nt, False)
* nt.pop()
* span_dec(cover, link_i, link_j) # <<<<<<<<<<<<<<
* span_dec(e_nt_cover, link_i, link_j)
*
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_cover);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_cover);
@@ -60106,22 +60297,22 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_INCREF(__pyx_v_link_j);
PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2016
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2021
* nt.pop()
* span_dec(cover, link_i, link_j)
* span_dec(e_nt_cover, link_i, link_j) # <<<<<<<<<<<<<<
*
* # Try to extract phrases from every f index
*/
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__span_dec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_15);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_nt_cover);
PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_cur_scope->__pyx_v_e_nt_cover);
@@ -60132,7 +60323,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
__Pyx_INCREF(__pyx_v_link_j);
PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_v_link_j);
__Pyx_GIVEREF(__pyx_v_link_j);
- __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_15), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_15)); __pyx_t_15 = 0;
@@ -60166,7 +60357,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_12add_instance_extract(
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1879
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1884
* # Aggregate stats from a training instance
* # (Extract rules, update counts)
* def add_instance(self, f_words, e_words, alignment): # <<<<<<<<<<<<<<
@@ -60227,7 +60418,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_e_words);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_e_words);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1881
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1886
* def add_instance(self, f_words, e_words, alignment):
*
* self.online = True # <<<<<<<<<<<<<<
@@ -60236,20 +60427,20 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
*/
__pyx_cur_scope->__pyx_v_self->online = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1888
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1893
* # span more than once.
* # (f, e, al, lex_f_i, lex_f_j)
* rules = set() # <<<<<<<<<<<<<<
*
* f_len = len(f_words)
*/
- __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__Pyx_GIVEREF(((PyObject *)__pyx_t_1));
__pyx_cur_scope->__pyx_v_rules = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1890
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1895
* rules = set()
*
* f_len = len(f_words) # <<<<<<<<<<<<<<
@@ -60258,15 +60449,15 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
*/
__pyx_t_1 = __pyx_cur_scope->__pyx_v_f_words;
__Pyx_INCREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_cur_scope->__pyx_v_f_len = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1891
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1896
*
* f_len = len(f_words)
* e_len = len(e_words) # <<<<<<<<<<<<<<
@@ -60275,35 +60466,35 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
*/
__pyx_t_1 = __pyx_cur_scope->__pyx_v_e_words;
__Pyx_INCREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_e_len = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1894
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1899
*
* # Pre-compute alignment info
* al = [[] for i in range(f_len)] # <<<<<<<<<<<<<<
* fe_span = [[e_len + 1, -1] for i in range(f_len)]
* ef_span = [[f_len + 1, -1] for i in range(e_len)]
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f_len);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_f_len);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f_len);
- __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
__pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0;
__pyx_t_5 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
}
@@ -60312,23 +60503,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_5(__pyx_t_3);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -60337,9 +60528,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__Pyx_XDECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_4;
__pyx_t_4 = 0;
- __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -60348,28 +60539,28 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_cur_scope->__pyx_v_al = ((PyObject *)__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1895
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1900
* # Pre-compute alignment info
* al = [[] for i in range(f_len)]
* fe_span = [[e_len + 1, -1] for i in range(f_len)] # <<<<<<<<<<<<<<
* ef_span = [[f_len + 1, -1] for i in range(e_len)]
* for (f, e) in alignment:
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f_len);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_f_len);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f_len);
- __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
__pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0;
__pyx_t_5 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
}
@@ -60378,23 +60569,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_5(__pyx_t_3);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -60403,9 +60594,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__Pyx_XDECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_4;
__pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Add(__pyx_v_e_len, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(__pyx_v_e_len, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
@@ -60413,7 +60604,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
PyList_SET_ITEM(__pyx_t_6, 1, __pyx_int_neg_1);
__Pyx_GIVEREF(__pyx_int_neg_1);
__pyx_t_4 = 0;
- if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -60422,28 +60613,28 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_cur_scope->__pyx_v_fe_span = ((PyObject *)__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1896
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1901
* al = [[] for i in range(f_len)]
* fe_span = [[e_len + 1, -1] for i in range(f_len)]
* ef_span = [[f_len + 1, -1] for i in range(e_len)] # <<<<<<<<<<<<<<
* for (f, e) in alignment:
* al[f].append(e)
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_e_len);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_e_len);
__Pyx_GIVEREF(__pyx_v_e_len);
- __pyx_t_6 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
if (PyList_CheckExact(__pyx_t_6) || PyTuple_CheckExact(__pyx_t_6)) {
__pyx_t_3 = __pyx_t_6; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0;
__pyx_t_5 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
}
@@ -60452,23 +60643,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_6); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_6 = __pyx_t_5(__pyx_t_3);
if (unlikely(!__pyx_t_6)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -60477,9 +60668,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__Pyx_XDECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_6;
__pyx_t_6 = 0;
- __pyx_t_6 = PyNumber_Add(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Add(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_6);
@@ -60487,7 +60678,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
PyList_SET_ITEM(__pyx_t_4, 1, __pyx_int_neg_1);
__Pyx_GIVEREF(__pyx_int_neg_1);
__pyx_t_6 = 0;
- if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -60496,7 +60687,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_cur_scope->__pyx_v_ef_span = ((PyObject *)__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1897
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1902
* fe_span = [[e_len + 1, -1] for i in range(f_len)]
* ef_span = [[f_len + 1, -1] for i in range(e_len)]
* for (f, e) in alignment: # <<<<<<<<<<<<<<
@@ -60507,7 +60698,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_t_1 = __pyx_v_alignment; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
__pyx_t_5 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_alignment); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_alignment); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -60515,23 +60706,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_3 = __pyx_t_5(__pyx_t_1);
if (unlikely(!__pyx_t_3)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -60547,7 +60738,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -60560,14 +60751,14 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(__pyx_t_6);
#else
- __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
@@ -60575,7 +60766,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__Pyx_GOTREF(__pyx_t_4);
index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L11_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L12_unpacking_done;
@@ -60583,7 +60774,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1897; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L12_unpacking_done:;
}
__Pyx_XDECREF(__pyx_v_f);
@@ -60593,21 +60784,21 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_v_e = __pyx_t_6;
__pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1898
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1903
* ef_span = [[f_len + 1, -1] for i in range(e_len)]
* for (f, e) in alignment:
* al[f].append(e) # <<<<<<<<<<<<<<
* fe_span[f][0] = min(fe_span[f][0], e)
* fe_span[f][1] = max(fe_span[f][1], e)
*/
- __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_al, __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_v_e); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_v_e); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1899
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1904
* for (f, e) in alignment:
* al[f].append(e)
* fe_span[f][0] = min(fe_span[f][0], e) # <<<<<<<<<<<<<<
@@ -60616,13 +60807,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
*/
__Pyx_INCREF(__pyx_v_e);
__pyx_t_6 = __pyx_v_e;
- __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__pyx_t_9) {
__Pyx_INCREF(__pyx_t_6);
@@ -60633,13 +60824,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- if (__Pyx_SetItemInt(__pyx_t_6, 0, __pyx_t_3, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_6, 0, __pyx_t_3, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1900
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1905
* al[f].append(e)
* fe_span[f][0] = min(fe_span[f][0], e)
* fe_span[f][1] = max(fe_span[f][1], e) # <<<<<<<<<<<<<<
@@ -60648,13 +60839,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
*/
__Pyx_INCREF(__pyx_v_e);
__pyx_t_3 = __pyx_v_e;
- __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__pyx_t_9) {
__Pyx_INCREF(__pyx_t_3);
@@ -60665,13 +60856,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_fe_span, __pyx_v_f); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (__Pyx_SetItemInt(__pyx_t_3, 1, __pyx_t_6, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_3, 1, __pyx_t_6, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1901
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1906
* fe_span[f][0] = min(fe_span[f][0], e)
* fe_span[f][1] = max(fe_span[f][1], e)
* ef_span[e][0] = min(ef_span[e][0], f) # <<<<<<<<<<<<<<
@@ -60680,13 +60871,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
*/
__Pyx_INCREF(__pyx_v_f);
__pyx_t_6 = __pyx_v_f;
- __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__pyx_t_9) {
__Pyx_INCREF(__pyx_t_6);
@@ -60697,13 +60888,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_e); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_e); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- if (__Pyx_SetItemInt(__pyx_t_6, 0, __pyx_t_3, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_6, 0, __pyx_t_3, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1902
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1907
* fe_span[f][1] = max(fe_span[f][1], e)
* ef_span[e][0] = min(ef_span[e][0], f)
* ef_span[e][1] = max(ef_span[e][1], f) # <<<<<<<<<<<<<<
@@ -60712,13 +60903,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
*/
__Pyx_INCREF(__pyx_v_f);
__pyx_t_3 = __pyx_v_f;
- __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_e); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_e); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__pyx_t_9) {
__Pyx_INCREF(__pyx_t_3);
@@ -60729,27 +60920,27 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_ef_span, __pyx_v_e); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (__Pyx_SetItemInt(__pyx_t_3, 1, __pyx_t_6, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_3, 1, __pyx_t_6, sizeof(long), PyInt_FromLong) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1905
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1910
*
* # Target side word coverage
* cover = [0] * e_len # <<<<<<<<<<<<<<
* # Non-terminal coverage
* f_nt_cover = [0] * f_len
*/
- __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_int_0);
PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
__Pyx_GIVEREF(__pyx_int_0);
- { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_v_e_len); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_v_e_len); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_temp);
__Pyx_DECREF(__pyx_t_1);
__pyx_t_1 = __pyx_temp;
@@ -60758,19 +60949,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_cur_scope->__pyx_v_cover = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1907
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1912
* cover = [0] * e_len
* # Non-terminal coverage
* f_nt_cover = [0] * f_len # <<<<<<<<<<<<<<
* e_nt_cover = [0] * e_len
*
*/
- __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_int_0);
PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
__Pyx_GIVEREF(__pyx_int_0);
- { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_cur_scope->__pyx_v_f_len); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_cur_scope->__pyx_v_f_len); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_temp);
__Pyx_DECREF(__pyx_t_1);
__pyx_t_1 = __pyx_temp;
@@ -60778,19 +60969,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_v_f_nt_cover = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1908
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1913
* # Non-terminal coverage
* f_nt_cover = [0] * f_len
* e_nt_cover = [0] * e_len # <<<<<<<<<<<<<<
*
* # Extract all possible hierarchical phrases starting at a source index
*/
- __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_int_0);
PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
__Pyx_GIVEREF(__pyx_int_0);
- { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_v_e_len); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_v_e_len); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_temp);
__Pyx_DECREF(__pyx_t_1);
__pyx_t_1 = __pyx_temp;
@@ -60799,44 +60990,44 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_cur_scope->__pyx_v_e_nt_cover = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1913
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1918
* # f_ i and j are current, e_ i and j are previous
* # We care _considering_ f_j, so it is not yet in counts
* def extract(f_i, f_j, e_i, e_j, min_bound, wc, links, nt, nt_open): # <<<<<<<<<<<<<<
* # Phrase extraction limits
* if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size:
*/
- __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_12add_instance_1extract, 0, ((PyObject*)__pyx_cur_scope), __pyx_n_s___sa, ((PyObject *)__pyx_k_codeobj_135)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_12add_instance_1extract, 0, ((PyObject*)__pyx_cur_scope), __pyx_n_s___sa, ((PyObject *)__pyx_k_codeobj_136)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_cur_scope->__pyx_v_extract = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2019
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2024
*
* # Try to extract phrases from every f index
* for f_i from 0 <= f_i < f_len: # <<<<<<<<<<<<<<
* # Skip if phrases won't be tight on left side
* if not al[f_i]:
*/
- __pyx_t_10 = __Pyx_PyInt_AsLong(__pyx_cur_scope->__pyx_v_f_len); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_AsLong(__pyx_cur_scope->__pyx_v_f_len); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
for (__pyx_v_f_i = 0; __pyx_v_f_i < __pyx_t_10; __pyx_v_f_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2021
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2026
* for f_i from 0 <= f_i < f_len:
* # Skip if phrases won't be tight on left side
* if not al[f_i]: # <<<<<<<<<<<<<<
* continue
* extract(f_i, f_i, f_len + 1, -1, f_i, 0, [], [], False)
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_al, __pyx_v_f_i, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_11 = (!__pyx_t_9);
if (__pyx_t_11) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2022
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2027
* # Skip if phrases won't be tight on left side
* if not al[f_i]:
* continue # <<<<<<<<<<<<<<
@@ -60848,28 +61039,28 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
}
__pyx_L15:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2023
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2028
* if not al[f_i]:
* continue
* extract(f_i, f_i, f_len + 1, -1, f_i, 0, [], [], False) # <<<<<<<<<<<<<<
*
* # Update possible phrases (samples)
*/
- __pyx_t_1 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = PyNumber_Add(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Add(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
- __pyx_t_13 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_13);
- __pyx_t_14 = PyTuple_New(9); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyTuple_New(9); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
@@ -60898,28 +61089,28 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_t_7 = 0;
__pyx_t_12 = 0;
__pyx_t_13 = 0;
- __pyx_t_13 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__pyx_L13_continue:;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2028
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2033
* # This could be more efficiently integrated with extraction
* # at the cost of readability
* for (f, lex_i, lex_j) in self.get_f_phrases(f_words): # <<<<<<<<<<<<<<
* self.samples_f[f] += 1
*
*/
- __pyx_t_13 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_f_phrases); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s__get_f_phrases); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_13);
- __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f_words);
PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_cur_scope->__pyx_v_f_words);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f_words);
- __pyx_t_12 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyObject_Call(__pyx_t_13, ((PyObject *)__pyx_t_14), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_14)); __pyx_t_14 = 0;
@@ -60927,7 +61118,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_t_14 = __pyx_t_12; __Pyx_INCREF(__pyx_t_14); __pyx_t_2 = 0;
__pyx_t_5 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__pyx_t_5 = Py_TYPE(__pyx_t_14)->tp_iternext;
}
@@ -60936,23 +61127,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_14)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_14)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_12 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_12 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_14)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_12 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_12 = __pyx_t_5(__pyx_t_14);
if (unlikely(!__pyx_t_12)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -60968,7 +61159,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -60984,15 +61175,15 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(__pyx_t_4);
#else
- __pyx_t_13 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_3 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
@@ -61002,7 +61193,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__Pyx_GOTREF(__pyx_t_7);
index = 2; __pyx_t_4 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_4)) goto __pyx_L18_unpacking_failed;
__Pyx_GOTREF(__pyx_t_4);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L19_unpacking_done;
@@ -61010,7 +61201,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L19_unpacking_done:;
}
__Pyx_XDECREF(__pyx_v_f);
@@ -61023,7 +61214,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_v_lex_j = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2029
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2034
* # at the cost of readability
* for (f, lex_i, lex_j) in self.get_f_phrases(f_words):
* self.samples_f[f] += 1 # <<<<<<<<<<<<<<
@@ -61034,19 +61225,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_t_12 = __pyx_cur_scope->__pyx_v_self->samples_f;
__Pyx_INCREF(__pyx_v_f);
__pyx_t_4 = __pyx_v_f;
- __pyx_t_7 = PyObject_GetItem(__pyx_t_12, __pyx_t_4); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_GetItem(__pyx_t_12, __pyx_t_4); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyObject_SetItem(__pyx_t_12, __pyx_t_4, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2029; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_t_12, __pyx_t_4, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
}
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2032
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2037
*
* # Update phrase counts
* for rule in rules: # <<<<<<<<<<<<<<
@@ -61057,7 +61248,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_t_14 = __pyx_cur_scope->__pyx_v_rules; __Pyx_INCREF(__pyx_t_14); __pyx_t_2 = 0;
__pyx_t_5 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_rules); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_rules); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__pyx_t_5 = Py_TYPE(__pyx_t_14)->tp_iternext;
}
@@ -61065,23 +61256,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_14)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_14)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_12 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_12 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_14)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_12); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_12 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_12 = __pyx_t_5(__pyx_t_14);
if (unlikely(!__pyx_t_12)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -61091,14 +61282,14 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_v_rule = __pyx_t_12;
__pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2033
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2038
* # Update phrase counts
* for rule in rules:
* (f_ph, e_ph, al) = rule[:3] # <<<<<<<<<<<<<<
* self.phrases_f[f_ph] += 1
* self.phrases_e[e_ph] += 1
*/
- __pyx_t_12 = __Pyx_PySequence_GetSlice(__pyx_v_rule, 0, 3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PySequence_GetSlice(__pyx_v_rule, 0, 3); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
if ((likely(PyTuple_CheckExact(__pyx_t_12))) || (PyList_CheckExact(__pyx_t_12))) {
PyObject* sequence = __pyx_t_12;
@@ -61110,7 +61301,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
if (unlikely(size != 3)) {
if (size > 3) __Pyx_RaiseTooManyValuesError(3);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -61126,15 +61317,15 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__Pyx_INCREF(__pyx_t_13);
__Pyx_INCREF(__pyx_t_7);
#else
- __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_3 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext;
@@ -61144,7 +61335,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__Pyx_GOTREF(__pyx_t_13);
index = 2; __pyx_t_7 = __pyx_t_8(__pyx_t_3); if (unlikely(!__pyx_t_7)) goto __pyx_L22_unpacking_failed;
__Pyx_GOTREF(__pyx_t_7);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_3), 3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L23_unpacking_done;
@@ -61152,7 +61343,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L23_unpacking_done:;
}
__Pyx_XDECREF(__pyx_v_f_ph);
@@ -61167,7 +61358,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_cur_scope->__pyx_v_al = __pyx_t_7;
__pyx_t_7 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2034
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2039
* for rule in rules:
* (f_ph, e_ph, al) = rule[:3]
* self.phrases_f[f_ph] += 1 # <<<<<<<<<<<<<<
@@ -61178,17 +61369,17 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_t_12 = __pyx_cur_scope->__pyx_v_self->phrases_f;
__Pyx_INCREF(__pyx_v_f_ph);
__pyx_t_7 = __pyx_v_f_ph;
- __pyx_t_13 = PyObject_GetItem(__pyx_t_12, __pyx_t_7); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_GetItem(__pyx_t_12, __pyx_t_7); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_13);
- __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_13, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_13, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- if (PyObject_SetItem(__pyx_t_12, __pyx_t_7, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_t_12, __pyx_t_7, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2035
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2040
* (f_ph, e_ph, al) = rule[:3]
* self.phrases_f[f_ph] += 1
* self.phrases_e[e_ph] += 1 # <<<<<<<<<<<<<<
@@ -61199,64 +61390,64 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_t_12 = __pyx_cur_scope->__pyx_v_self->phrases_e;
__Pyx_INCREF(__pyx_v_e_ph);
__pyx_t_7 = __pyx_v_e_ph;
- __pyx_t_4 = PyObject_GetItem(__pyx_t_12, __pyx_t_7); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetItem(__pyx_t_12, __pyx_t_7); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyObject_SetItem(__pyx_t_12, __pyx_t_7, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_t_12, __pyx_t_7, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2036
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2041
* self.phrases_f[f_ph] += 1
* self.phrases_e[e_ph] += 1
* self.phrases_fe[f_ph][e_ph] += 1 # <<<<<<<<<<<<<<
* if not self.phrases_al[f_ph][e_ph]:
* self.phrases_al[f_ph][e_ph] = al
*/
- __pyx_t_12 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->phrases_fe, __pyx_v_f_ph); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->phrases_fe, __pyx_v_f_ph); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_INCREF(__pyx_v_e_ph);
__pyx_t_7 = __pyx_v_e_ph;
- __pyx_t_13 = PyObject_GetItem(__pyx_t_12, __pyx_t_7); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_GetItem(__pyx_t_12, __pyx_t_7); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_13);
- __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_13, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_13, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- if (PyObject_SetItem(__pyx_t_12, __pyx_t_7, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_t_12, __pyx_t_7, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2037
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2042
* self.phrases_e[e_ph] += 1
* self.phrases_fe[f_ph][e_ph] += 1
* if not self.phrases_al[f_ph][e_ph]: # <<<<<<<<<<<<<<
* self.phrases_al[f_ph][e_ph] = al
*
*/
- __pyx_t_12 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->phrases_al, __pyx_v_f_ph); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->phrases_al, __pyx_v_f_ph); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
- __pyx_t_7 = PyObject_GetItem(__pyx_t_12, __pyx_v_e_ph); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_GetItem(__pyx_t_12, __pyx_v_e_ph); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_9 = (!__pyx_t_11);
if (__pyx_t_9) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2038
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2043
* self.phrases_fe[f_ph][e_ph] += 1
* if not self.phrases_al[f_ph][e_ph]:
* self.phrases_al[f_ph][e_ph] = al # <<<<<<<<<<<<<<
*
* # Update Bilexical counts
*/
- __pyx_t_7 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->phrases_al, __pyx_v_f_ph); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->phrases_al, __pyx_v_f_ph); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- if (PyObject_SetItem(__pyx_t_7, __pyx_v_e_ph, __pyx_cur_scope->__pyx_v_al) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_t_7, __pyx_v_e_ph, __pyx_cur_scope->__pyx_v_al) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L24;
}
@@ -61264,7 +61455,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
}
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2041
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2046
*
* # Update Bilexical counts
* for e_w in e_words: # <<<<<<<<<<<<<<
@@ -61275,7 +61466,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_t_14 = __pyx_cur_scope->__pyx_v_e_words; __Pyx_INCREF(__pyx_t_14); __pyx_t_2 = 0;
__pyx_t_5 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_e_words); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_e_words); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__pyx_t_5 = Py_TYPE(__pyx_t_14)->tp_iternext;
}
@@ -61283,23 +61474,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_14)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_14)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_7 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_14)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_7 = __pyx_t_5(__pyx_t_14);
if (unlikely(!__pyx_t_7)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -61309,7 +61500,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_v_e_w = __pyx_t_7;
__pyx_t_7 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2042
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2047
* # Update Bilexical counts
* for e_w in e_words:
* self.bilex_e[e_w] += 1 # <<<<<<<<<<<<<<
@@ -61320,19 +61511,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_t_7 = __pyx_cur_scope->__pyx_v_self->bilex_e;
__Pyx_INCREF(__pyx_v_e_w);
__pyx_t_12 = __pyx_v_e_w;
- __pyx_t_4 = PyObject_GetItem(__pyx_t_7, __pyx_t_12); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetItem(__pyx_t_7, __pyx_t_12); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyObject_SetItem(__pyx_t_7, __pyx_t_12, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_t_7, __pyx_t_12, __pyx_t_13) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2043
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2048
* for e_w in e_words:
* self.bilex_e[e_w] += 1
* for f_w in f_words: # <<<<<<<<<<<<<<
@@ -61343,7 +61534,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_t_14 = __pyx_cur_scope->__pyx_v_f_words; __Pyx_INCREF(__pyx_t_14); __pyx_t_2 = 0;
__pyx_t_5 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_f_words); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_f_words); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_14);
__pyx_t_5 = Py_TYPE(__pyx_t_14)->tp_iternext;
}
@@ -61351,23 +61542,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_14)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_14)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_7 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_14)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_14)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_2); __Pyx_INCREF(__pyx_t_7); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_14, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_7 = __pyx_t_5(__pyx_t_14);
if (unlikely(!__pyx_t_7)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -61377,7 +61568,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_v_f_w = __pyx_t_7;
__pyx_t_7 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2044
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2049
* self.bilex_e[e_w] += 1
* for f_w in f_words:
* self.bilex_f[f_w] += 1 # <<<<<<<<<<<<<<
@@ -61388,17 +61579,17 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_t_7 = __pyx_cur_scope->__pyx_v_self->bilex_f;
__Pyx_INCREF(__pyx_v_f_w);
__pyx_t_12 = __pyx_v_f_w;
- __pyx_t_13 = PyObject_GetItem(__pyx_t_7, __pyx_t_12); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_GetItem(__pyx_t_7, __pyx_t_12); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_13);
- __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_13, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_13, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- if (PyObject_SetItem(__pyx_t_7, __pyx_t_12, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_t_7, __pyx_t_12, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2045
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2050
* for f_w in f_words:
* self.bilex_f[f_w] += 1
* for e_w in e_words: # <<<<<<<<<<<<<<
@@ -61409,7 +61600,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_t_7 = __pyx_cur_scope->__pyx_v_e_words; __Pyx_INCREF(__pyx_t_7); __pyx_t_15 = 0;
__pyx_t_16 = NULL;
} else {
- __pyx_t_15 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_e_words); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_cur_scope->__pyx_v_e_words); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_16 = Py_TYPE(__pyx_t_7)->tp_iternext;
}
@@ -61417,23 +61608,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
if (!__pyx_t_16 && PyList_CheckExact(__pyx_t_7)) {
if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_7)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_12 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_15); __Pyx_INCREF(__pyx_t_12); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_15); __Pyx_INCREF(__pyx_t_12); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_12 = PySequence_ITEM(__pyx_t_7, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PySequence_ITEM(__pyx_t_7, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_16 && PyTuple_CheckExact(__pyx_t_7)) {
if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_15); __Pyx_INCREF(__pyx_t_12); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_15); __Pyx_INCREF(__pyx_t_12); __pyx_t_15++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_12 = PySequence_ITEM(__pyx_t_7, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PySequence_ITEM(__pyx_t_7, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_12 = __pyx_t_16(__pyx_t_7);
if (unlikely(!__pyx_t_12)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -61443,23 +61634,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_25add_instance(struct _
__pyx_v_e_w = __pyx_t_12;
__pyx_t_12 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2046
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2051
* self.bilex_f[f_w] += 1
* for e_w in e_words:
* self.bilex_fe[f_w][e_w] += 1 # <<<<<<<<<<<<<<
*
* # Create a rule from source, target, non-terminals, and alignments
*/
- __pyx_t_12 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->bilex_fe, __pyx_v_f_w); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_self->bilex_fe, __pyx_v_f_w); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_INCREF(__pyx_v_e_w);
__pyx_t_4 = __pyx_v_e_w;
- __pyx_t_13 = PyObject_GetItem(__pyx_t_12, __pyx_t_4); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyObject_GetItem(__pyx_t_12, __pyx_t_4); if (!__pyx_t_13) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_13);
- __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_13, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_13, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- if (PyObject_SetItem(__pyx_t_12, __pyx_t_4, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_t_12, __pyx_t_4, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
@@ -61536,31 +61727,31 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_28form_rule(PyObject *_
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_i)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_span)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e_span)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nt)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__al)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "form_rule") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "form_rule") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
goto __pyx_L5_argtuple_error;
@@ -61581,7 +61772,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_28form_rule(PyObject *_
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("form_rule", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.form_rule", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -61621,11 +61812,11 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9form_rule_lambda7(PyOb
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__y)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("lambda7", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("lambda7", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda7") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda7") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -61638,7 +61829,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9form_rule_lambda7(PyOb
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("lambda7", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("lambda7", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.form_rule.lambda7", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -61649,7 +61840,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9form_rule_lambda7(PyOb
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2052
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2057
*
* # Substitute in non-terminals
* nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) # <<<<<<<<<<<<<<
@@ -61668,11 +61859,11 @@ static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("lambda7", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_y, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_y, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
@@ -61680,7 +61871,7 @@ static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
@@ -61730,11 +61921,11 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda8(PyO
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__y)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("lambda8", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("lambda8", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda8") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda8") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -61747,7 +61938,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda8(PyO
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("lambda8", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("lambda8", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.form_rule.lambda8", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -61758,7 +61949,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda8(PyO
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2076
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2081
* # Adjusting alignment links takes some doing
* links = [list(link) for sub in al for link in sub]
* links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1])) # <<<<<<<<<<<<<<
@@ -61777,11 +61968,11 @@ static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("lambda8", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_y, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_y, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
@@ -61789,7 +61980,7 @@ static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_builtin_cmp, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__pyx_r = __pyx_t_2;
@@ -61811,7 +62002,7 @@ static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self
}
static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2110
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2115
* f = Phrase(f_sym)
* e = Phrase(e_sym)
* a = tuple(self.alignment.link(i, j) for (i, j) in links) # <<<<<<<<<<<<<<
@@ -61837,7 +62028,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_9form_rule_2genexpr(PyO
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -61879,13 +62070,13 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links)) { __Pyx_RaiseClosureNameError("links"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links)) { __Pyx_RaiseClosureNameError("links"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links)) {
__pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_links; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
__pyx_t_3 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_links); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -61893,23 +62084,23 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15
if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_3(__pyx_t_1);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -61925,7 +62116,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
@@ -61938,14 +62129,14 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_6);
#else
- __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else
{
Py_ssize_t index = -1;
- __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
@@ -61953,7 +62144,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15
__Pyx_GOTREF(__pyx_t_5);
index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_6);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_8 = NULL;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
goto __pyx_L7_unpacking_done;
@@ -61961,7 +62152,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L7_unpacking_done:;
}
__Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i);
@@ -61974,10 +62165,10 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15
__Pyx_GIVEREF(__pyx_t_6);
__pyx_cur_scope->__pyx_v_j = __pyx_t_6;
__pyx_t_6 = 0;
- if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_i); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_j); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = PyInt_FromLong(((struct __pyx_vtabstruct_3_sa_Alignment *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment->__pyx_vtab)->link(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment, __pyx_t_9, __pyx_t_10)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_i); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_cur_scope->__pyx_v_j); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(((struct __pyx_vtabstruct_3_sa_Alignment *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment->__pyx_vtab)->link(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment, __pyx_t_9, __pyx_t_10)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
@@ -61996,7 +62187,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15
__Pyx_XGOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
__pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyErr_SetNone(PyExc_StopIteration);
@@ -62016,7 +62207,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_9form_rule_4generator15
return NULL;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2049
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2054
*
* # Create a rule from source, target, non-terminals, and alignments
* def form_rule(self, f_i, e_i, f_span, e_span, nt, al): # <<<<<<<<<<<<<<
@@ -62073,52 +62264,52 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2052
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2057
*
* # Substitute in non-terminals
* nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3])) # <<<<<<<<<<<<<<
* f_sym = list(f_span[:])
* off = f_i
*/
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_nt);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_nt);
__Pyx_GIVEREF(__pyx_v_nt);
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9form_rule_lambda7, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9form_rule_lambda7, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__cmp), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__cmp), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_v_nt_inv = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2053
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2058
* # Substitute in non-terminals
* nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3]))
* f_sym = list(f_span[:]) # <<<<<<<<<<<<<<
* off = f_i
* for next_nt in nt:
*/
- __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_v_f_span, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_v_f_span, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_v_f_sym = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2054
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2059
* nt_inv = sorted(nt, cmp=lambda x, y: cmp(x[3], y[3]))
* f_sym = list(f_span[:])
* off = f_i # <<<<<<<<<<<<<<
@@ -62128,7 +62319,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__Pyx_INCREF(__pyx_v_f_i);
__pyx_v_off = __pyx_v_f_i;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2055
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2060
* f_sym = list(f_span[:])
* off = f_i
* for next_nt in nt: # <<<<<<<<<<<<<<
@@ -62139,7 +62330,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__pyx_t_3 = __pyx_v_nt; __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_nt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_nt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
}
@@ -62147,23 +62338,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_2 = __pyx_t_5(__pyx_t_3);
if (unlikely(!__pyx_t_2)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -62173,29 +62364,29 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__pyx_v_next_nt = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2056
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2061
* off = f_i
* for next_nt in nt:
* nt_len = (next_nt[2] - next_nt[1]) + 1 # <<<<<<<<<<<<<<
* i = 0
* while i < nt_len:
*/
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF(__pyx_v_nt_len);
__pyx_v_nt_len = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2057
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2062
* for next_nt in nt:
* nt_len = (next_nt[2] - next_nt[1]) + 1
* i = 0 # <<<<<<<<<<<<<<
@@ -62206,7 +62397,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__Pyx_XDECREF(__pyx_v_i);
__pyx_v_i = __pyx_int_0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2058
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2063
* nt_len = (next_nt[2] - next_nt[1]) + 1
* i = 0
* while i < nt_len: # <<<<<<<<<<<<<<
@@ -62214,83 +62405,83 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
* i += 1
*/
while (1) {
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!__pyx_t_7) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2059
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2064
* i = 0
* while i < nt_len:
* f_sym.pop(next_nt[1] - off) # <<<<<<<<<<<<<<
* i += 1
* f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0]))
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_f_sym), __pyx_n_s__pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_f_sym), __pyx_n_s__pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = PyNumber_Subtract(__pyx_t_6, __pyx_v_off); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Subtract(__pyx_t_6, __pyx_v_off); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2060
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2065
* while i < nt_len:
* f_sym.pop(next_nt[1] - off)
* i += 1 # <<<<<<<<<<<<<<
* f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0]))
* off += (nt_len - 1)
*/
- __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_2;
__pyx_t_2 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2061
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2066
* f_sym.pop(next_nt[1] - off)
* i += 1
* f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0])) # <<<<<<<<<<<<<<
* off += (nt_len - 1)
* e_sym = list(e_span[:])
*/
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_9)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_9)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_10 = PyList_Insert(__pyx_v_f_sym, __pyx_t_8, __pyx_t_6); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyList_Insert(__pyx_v_f_sym, __pyx_t_8, __pyx_t_6); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2062
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2067
* i += 1
* f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0]))
* off += (nt_len - 1) # <<<<<<<<<<<<<<
* e_sym = list(e_span[:])
* off = e_i
*/
- __pyx_t_6 = PyNumber_Subtract(__pyx_v_nt_len, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Subtract(__pyx_v_nt_len, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_v_off);
@@ -62299,27 +62490,27 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2063
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2068
* f_sym.insert(next_nt[1] - off, sym_setindex(self.category, next_nt[0]))
* off += (nt_len - 1)
* e_sym = list(e_span[:]) # <<<<<<<<<<<<<<
* off = e_i
* for next_nt in nt_inv:
*/
- __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_v_e_span, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_v_e_span, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_v_e_sym = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2064
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2069
* off += (nt_len - 1)
* e_sym = list(e_span[:])
* off = e_i # <<<<<<<<<<<<<<
@@ -62330,7 +62521,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__Pyx_DECREF(__pyx_v_off);
__pyx_v_off = __pyx_v_e_i;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2065
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2070
* e_sym = list(e_span[:])
* off = e_i
* for next_nt in nt_inv: # <<<<<<<<<<<<<<
@@ -62341,7 +62532,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__pyx_t_3 = __pyx_v_nt_inv; __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_nt_inv); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_nt_inv); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
}
@@ -62349,23 +62540,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_2 = __pyx_t_5(__pyx_t_3);
if (unlikely(!__pyx_t_2)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -62375,29 +62566,29 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__pyx_v_next_nt = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2066
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2071
* off = e_i
* for next_nt in nt_inv:
* nt_len = (next_nt[4] - next_nt[3]) + 1 # <<<<<<<<<<<<<<
* i = 0
* while i < nt_len:
*/
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_v_nt_len);
__pyx_v_nt_len = __pyx_t_6;
__pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2067
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2072
* for next_nt in nt_inv:
* nt_len = (next_nt[4] - next_nt[3]) + 1
* i = 0 # <<<<<<<<<<<<<<
@@ -62408,7 +62599,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__Pyx_XDECREF(__pyx_v_i);
__pyx_v_i = __pyx_int_0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2068
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2073
* nt_len = (next_nt[4] - next_nt[3]) + 1
* i = 0
* while i < nt_len: # <<<<<<<<<<<<<<
@@ -62416,83 +62607,83 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
* i += 1
*/
while (1) {
- __pyx_t_6 = PyObject_RichCompare(__pyx_v_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_RichCompare(__pyx_v_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (!__pyx_t_7) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2069
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2074
* i = 0
* while i < nt_len:
* e_sym.pop(next_nt[3] - off) # <<<<<<<<<<<<<<
* i += 1
* e_sym.insert(next_nt[3] - off, sym_setindex(self.category, next_nt[0]))
*/
- __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_e_sym), __pyx_n_s__pop); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_GetAttr(((PyObject *)__pyx_v_e_sym), __pyx_n_s__pop); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_v_off); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_v_off); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2070
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2075
* while i < nt_len:
* e_sym.pop(next_nt[3] - off)
* i += 1 # <<<<<<<<<<<<<<
* e_sym.insert(next_nt[3] - off, sym_setindex(self.category, next_nt[0]))
* off += (nt_len - 1)
*/
- __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_2;
__pyx_t_2 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2071
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2076
* e_sym.pop(next_nt[3] - off)
* i += 1
* e_sym.insert(next_nt[3] - off, sym_setindex(self.category, next_nt[0])) # <<<<<<<<<<<<<<
* off += (nt_len - 1)
*
*/
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_next_nt, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_next_nt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_9)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_9)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_10 = PyList_Insert(__pyx_v_e_sym, __pyx_t_8, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyList_Insert(__pyx_v_e_sym, __pyx_t_8, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2072
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2077
* i += 1
* e_sym.insert(next_nt[3] - off, sym_setindex(self.category, next_nt[0]))
* off += (nt_len - 1) # <<<<<<<<<<<<<<
*
* # Adjusting alignment links takes some doing
*/
- __pyx_t_1 = PyNumber_Subtract(__pyx_v_nt_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Subtract(__pyx_v_nt_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_v_off);
@@ -62501,20 +62692,20 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2075
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2080
*
* # Adjusting alignment links takes some doing
* links = [list(link) for sub in al for link in sub] # <<<<<<<<<<<<<<
* links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1]))
* links_len = len(links)
*/
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
if (PyList_CheckExact(__pyx_v_al) || PyTuple_CheckExact(__pyx_v_al)) {
__pyx_t_2 = __pyx_v_al; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
__pyx_t_5 = NULL;
} else {
- __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_al); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_al); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext;
}
@@ -62522,23 +62713,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_2)) {
if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_2)) {
if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_1 = __pyx_t_5(__pyx_t_2);
if (unlikely(!__pyx_t_1)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -62551,7 +62742,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__pyx_t_1 = __pyx_v_sub; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0;
__pyx_t_11 = NULL;
} else {
- __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_sub); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_sub); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -62559,23 +62750,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_6 = __pyx_t_11(__pyx_t_1);
if (unlikely(!__pyx_t_6)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -62584,15 +62775,15 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__Pyx_XDECREF(__pyx_v_link);
__pyx_v_link = __pyx_t_6;
__pyx_t_6 = 0;
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(__pyx_v_link);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_link);
__Pyx_GIVEREF(__pyx_v_link);
- __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
- if (unlikely(__Pyx_PyList_Append(__pyx_t_3, (PyObject*)__pyx_t_12))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_PyList_Append(__pyx_t_3, (PyObject*)__pyx_t_12))) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -62603,32 +62794,32 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__pyx_cur_scope->__pyx_v_links = ((PyObject *)__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2076
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2081
* # Adjusting alignment links takes some doing
* links = [list(link) for sub in al for link in sub]
* links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1])) # <<<<<<<<<<<<<<
* links_len = len(links)
* nt_len = len(nt)
*/
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_links);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_links);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_links);
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda8, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_9form_rule_1lambda8, 0, NULL, __pyx_n_s___sa, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__cmp), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__cmp), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2081; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_v_links_inv = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2077
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2082
* links = [list(link) for sub in al for link in sub]
* links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1]))
* links_len = len(links) # <<<<<<<<<<<<<<
@@ -62637,28 +62828,28 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
*/
__pyx_t_1 = __pyx_cur_scope->__pyx_v_links;
__Pyx_INCREF(__pyx_t_1);
- __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_links_len = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2078
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2083
* links_inv = sorted(links, cmp=lambda x, y: cmp(x[1], y[1]))
* links_len = len(links)
* nt_len = len(nt) # <<<<<<<<<<<<<<
* nt_i = 0
* off = f_i
*/
- __pyx_t_4 = PyObject_Length(__pyx_v_nt); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2078; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Length(__pyx_v_nt); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_v_nt_len);
__pyx_v_nt_len = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2079
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2084
* links_len = len(links)
* nt_len = len(nt)
* nt_i = 0 # <<<<<<<<<<<<<<
@@ -62668,7 +62859,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__Pyx_INCREF(__pyx_int_0);
__pyx_v_nt_i = __pyx_int_0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2080
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2085
* nt_len = len(nt)
* nt_i = 0
* off = f_i # <<<<<<<<<<<<<<
@@ -62679,7 +62870,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__Pyx_DECREF(__pyx_v_off);
__pyx_v_off = __pyx_v_f_i;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2081
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2086
* nt_i = 0
* off = f_i
* i = 0 # <<<<<<<<<<<<<<
@@ -62690,7 +62881,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__Pyx_XDECREF(__pyx_v_i);
__pyx_v_i = __pyx_int_0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2082
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2087
* off = f_i
* i = 0
* while i < links_len: # <<<<<<<<<<<<<<
@@ -62698,12 +62889,12 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
* off += (nt[nt_i][2] - nt[nt_i][1])
*/
while (1) {
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_v_links_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_v_links_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!__pyx_t_7) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2083
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2088
* i = 0
* while i < links_len:
* while nt_i < nt_len and links[i][0] > nt[nt_i][1]: # <<<<<<<<<<<<<<
@@ -62711,24 +62902,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
* nt_i += 1
*/
while (1) {
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_nt_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_nt_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_7) {
- __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_links, __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_links, __pyx_v_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2083; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_14 = __pyx_t_13;
} else {
@@ -62736,82 +62927,82 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
}
if (!__pyx_t_14) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2084
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2089
* while i < links_len:
* while nt_i < nt_len and links[i][0] > nt[nt_i][1]:
* off += (nt[nt_i][2] - nt[nt_i][1]) # <<<<<<<<<<<<<<
* nt_i += 1
* links[i][0] -= off
*/
- __pyx_t_1 = PyObject_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetItem(__pyx_v_nt, __pyx_v_nt_i); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_v_off);
__pyx_v_off = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2085
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2090
* while nt_i < nt_len and links[i][0] > nt[nt_i][1]:
* off += (nt[nt_i][2] - nt[nt_i][1])
* nt_i += 1 # <<<<<<<<<<<<<<
* links[i][0] -= off
* i += 1
*/
- __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_nt_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_nt_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_v_nt_i);
__pyx_v_nt_i = __pyx_t_2;
__pyx_t_2 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2086
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2091
* off += (nt[nt_i][2] - nt[nt_i][1])
* nt_i += 1
* links[i][0] -= off # <<<<<<<<<<<<<<
* i += 1
* nt_i = 0
*/
- __pyx_t_2 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_links, __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_links, __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_t_4, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_t_4, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_v_off); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_v_off); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__Pyx_SetItemInt(__pyx_t_2, __pyx_t_4, __pyx_t_3, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_2, __pyx_t_4, __pyx_t_3, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2087
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2092
* nt_i += 1
* links[i][0] -= off
* i += 1 # <<<<<<<<<<<<<<
* nt_i = 0
* off = e_i
*/
- __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_2;
__pyx_t_2 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2088
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2093
* links[i][0] -= off
* i += 1
* nt_i = 0 # <<<<<<<<<<<<<<
@@ -62822,7 +63013,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__Pyx_DECREF(__pyx_v_nt_i);
__pyx_v_nt_i = __pyx_int_0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2089
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2094
* i += 1
* nt_i = 0
* off = e_i # <<<<<<<<<<<<<<
@@ -62833,7 +63024,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__Pyx_DECREF(__pyx_v_off);
__pyx_v_off = __pyx_v_e_i;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2090
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2095
* nt_i = 0
* off = e_i
* i = 0 # <<<<<<<<<<<<<<
@@ -62844,7 +63035,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__Pyx_DECREF(__pyx_v_i);
__pyx_v_i = __pyx_int_0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2091
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2096
* off = e_i
* i = 0
* while i < links_len: # <<<<<<<<<<<<<<
@@ -62852,12 +63043,12 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
* off += (nt_inv[nt_i][4] - nt_inv[nt_i][3])
*/
while (1) {
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_i, __pyx_v_links_len, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_RichCompare(__pyx_v_i, __pyx_v_links_len, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!__pyx_t_14) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2092
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2097
* i = 0
* while i < links_len:
* while nt_i < nt_len and links_inv[i][1] > nt_inv[nt_i][3]: # <<<<<<<<<<<<<<
@@ -62865,24 +63056,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
* nt_i += 1
*/
while (1) {
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_nt_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_RichCompare(__pyx_v_nt_i, __pyx_v_nt_len, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_14) {
- __pyx_t_2 = PyObject_GetItem(__pyx_v_links_inv, __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetItem(__pyx_v_links_inv, __pyx_v_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetItem(__pyx_v_nt_inv, __pyx_v_nt_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetItem(__pyx_v_nt_inv, __pyx_v_nt_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_13 = __pyx_t_7;
} else {
@@ -62890,82 +63081,82 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
}
if (!__pyx_t_13) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2093
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2098
* while i < links_len:
* while nt_i < nt_len and links_inv[i][1] > nt_inv[nt_i][3]:
* off += (nt_inv[nt_i][4] - nt_inv[nt_i][3]) # <<<<<<<<<<<<<<
* nt_i += 1
* links_inv[i][1] -= off
*/
- __pyx_t_2 = PyObject_GetItem(__pyx_v_nt_inv, __pyx_v_nt_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetItem(__pyx_v_nt_inv, __pyx_v_nt_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 4, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetItem(__pyx_v_nt_inv, __pyx_v_nt_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetItem(__pyx_v_nt_inv, __pyx_v_nt_i); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 3, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_off, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_v_off);
__pyx_v_off = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2094
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2099
* while nt_i < nt_len and links_inv[i][1] > nt_inv[nt_i][3]:
* off += (nt_inv[nt_i][4] - nt_inv[nt_i][3])
* nt_i += 1 # <<<<<<<<<<<<<<
* links_inv[i][1] -= off
* i += 1
*/
- __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_nt_i, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_nt_i, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_v_nt_i);
__pyx_v_nt_i = __pyx_t_3;
__pyx_t_3 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2095
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2100
* off += (nt_inv[nt_i][4] - nt_inv[nt_i][3])
* nt_i += 1
* links_inv[i][1] -= off # <<<<<<<<<<<<<<
* i += 1
*
*/
- __pyx_t_3 = PyObject_GetItem(__pyx_v_links_inv, __pyx_v_i); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_v_links_inv, __pyx_v_i); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = 1;
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_t_4, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, __pyx_t_4, sizeof(Py_ssize_t), PyInt_FromSsize_t); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_2, __pyx_v_off); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__Pyx_SetItemInt(__pyx_t_3, __pyx_t_4, __pyx_t_1, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetItemInt(__pyx_t_3, __pyx_t_4, __pyx_t_1, sizeof(Py_ssize_t), PyInt_FromSsize_t) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2096
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2101
* nt_i += 1
* links_inv[i][1] -= off
* i += 1 # <<<<<<<<<<<<<<
*
* # Find lexical span
*/
- __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_i, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_3;
__pyx_t_3 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2099
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2104
*
* # Find lexical span
* lex_f_i = f_i # <<<<<<<<<<<<<<
@@ -62975,75 +63166,75 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
__Pyx_INCREF(__pyx_v_f_i);
__pyx_v_lex_f_i = __pyx_v_f_i;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2100
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2105
* # Find lexical span
* lex_f_i = f_i
* lex_f_j = f_i + (len(f_span) - 1) # <<<<<<<<<<<<<<
* if nt:
* if nt[0][1] == lex_f_i:
*/
- __pyx_t_4 = PyObject_Length(__pyx_v_f_span); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = PyInt_FromSsize_t((__pyx_t_4 - 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Length(__pyx_v_f_span); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromSsize_t((__pyx_t_4 - 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PyNumber_Add(__pyx_v_f_i, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Add(__pyx_v_f_i, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_lex_f_j = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2101
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2106
* lex_f_i = f_i
* lex_f_j = f_i + (len(f_span) - 1)
* if nt: # <<<<<<<<<<<<<<
* if nt[0][1] == lex_f_i:
* lex_f_i += (nt[0][2] - nt[0][1]) + 1
*/
- __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_nt); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_13) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2102
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2107
* lex_f_j = f_i + (len(f_span) - 1)
* if nt:
* if nt[0][1] == lex_f_i: # <<<<<<<<<<<<<<
* lex_f_i += (nt[0][2] - nt[0][1]) + 1
* if nt[-1][2] == lex_f_j:
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_v_lex_f_i, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_v_lex_f_i, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_13) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2103
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2108
* if nt:
* if nt[0][1] == lex_f_i:
* lex_f_i += (nt[0][2] - nt[0][1]) + 1 # <<<<<<<<<<<<<<
* if nt[-1][2] == lex_f_j:
* lex_f_j -= (nt[-1][2] - nt[-1][1]) + 1
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_lex_f_i, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_lex_f_i, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_v_lex_f_i);
@@ -63053,49 +63244,49 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
}
__pyx_L24:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2104
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2109
* if nt[0][1] == lex_f_i:
* lex_f_i += (nt[0][2] - nt[0][1]) + 1
* if nt[-1][2] == lex_f_j: # <<<<<<<<<<<<<<
* lex_f_j -= (nt[-1][2] - nt[-1][1]) + 1
*
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_lex_f_j, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_lex_f_j, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_13) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2105
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2110
* lex_f_i += (nt[0][2] - nt[0][1]) + 1
* if nt[-1][2] == lex_f_j:
* lex_f_j -= (nt[-1][2] - nt[-1][1]) + 1 # <<<<<<<<<<<<<<
*
* # Create rule (f_phrase, e_phrase, links, f_link_min, f_link_max)
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 2, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nt, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_lex_f_j, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_lex_f_j, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_v_lex_f_j);
@@ -63108,63 +63299,63 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
}
__pyx_L23:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2108
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2113
*
* # Create rule (f_phrase, e_phrase, links, f_link_min, f_link_max)
* f = Phrase(f_sym) # <<<<<<<<<<<<<<
* e = Phrase(e_sym)
* a = tuple(self.alignment.link(i, j) for (i, j) in links)
*/
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_f_sym));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_f_sym));
__Pyx_GIVEREF(((PyObject *)__pyx_v_f_sym));
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__pyx_v_f = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2109
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2114
* # Create rule (f_phrase, e_phrase, links, f_link_min, f_link_max)
* f = Phrase(f_sym)
* e = Phrase(e_sym) # <<<<<<<<<<<<<<
* a = tuple(self.alignment.link(i, j) for (i, j) in links)
* return (f, e, a, lex_f_i, lex_f_j)
*/
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(((PyObject *)__pyx_v_e_sym));
PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_e_sym));
__Pyx_GIVEREF(((PyObject *)__pyx_v_e_sym));
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__pyx_v_e = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2110
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2115
* f = Phrase(f_sym)
* e = Phrase(e_sym)
* a = tuple(self.alignment.link(i, j) for (i, j) in links) # <<<<<<<<<<<<<<
* return (f, e, a, lex_f_i, lex_f_j)
*
*/
- __pyx_t_1 = __pyx_pf_3_sa_23HieroCachingRuleFactory_9form_rule_2genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_pf_3_sa_23HieroCachingRuleFactory_9form_rule_2genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__pyx_v_a = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2111
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2116
* e = Phrase(e_sym)
* a = tuple(self.alignment.link(i, j) for (i, j) in links)
* return (f, e, a, lex_f_i, lex_f_j) # <<<<<<<<<<<<<<
@@ -63172,7 +63363,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_27form_rule(struct __py
* # Rule string from rule
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(((PyObject *)__pyx_v_f));
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_f));
@@ -63257,16 +63448,16 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_30fmt_rule(PyObject *__
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__a)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fmt_rule") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fmt_rule") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
@@ -63281,7 +63472,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_30fmt_rule(PyObject *__
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("fmt_rule", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.fmt_rule", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -63293,7 +63484,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_30fmt_rule(PyObject *__
}
static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2115
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2120
* # Rule string from rule
* def fmt_rule(self, f, e, a):
* a_str = ' '.join('{0}-{1}'.format(*self.alignment.unlink(packed)) for packed in a) # <<<<<<<<<<<<<<
@@ -63319,7 +63510,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_8fmt_rule_genexpr(PyObj
__Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -63358,13 +63549,13 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16(
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a)) { __Pyx_RaiseClosureNameError("a"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a)) { __Pyx_RaiseClosureNameError("a"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
if (PyList_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a)) {
__pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_a; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
__pyx_t_3 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_a); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -63372,23 +63563,23 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16(
if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_3(__pyx_t_1);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -63399,24 +63590,24 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16(
__Pyx_GIVEREF(__pyx_t_4);
__pyx_cur_scope->__pyx_v_packed = __pyx_t_4;
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_137), __pyx_n_s__format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_138), __pyx_n_s__format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment), __pyx_n_s__unlink); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->alignment), __pyx_n_s__unlink); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_packed);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_cur_scope->__pyx_v_packed);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_packed);
- __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
- __pyx_t_6 = PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_6));
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
@@ -63437,7 +63628,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16(
__Pyx_XGOTREF(__pyx_t_1);
__pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
__pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyErr_SetNone(PyExc_StopIteration);
@@ -63457,7 +63648,7 @@ static PyObject *__pyx_gb_3_sa_23HieroCachingRuleFactory_8fmt_rule_2generator16(
return NULL;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2114
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2119
*
* # Rule string from rule
* def fmt_rule(self, f, e, a): # <<<<<<<<<<<<<<
@@ -63490,30 +63681,30 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_29fmt_rule(struct __pyx
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_a);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2115
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2120
* # Rule string from rule
* def fmt_rule(self, f, e, a):
* a_str = ' '.join('{0}-{1}'.format(*self.alignment.unlink(packed)) for packed in a) # <<<<<<<<<<<<<<
* return '[X] ||| {0} ||| {1} ||| {2}'.format(f, e, a_str)
*
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_67), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_67), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __pyx_pf_3_sa_23HieroCachingRuleFactory_8fmt_rule_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_pf_3_sa_23HieroCachingRuleFactory_8fmt_rule_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
__pyx_v_a_str = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2116
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2121
* def fmt_rule(self, f, e, a):
* a_str = ' '.join('{0}-{1}'.format(*self.alignment.unlink(packed)) for packed in a)
* return '[X] ||| {0} ||| {1} ||| {2}'.format(f, e, a_str) # <<<<<<<<<<<<<<
@@ -63521,9 +63712,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_29fmt_rule(struct __pyx
* # Debugging
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_138), __pyx_n_s__format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_139), __pyx_n_s__format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_f);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_f);
@@ -63534,7 +63725,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_29fmt_rule(struct __pyx
__Pyx_INCREF(__pyx_v_a_str);
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_a_str);
__Pyx_GIVEREF(__pyx_v_a_str);
- __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
@@ -63569,7 +63760,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_32dump_online_stats(PyO
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2119
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2124
*
* # Debugging
* def dump_online_stats(self): # <<<<<<<<<<<<<<
@@ -63599,75 +63790,75 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("dump_online_stats", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2120
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2125
* # Debugging
* def dump_online_stats(self):
* logger.info('------------------------------') # <<<<<<<<<<<<<<
* logger.info(' Online Stats ')
* logger.info('------------------------------')
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_140), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_141), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2121
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2126
* def dump_online_stats(self):
* logger.info('------------------------------')
* logger.info(' Online Stats ') # <<<<<<<<<<<<<<
* logger.info('------------------------------')
* logger.info('f')
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_142), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_143), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2122
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2127
* logger.info('------------------------------')
* logger.info(' Online Stats ')
* logger.info('------------------------------') # <<<<<<<<<<<<<<
* logger.info('f')
* for w in self.bilex_f:
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_143), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_144), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2123
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2128
* logger.info(' Online Stats ')
* logger.info('------------------------------')
* logger.info('f') # <<<<<<<<<<<<<<
* for w in self.bilex_f:
* logger.info(sym_tostring(w) + ' : ' + str(self.bilex_f[w]))
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_144), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_145), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2124
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2129
* logger.info('------------------------------')
* logger.info('f')
* for w in self.bilex_f: # <<<<<<<<<<<<<<
@@ -63678,7 +63869,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
__pyx_t_1 = __pyx_v_self->bilex_f; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
__pyx_t_4 = NULL;
} else {
- __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->bilex_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->bilex_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -63686,23 +63877,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_2 = __pyx_t_4(__pyx_t_1);
if (unlikely(!__pyx_t_2)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -63712,44 +63903,44 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
__pyx_v_w = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2125
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2130
* logger.info('f')
* for w in self.bilex_f:
* logger.info(sym_tostring(w) + ' : ' + str(self.bilex_f[w])) # <<<<<<<<<<<<<<
* logger.info('e')
* for w in self.bilex_e:
*/
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_w); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_6)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_w); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_6)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __pyx_t_7 = PyNumber_Add(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_kp_s_145)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyNumber_Add(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_kp_s_146)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetItem(__pyx_v_self->bilex_f, __pyx_v_w); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetItem(__pyx_v_self->bilex_f, __pyx_v_w); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
- __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyNumber_Add(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
__pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
@@ -63757,24 +63948,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2126
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2131
* for w in self.bilex_f:
* logger.info(sym_tostring(w) + ' : ' + str(self.bilex_f[w]))
* logger.info('e') # <<<<<<<<<<<<<<
* for w in self.bilex_e:
* logger.info(sym_tostring(w) + ' : ' + str(self.bilex_e[w]))
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_146), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_147), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2127
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2132
* logger.info(sym_tostring(w) + ' : ' + str(self.bilex_f[w]))
* logger.info('e')
* for w in self.bilex_e: # <<<<<<<<<<<<<<
@@ -63785,7 +63976,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
__pyx_t_1 = __pyx_v_self->bilex_e; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
__pyx_t_4 = NULL;
} else {
- __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->bilex_e); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->bilex_e); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -63793,23 +63984,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_8 = __pyx_t_4(__pyx_t_1);
if (unlikely(!__pyx_t_8)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -63819,44 +64010,44 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
__pyx_v_w = __pyx_t_8;
__pyx_t_8 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2128
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2133
* logger.info('e')
* for w in self.bilex_e:
* logger.info(sym_tostring(w) + ' : ' + str(self.bilex_e[w])) # <<<<<<<<<<<<<<
* logger.info('fe')
* for w in self.bilex_fe:
*/
- __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_2 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_w); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_8 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_6)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_w); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_6)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_8));
- __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_t_8), ((PyObject *)__pyx_kp_s_145)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_t_8), ((PyObject *)__pyx_kp_s_146)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
- __pyx_t_8 = PyObject_GetItem(__pyx_v_self->bilex_e, __pyx_v_w); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetItem(__pyx_v_self->bilex_e, __pyx_v_w); if (!__pyx_t_8) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
__pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
- __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_7);
__pyx_t_7 = 0;
- __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
@@ -63864,24 +64055,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2129
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2134
* for w in self.bilex_e:
* logger.info(sym_tostring(w) + ' : ' + str(self.bilex_e[w]))
* logger.info('fe') # <<<<<<<<<<<<<<
* for w in self.bilex_fe:
* for w2 in self.bilex_fe[w]:
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_147), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_k_tuple_148), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2130
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2135
* logger.info(sym_tostring(w) + ' : ' + str(self.bilex_e[w]))
* logger.info('fe')
* for w in self.bilex_fe: # <<<<<<<<<<<<<<
@@ -63892,7 +64083,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
__pyx_t_1 = __pyx_v_self->bilex_fe; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
__pyx_t_4 = NULL;
} else {
- __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->bilex_fe); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->bilex_fe); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -63900,23 +64091,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_7 = __pyx_t_4(__pyx_t_1);
if (unlikely(!__pyx_t_7)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -63926,20 +64117,20 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
__pyx_v_w = __pyx_t_7;
__pyx_t_7 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2131
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2136
* logger.info('fe')
* for w in self.bilex_fe:
* for w2 in self.bilex_fe[w]: # <<<<<<<<<<<<<<
* logger.info(sym_tostring(w) + ' : ' + sym_tostring(w2) + ' : ' + str(self.bilex_fe[w][w2]))
* logger.info('F')
*/
- __pyx_t_7 = PyObject_GetItem(__pyx_v_self->bilex_fe, __pyx_v_w); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_GetItem(__pyx_v_self->bilex_fe, __pyx_v_w); if (!__pyx_t_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
if (PyList_CheckExact(__pyx_t_7) || PyTuple_CheckExact(__pyx_t_7)) {
__pyx_t_8 = __pyx_t_7; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0;
__pyx_t_10 = NULL;
} else {
- __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext;
}
@@ -63948,23 +64139,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
if (!__pyx_t_10 && PyList_CheckExact(__pyx_t_8)) {
if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_8)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_7 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_10 && PyTuple_CheckExact(__pyx_t_8)) {
if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_7); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_7 = __pyx_t_10(__pyx_t_8);
if (unlikely(!__pyx_t_7)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -63974,57 +64165,57 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
__pyx_v_w2 = __pyx_t_7;
__pyx_t_7 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2132
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2137
* for w in self.bilex_fe:
* for w2 in self.bilex_fe[w]:
* logger.info(sym_tostring(w) + ' : ' + sym_tostring(w2) + ' : ' + str(self.bilex_fe[w][w2])) # <<<<<<<<<<<<<<
* logger.info('F')
* for ph in self.phrases_f:
*/
- __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_2 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_w); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_7 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_w); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_7));
- __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_t_7), ((PyObject *)__pyx_kp_s_145)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_t_7), ((PyObject *)__pyx_kp_s_146)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
- __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_w2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_7 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyInt_AsInt(__pyx_v_w2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyBytes_FromString(__pyx_f_3_sa_sym_tostring(__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_7));
- __pyx_t_11 = PyNumber_Add(__pyx_t_5, ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyNumber_Add(__pyx_t_5, ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
- __pyx_t_7 = PyNumber_Add(__pyx_t_11, ((PyObject *)__pyx_kp_s_145)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyNumber_Add(__pyx_t_11, ((PyObject *)__pyx_kp_s_146)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = PyObject_GetItem(__pyx_v_self->bilex_fe, __pyx_v_w); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_GetItem(__pyx_v_self->bilex_fe, __pyx_v_w); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_5 = PyObject_GetItem(__pyx_t_11, __pyx_v_w2); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_GetItem(__pyx_t_11, __pyx_v_w2); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
- __pyx_t_11 = PyNumber_Add(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyNumber_Add(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_11);
__Pyx_GIVEREF(__pyx_t_11);
__pyx_t_11 = 0;
- __pyx_t_11 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
@@ -64034,24 +64225,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2133
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2138
* for w2 in self.bilex_fe[w]:
* logger.info(sym_tostring(w) + ' : ' + sym_tostring(w2) + ' : ' + str(self.bilex_fe[w][w2]))
* logger.info('F') # <<<<<<<<<<<<<<
* for ph in self.phrases_f:
* logger.info(str(ph) + ' ||| ' + str(self.phrases_f[ph]))
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_148), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_149), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2134
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2139
* logger.info(sym_tostring(w) + ' : ' + sym_tostring(w2) + ' : ' + str(self.bilex_fe[w][w2]))
* logger.info('F')
* for ph in self.phrases_f: # <<<<<<<<<<<<<<
@@ -64062,7 +64253,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
__pyx_t_1 = __pyx_v_self->phrases_f; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
__pyx_t_4 = NULL;
} else {
- __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->phrases_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->phrases_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -64070,23 +64261,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_8 = __pyx_t_4(__pyx_t_1);
if (unlikely(!__pyx_t_8)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -64096,49 +64287,49 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
__pyx_v_ph = __pyx_t_8;
__pyx_t_8 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2135
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2140
* logger.info('F')
* for ph in self.phrases_f:
* logger.info(str(ph) + ' ||| ' + str(self.phrases_f[ph])) # <<<<<<<<<<<<<<
* logger.info('E')
* for ph in self.phrases_e:
*/
- __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_11 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__info); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(__pyx_v_ph);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_ph);
__Pyx_GIVEREF(__pyx_v_ph);
- __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
- __pyx_t_8 = PyNumber_Add(__pyx_t_5, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyNumber_Add(__pyx_t_5, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_GetItem(__pyx_v_self->phrases_f, __pyx_v_ph); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_GetItem(__pyx_v_self->phrases_f, __pyx_v_ph); if (!__pyx_t_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Add(__pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __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_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(__pyx_t_11, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
@@ -64146,24 +64337,24 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2136
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2141
* for ph in self.phrases_f:
* logger.info(str(ph) + ' ||| ' + str(self.phrases_f[ph]))
* logger.info('E') # <<<<<<<<<<<<<<
* for ph in self.phrases_e:
* logger.info(str(ph) + ' ||| ' + str(self.phrases_e[ph]))
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_149), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_150), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2137
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2142
* logger.info(str(ph) + ' ||| ' + str(self.phrases_f[ph]))
* logger.info('E')
* for ph in self.phrases_e: # <<<<<<<<<<<<<<
@@ -64174,7 +64365,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
__pyx_t_1 = __pyx_v_self->phrases_e; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
__pyx_t_4 = NULL;
} else {
- __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->phrases_e); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->phrases_e); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -64182,23 +64373,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_2 = __pyx_t_4(__pyx_t_1);
if (unlikely(!__pyx_t_2)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -64208,49 +64399,49 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
__pyx_v_ph = __pyx_t_2;
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2138
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2143
* logger.info('E')
* for ph in self.phrases_e:
* logger.info(str(ph) + ' ||| ' + str(self.phrases_e[ph])) # <<<<<<<<<<<<<<
* logger.info('FE')
* self.dump_online_rules()
*/
- __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__info); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_ph);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_ph);
__Pyx_GIVEREF(__pyx_v_ph);
- __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Add(__pyx_t_11, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_t_11, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = PyObject_GetItem(__pyx_v_self->phrases_e, __pyx_v_ph); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_GetItem(__pyx_v_self->phrases_e, __pyx_v_ph); if (!__pyx_t_11) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_11);
__Pyx_GIVEREF(__pyx_t_11);
__pyx_t_11 = 0;
- __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
- __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_11); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
__pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_11), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
@@ -64258,33 +64449,33 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_31dump_online_stats(str
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2139
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2144
* for ph in self.phrases_e:
* logger.info(str(ph) + ' ||| ' + str(self.phrases_e[ph]))
* logger.info('FE') # <<<<<<<<<<<<<<
* self.dump_online_rules()
*
*/
- __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_150), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_k_tuple_151), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2140
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2145
* logger.info(str(ph) + ' ||| ' + str(self.phrases_e[ph]))
* logger.info('FE')
* self.dump_online_rules() # <<<<<<<<<<<<<<
*
* def dump_online_rules(self):
*/
- __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__dump_online_rules); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__dump_online_rules); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -64320,7 +64511,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_34dump_online_rules(PyO
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2142
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2147
* self.dump_online_rules()
*
* def dump_online_rules(self): # <<<<<<<<<<<<<<
@@ -64350,7 +64541,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_33dump_online_rules(str
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("dump_online_rules", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2143
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2148
*
* def dump_online_rules(self):
* for ph in self.phrases_fe: # <<<<<<<<<<<<<<
@@ -64361,7 +64552,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_33dump_online_rules(str
__pyx_t_1 = __pyx_v_self->phrases_fe; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
__pyx_t_3 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->phrases_fe); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->phrases_fe); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext;
}
@@ -64369,23 +64560,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_33dump_online_rules(str
if (!__pyx_t_3 && PyList_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_3 && PyTuple_CheckExact(__pyx_t_1)) {
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_3(__pyx_t_1);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -64395,20 +64586,20 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_33dump_online_rules(str
__pyx_v_ph = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2144
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2149
* def dump_online_rules(self):
* for ph in self.phrases_fe:
* for ph2 in self.phrases_fe[ph]: # <<<<<<<<<<<<<<
* logger.info(self.fmt_rule(str(ph), str(ph2), self.phrases_al[ph][ph2]) + ' ||| ' + str(self.phrases_fe[ph][ph2]))
*
*/
- __pyx_t_4 = PyObject_GetItem(__pyx_v_self->phrases_fe, __pyx_v_ph); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetItem(__pyx_v_self->phrases_fe, __pyx_v_ph); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
__pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
__pyx_t_7 = NULL;
} else {
- __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext;
}
@@ -64417,23 +64608,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_33dump_online_rules(str
if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_5)) {
if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_5)) {
if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
#if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_4 = __pyx_t_7(__pyx_t_5);
if (unlikely(!__pyx_t_4)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
@@ -64443,42 +64634,42 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_33dump_online_rules(str
__pyx_v_ph2 = __pyx_t_4;
__pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2145
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2150
* for ph in self.phrases_fe:
* for ph2 in self.phrases_fe[ph]:
* logger.info(self.fmt_rule(str(ph), str(ph2), self.phrases_al[ph][ph2]) + ' ||| ' + str(self.phrases_fe[ph][ph2])) # <<<<<<<<<<<<<<
*
* # Lookup online stats for phrase pair (f, e). Return None if no match.
*/
- __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__logger); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__info); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__fmt_rule); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__fmt_rule); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_INCREF(__pyx_v_ph);
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_ph);
__Pyx_GIVEREF(__pyx_v_ph);
- __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
- __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_INCREF(__pyx_v_ph2);
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_ph2);
__Pyx_GIVEREF(__pyx_v_ph2);
- __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_GetItem(__pyx_v_self->phrases_al, __pyx_v_ph); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyObject_GetItem(__pyx_v_self->phrases_al, __pyx_v_ph); if (!__pyx_t_9) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_12 = PyObject_GetItem(__pyx_t_9, __pyx_v_ph2); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyObject_GetItem(__pyx_t_9, __pyx_v_ph2); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10);
__Pyx_GIVEREF(__pyx_t_10);
@@ -64489,36 +64680,36 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_33dump_online_rules(str
__pyx_t_10 = 0;
__pyx_t_11 = 0;
__pyx_t_12 = 0;
- __pyx_t_12 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
- __pyx_t_9 = PyNumber_Add(__pyx_t_12, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyNumber_Add(__pyx_t_12, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_12 = PyObject_GetItem(__pyx_v_self->phrases_fe, __pyx_v_ph); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyObject_GetItem(__pyx_v_self->phrases_fe, __pyx_v_ph); if (!__pyx_t_12) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
- __pyx_t_4 = PyObject_GetItem(__pyx_t_12, __pyx_v_ph2); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_GetItem(__pyx_t_12, __pyx_v_ph2); if (!__pyx_t_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_12), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(((PyObject *)__pyx_t_12)); __pyx_t_12 = 0;
- __pyx_t_12 = PyNumber_Add(__pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyNumber_Add(__pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12);
__Pyx_GIVEREF(__pyx_t_12);
__pyx_t_12 = 0;
- __pyx_t_12 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
@@ -64577,11 +64768,11 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_36online_ctx_lookup(PyO
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__e)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("online_ctx_lookup", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("online_ctx_lookup", 1, 2, 2, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "online_ctx_lookup") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "online_ctx_lookup") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -64594,7 +64785,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_36online_ctx_lookup(PyO
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("online_ctx_lookup", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2149; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("online_ctx_lookup", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.online_ctx_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -64605,7 +64796,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_36online_ctx_lookup(PyO
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2149
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2154
* # Lookup online stats for phrase pair (f, e). Return None if no match.
* # IMPORTANT: use get() to avoid adding items to defaultdict
* def online_ctx_lookup(self, f, e): # <<<<<<<<<<<<<<
@@ -64630,7 +64821,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(str
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("online_ctx_lookup", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2150
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2155
* # IMPORTANT: use get() to avoid adding items to defaultdict
* def online_ctx_lookup(self, f, e):
* if self.online: # <<<<<<<<<<<<<<
@@ -64639,16 +64830,16 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(str
*/
if (__pyx_v_self->online) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2151
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2156
* def online_ctx_lookup(self, f, e):
* if self.online:
* fcount = self.phrases_f.get(f, 0) # <<<<<<<<<<<<<<
* fsample_count = self.samples_f.get(f, 0)
* d = self.phrases_fe.get(f, None)
*/
- __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->phrases_f, __pyx_n_s__get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->phrases_f, __pyx_n_s__get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_f);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_f);
@@ -64656,23 +64847,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(str
__Pyx_INCREF(__pyx_int_0);
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0);
__Pyx_GIVEREF(__pyx_int_0);
- __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_v_fcount = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2152
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2157
* if self.online:
* fcount = self.phrases_f.get(f, 0)
* fsample_count = self.samples_f.get(f, 0) # <<<<<<<<<<<<<<
* d = self.phrases_fe.get(f, None)
* paircount = d.get(e, 0) if d else 0
*/
- __pyx_t_3 = PyObject_GetAttr(__pyx_v_self->samples_f, __pyx_n_s__get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetAttr(__pyx_v_self->samples_f, __pyx_n_s__get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_f);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_f);
@@ -64680,23 +64871,23 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(str
__Pyx_INCREF(__pyx_int_0);
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0);
__Pyx_GIVEREF(__pyx_int_0);
- __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_v_fsample_count = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2153
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2158
* fcount = self.phrases_f.get(f, 0)
* fsample_count = self.samples_f.get(f, 0)
* d = self.phrases_fe.get(f, None) # <<<<<<<<<<<<<<
* paircount = d.get(e, 0) if d else 0
* return OnlineFeatureContext(fcount, fsample_count, paircount, self.bilex_f, self.bilex_e, self.bilex_fe)
*/
- __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->phrases_fe, __pyx_n_s__get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetAttr(__pyx_v_self->phrases_fe, __pyx_n_s__get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_f);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_f);
@@ -64704,25 +64895,25 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(str
__Pyx_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
__Pyx_GIVEREF(Py_None);
- __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_v_d = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2154
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2159
* fsample_count = self.samples_f.get(f, 0)
* d = self.phrases_fe.get(f, None)
* paircount = d.get(e, 0) if d else 0 # <<<<<<<<<<<<<<
* return OnlineFeatureContext(fcount, fsample_count, paircount, self.bilex_f, self.bilex_e, self.bilex_fe)
* return None
*/
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_d); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_d); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_4) {
- __pyx_t_2 = PyObject_GetAttr(__pyx_v_d, __pyx_n_s__get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_GetAttr(__pyx_v_d, __pyx_n_s__get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_e);
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_e);
@@ -64730,7 +64921,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(str
__Pyx_INCREF(__pyx_int_0);
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_0);
__Pyx_GIVEREF(__pyx_int_0);
- __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
@@ -64743,7 +64934,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(str
__pyx_v_paircount = __pyx_t_3;
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2155
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2160
* d = self.phrases_fe.get(f, None)
* paircount = d.get(e, 0) if d else 0
* return OnlineFeatureContext(fcount, fsample_count, paircount, self.bilex_f, self.bilex_e, self.bilex_fe) # <<<<<<<<<<<<<<
@@ -64751,9 +64942,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(str
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s_151); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s_152); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_v_fcount);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_fcount);
@@ -64773,7 +64964,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(str
__Pyx_INCREF(__pyx_v_self->bilex_fe);
PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_v_self->bilex_fe);
__Pyx_GIVEREF(__pyx_v_self->bilex_fe);
- __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
@@ -64784,7 +64975,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_35online_ctx_lookup(str
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2156
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2161
* paircount = d.get(e, 0) if d else 0
* return OnlineFeatureContext(fcount, fsample_count, paircount, self.bilex_f, self.bilex_e, self.bilex_fe)
* return None # <<<<<<<<<<<<<<
@@ -64865,36 +65056,36 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extrac
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f_j)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lex_i)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lex_j)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 3); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__wc)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 4); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ntc)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 5); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__syms)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, 6); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extract") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "extract") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
goto __pyx_L5_argtuple_error;
@@ -64917,7 +65108,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extrac
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("extract", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.HieroCachingRuleFactory.get_f_phrases.extract", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -64928,7 +65119,7 @@ static PyObject *__pyx_pw_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extrac
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2166
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2171
* phrases = set() # (fphrase, lex_i, lex_j)
*
* def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): # <<<<<<<<<<<<<<
@@ -64960,33 +65151,33 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract
__pyx_outer_scope = (struct __pyx_obj_3_sa___pyx_scope_struct_26_get_f_phrases *) __Pyx_CyFunction_GetClosure(__pyx_self);
__pyx_cur_scope = __pyx_outer_scope;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2168
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2173
* def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms):
* # Phrase extraction limits
* if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size: # <<<<<<<<<<<<<<
* return
* # Extend with word
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_f_len)) { __Pyx_RaiseClosureNameError("f_len"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_1 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_f_len)) { __Pyx_RaiseClosureNameError("f_len"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_1 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_f_len, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_RichCompare(__pyx_v_f_j, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (!__pyx_t_3) {
- __pyx_t_2 = PyNumber_Subtract(__pyx_v_f_j, __pyx_v_f_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Subtract(__pyx_v_f_j, __pyx_v_f_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_initial_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_6 = __pyx_t_5;
} else {
@@ -64994,7 +65185,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract
}
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2169
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2174
* # Phrase extraction limits
* if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size:
* return # <<<<<<<<<<<<<<
@@ -65008,58 +65199,58 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract
}
__pyx_L3:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2171
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2176
* return
* # Extend with word
* if wc + ntc < self.max_length: # <<<<<<<<<<<<<<
* syms.append(f_words[f_j])
* f = Phrase(syms)
*/
- __pyx_t_4 = PyNumber_Add(__pyx_v_wc, __pyx_v_ntc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Add(__pyx_v_wc, __pyx_v_ntc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_6) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2172
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2177
* # Extend with word
* if wc + ntc < self.max_length:
* syms.append(f_words[f_j]) # <<<<<<<<<<<<<<
* f = Phrase(syms)
* new_lex_i = min(lex_i, f_j)
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_f_words, __pyx_v_f_j); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_f_words)) { __Pyx_RaiseClosureNameError("f_words"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_1 = PyObject_GetItem(__pyx_cur_scope->__pyx_v_f_words, __pyx_v_f_j); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_syms, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Append(__pyx_v_syms, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2173
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2178
* if wc + ntc < self.max_length:
* syms.append(f_words[f_j])
* f = Phrase(syms) # <<<<<<<<<<<<<<
* new_lex_i = min(lex_i, f_j)
* new_lex_j = max(lex_j, f_j)
*/
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_syms);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_syms);
__Pyx_GIVEREF(__pyx_v_syms);
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_v_f = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2174
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2179
* syms.append(f_words[f_j])
* f = Phrase(syms)
* new_lex_i = min(lex_i, f_j) # <<<<<<<<<<<<<<
@@ -65070,8 +65261,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract
__pyx_t_1 = __pyx_v_f_j;
__Pyx_INCREF(__pyx_v_lex_i);
__pyx_t_2 = __pyx_v_lex_i;
- __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__pyx_t_6) {
__Pyx_INCREF(__pyx_t_1);
@@ -65086,7 +65277,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract
__pyx_v_new_lex_i = __pyx_t_4;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2175
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2180
* f = Phrase(syms)
* new_lex_i = min(lex_i, f_j)
* new_lex_j = max(lex_j, f_j) # <<<<<<<<<<<<<<
@@ -65097,8 +65288,8 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract
__pyx_t_4 = __pyx_v_f_j;
__Pyx_INCREF(__pyx_v_lex_j);
__pyx_t_1 = __pyx_v_lex_j;
- __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
if (__pyx_t_6) {
__Pyx_INCREF(__pyx_t_4);
@@ -65113,17 +65304,17 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract
__pyx_v_new_lex_j = __pyx_t_2;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2176
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2181
* new_lex_i = min(lex_i, f_j)
* new_lex_j = max(lex_j, f_j)
* phrases.add((f, new_lex_i, new_lex_j)) # <<<<<<<<<<<<<<
* extract(f_i, f_j + 1, new_lex_i, new_lex_j, wc + 1, ntc, syms)
* syms.pop()
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_phrases)) { __Pyx_RaiseClosureNameError("phrases"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_2 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_phrases, __pyx_n_s__add); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_phrases)) { __Pyx_RaiseClosureNameError("phrases"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_2 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_phrases, __pyx_n_s__add); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_v_f));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_f));
@@ -65134,30 +65325,30 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract
__Pyx_INCREF(__pyx_v_new_lex_j);
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_new_lex_j);
__Pyx_GIVEREF(__pyx_v_new_lex_j);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4));
__Pyx_GIVEREF(((PyObject *)__pyx_t_4));
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2177
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2182
* new_lex_j = max(lex_j, f_j)
* phrases.add((f, new_lex_i, new_lex_j))
* extract(f_i, f_j + 1, new_lex_i, new_lex_j, wc + 1, ntc, syms) # <<<<<<<<<<<<<<
* syms.pop()
* # Extend with existing non-terminal
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Add(__pyx_v_wc, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_f_i);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_f_i);
@@ -65180,37 +65371,37 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract
__Pyx_GIVEREF(__pyx_v_syms);
__pyx_t_4 = 0;
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2178
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2183
* phrases.add((f, new_lex_i, new_lex_j))
* extract(f_i, f_j + 1, new_lex_i, new_lex_j, wc + 1, ntc, syms)
* syms.pop() # <<<<<<<<<<<<<<
* # Extend with existing non-terminal
* if syms and sym_isvar(syms[-1]):
*/
- __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_syms); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_syms); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L4;
}
__pyx_L4:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2180
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2185
* syms.pop()
* # Extend with existing non-terminal
* if syms and sym_isvar(syms[-1]): # <<<<<<<<<<<<<<
* # Don't re-extract the same phrase
* extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc, syms)
*/
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_syms); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_syms); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (__pyx_t_6) {
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_syms, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_syms, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_3 = __pyx_f_3_sa_sym_isvar(__pyx_t_8);
} else {
@@ -65218,17 +65409,17 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract
}
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2182
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2187
* if syms and sym_isvar(syms[-1]):
* # Don't re-extract the same phrase
* extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc, syms) # <<<<<<<<<<<<<<
* # Extend with new non-terminal
* if wc + ntc < self.max_length:
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_1 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_f_i);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_f_i);
@@ -65251,7 +65442,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract
PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_v_syms);
__Pyx_GIVEREF(__pyx_v_syms);
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -65259,44 +65450,44 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2184
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2189
* extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc, syms)
* # Extend with new non-terminal
* if wc + ntc < self.max_length: # <<<<<<<<<<<<<<
* if not syms or (ntc < self.max_nonterminals and not sym_isvar(syms[-1])):
* syms.append(sym_setindex(self.category, ntc + 1))
*/
- __pyx_t_1 = PyNumber_Add(__pyx_v_wc, __pyx_v_ntc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Add(__pyx_v_wc, __pyx_v_ntc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_length); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2185
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2190
* # Extend with new non-terminal
* if wc + ntc < self.max_length:
* if not syms or (ntc < self.max_nonterminals and not sym_isvar(syms[-1])): # <<<<<<<<<<<<<<
* syms.append(sym_setindex(self.category, ntc + 1))
* f = Phrase(syms)
*/
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_syms); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_syms); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_6 = (!__pyx_t_3);
if (!__pyx_t_6) {
- __pyx_t_4 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_nonterminals); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_self->max_nonterminals); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_ntc, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_RichCompare(__pyx_v_ntc, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_3) {
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_syms, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_syms, -1, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_5 = (!__pyx_f_3_sa_sym_isvar(__pyx_t_8));
__pyx_t_9 = __pyx_t_5;
@@ -65309,66 +65500,66 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract
}
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2186
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2191
* if wc + ntc < self.max_length:
* if not syms or (ntc < self.max_nonterminals and not sym_isvar(syms[-1])):
* syms.append(sym_setindex(self.category, ntc + 1)) # <<<<<<<<<<<<<<
* f = Phrase(syms)
* if wc > 0:
*/
- __pyx_t_2 = PyNumber_Add(__pyx_v_ntc, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_v_ntc, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_8)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromLong(__pyx_f_3_sa_sym_setindex(__pyx_cur_scope->__pyx_v_self->category, __pyx_t_8)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_Append(__pyx_v_syms, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Append(__pyx_v_syms, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2187
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2192
* if not syms or (ntc < self.max_nonterminals and not sym_isvar(syms[-1])):
* syms.append(sym_setindex(self.category, ntc + 1))
* f = Phrase(syms) # <<<<<<<<<<<<<<
* if wc > 0:
* phrases.add((f, lex_i, lex_j))
*/
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_syms);
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_syms);
__Pyx_GIVEREF(__pyx_v_syms);
- __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_3_sa_Phrase)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
__Pyx_XDECREF(((PyObject *)__pyx_v_f));
__pyx_v_f = ((struct __pyx_obj_3_sa_Phrase *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2188
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2193
* syms.append(sym_setindex(self.category, ntc + 1))
* f = Phrase(syms)
* if wc > 0: # <<<<<<<<<<<<<<
* phrases.add((f, lex_i, lex_j))
* extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc + 1, syms)
*/
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_wc, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_RichCompare(__pyx_v_wc, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (__pyx_t_3) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2189
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2194
* f = Phrase(syms)
* if wc > 0:
* phrases.add((f, lex_i, lex_j)) # <<<<<<<<<<<<<<
* extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc + 1, syms)
* syms.pop()
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_phrases)) { __Pyx_RaiseClosureNameError("phrases"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_2 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_phrases, __pyx_n_s__add); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_phrases)) { __Pyx_RaiseClosureNameError("phrases"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_2 = PyObject_GetAttr(__pyx_cur_scope->__pyx_v_phrases, __pyx_n_s__add); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(((PyObject *)__pyx_v_f));
PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_f));
@@ -65379,12 +65570,12 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract
__Pyx_INCREF(__pyx_v_lex_j);
PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_lex_j);
__Pyx_GIVEREF(__pyx_v_lex_j);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_4));
__Pyx_GIVEREF(((PyObject *)__pyx_t_4));
__pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
@@ -65393,19 +65584,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract
}
__pyx_L8:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2190
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2195
* if wc > 0:
* phrases.add((f, lex_i, lex_j))
* extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc + 1, syms) # <<<<<<<<<<<<<<
* syms.pop()
*
*/
- if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_cur_scope->__pyx_v_extract)) { __Pyx_RaiseClosureNameError("extract"); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ __pyx_t_4 = PyNumber_Add(__pyx_v_f_j, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyNumber_Add(__pyx_v_ntc, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Add(__pyx_v_ntc, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_f_i);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_f_i);
@@ -65428,19 +65619,19 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract
__Pyx_GIVEREF(__pyx_v_syms);
__pyx_t_4 = 0;
__pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2191
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2196
* phrases.add((f, lex_i, lex_j))
* extract(f_i, f_j + 1, lex_i, lex_j, wc, ntc + 1, syms)
* syms.pop() # <<<<<<<<<<<<<<
*
* # Try to extract phrases from every f index
*/
- __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_syms); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Pop(__pyx_v_syms); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
goto __pyx_L7;
@@ -65468,7 +65659,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_13get_f_phrases_extract
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2161
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2166
* # (Used for EGivenFCoherent)
* # Return set of (fphrase, lex_i, lex_j)
* def get_f_phrases(self, f_words): # <<<<<<<<<<<<<<
@@ -65504,7 +65695,7 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_37get_f_phrases(struct
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_f_words);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_f_words);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2163
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2168
* def get_f_phrases(self, f_words):
*
* f_len = len(f_words) # <<<<<<<<<<<<<<
@@ -65513,64 +65704,64 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_37get_f_phrases(struct
*/
__pyx_t_1 = __pyx_cur_scope->__pyx_v_f_words;
__Pyx_INCREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_cur_scope->__pyx_v_f_len = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2164
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2169
*
* f_len = len(f_words)
* phrases = set() # (fphrase, lex_i, lex_j) # <<<<<<<<<<<<<<
*
* def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms):
*/
- __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_1));
__Pyx_GIVEREF(((PyObject *)__pyx_t_1));
__pyx_cur_scope->__pyx_v_phrases = ((PyObject *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2166
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2171
* phrases = set() # (fphrase, lex_i, lex_j)
*
* def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): # <<<<<<<<<<<<<<
* # Phrase extraction limits
* if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size:
*/
- __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extract, 0, ((PyObject*)__pyx_cur_scope), __pyx_n_s___sa, ((PyObject *)__pyx_k_codeobj_153)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3_sa_23HieroCachingRuleFactory_13get_f_phrases_1extract, 0, ((PyObject*)__pyx_cur_scope), __pyx_n_s___sa, ((PyObject *)__pyx_k_codeobj_154)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__pyx_cur_scope->__pyx_v_extract = __pyx_t_1;
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2194
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2199
*
* # Try to extract phrases from every f index
* for f_i from 0 <= f_i < f_len: # <<<<<<<<<<<<<<
* extract(f_i, f_i, f_len, -1, 0, 0, [])
*
*/
- __pyx_t_3 = __Pyx_PyInt_AsLong(__pyx_cur_scope->__pyx_v_f_len); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_AsLong(__pyx_cur_scope->__pyx_v_f_len); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
for (__pyx_v_f_i = 0; __pyx_v_f_i < __pyx_t_3; __pyx_v_f_i++) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2195
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2200
* # Try to extract phrases from every f index
* for f_i from 0 <= f_i < f_len:
* extract(f_i, f_i, f_len, -1, 0, 0, []) # <<<<<<<<<<<<<<
*
* return phrases
*/
- __pyx_t_1 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromLong(__pyx_v_f_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PyTuple_New(7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_New(7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
@@ -65593,13 +65784,13 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_37get_f_phrases(struct
__pyx_t_1 = 0;
__pyx_t_4 = 0;
__pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Call(__pyx_cur_scope->__pyx_v_extract, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2197
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2202
* extract(f_i, f_i, f_len, -1, 0, 0, [])
*
* return phrases # <<<<<<<<<<<<<<
@@ -65628,9 +65819,9 @@ static PyObject *__pyx_pf_3_sa_23HieroCachingRuleFactory_37get_f_phrases(struct
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_15span_check(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_3_sa_15span_check = {__Pyx_NAMESTR("span_check"), (PyCFunction)__pyx_pw_3_sa_15span_check, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_3_sa_15span_check(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_3_sa_17span_check(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_3_sa_17span_check = {__Pyx_NAMESTR("span_check"), (PyCFunction)__pyx_pw_3_sa_17span_check, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pw_3_sa_17span_check(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_vec = 0;
PyObject *__pyx_v_i = 0;
PyObject *__pyx_v_j = 0;
@@ -65658,16 +65849,16 @@ static PyObject *__pyx_pw_3_sa_15span_check(PyObject *__pyx_self, PyObject *__py
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_check") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_check") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
@@ -65682,18 +65873,18 @@ static PyObject *__pyx_pw_3_sa_15span_check(PyObject *__pyx_self, PyObject *__py
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("span_check", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.span_check", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_3_sa_14span_check(__pyx_self, __pyx_v_vec, __pyx_v_i, __pyx_v_j);
+ __pyx_r = __pyx_pf_3_sa_16span_check(__pyx_self, __pyx_v_vec, __pyx_v_i, __pyx_v_j);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2200
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2205
*
* # Spans are _inclusive_ on both ends [i, j]
* def span_check(vec, i, j): # <<<<<<<<<<<<<<
@@ -65701,7 +65892,7 @@ static PyObject *__pyx_pw_3_sa_15span_check(PyObject *__pyx_self, PyObject *__py
* while k <= j:
*/
-static PyObject *__pyx_pf_3_sa_14span_check(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vec, PyObject *__pyx_v_i, PyObject *__pyx_v_j) {
+static PyObject *__pyx_pf_3_sa_16span_check(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vec, PyObject *__pyx_v_i, PyObject *__pyx_v_j) {
PyObject *__pyx_v_k = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -65712,7 +65903,7 @@ static PyObject *__pyx_pf_3_sa_14span_check(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("span_check", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2201
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2206
* # Spans are _inclusive_ on both ends [i, j]
* def span_check(vec, i, j):
* k = i # <<<<<<<<<<<<<<
@@ -65722,7 +65913,7 @@ static PyObject *__pyx_pf_3_sa_14span_check(CYTHON_UNUSED PyObject *__pyx_self,
__Pyx_INCREF(__pyx_v_i);
__pyx_v_k = __pyx_v_i;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2202
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2207
* def span_check(vec, i, j):
* k = i
* while k <= j: # <<<<<<<<<<<<<<
@@ -65730,25 +65921,25 @@ static PyObject *__pyx_pf_3_sa_14span_check(CYTHON_UNUSED PyObject *__pyx_self,
* return False
*/
while (1) {
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!__pyx_t_2) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2203
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2208
* k = i
* while k <= j:
* if vec[k]: # <<<<<<<<<<<<<<
* return False
* k += 1
*/
- __pyx_t_1 = PyObject_GetItem(__pyx_v_vec, __pyx_v_k); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_GetItem(__pyx_v_vec, __pyx_v_k); if (!__pyx_t_1) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2204
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2209
* while k <= j:
* if vec[k]:
* return False # <<<<<<<<<<<<<<
@@ -65756,7 +65947,7 @@ static PyObject *__pyx_pf_3_sa_14span_check(CYTHON_UNUSED PyObject *__pyx_self,
* return True
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -65765,21 +65956,21 @@ static PyObject *__pyx_pf_3_sa_14span_check(CYTHON_UNUSED PyObject *__pyx_self,
}
__pyx_L5:;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2205
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2210
* if vec[k]:
* return False
* k += 1 # <<<<<<<<<<<<<<
* return True
*
*/
- __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_v_k);
__pyx_v_k = __pyx_t_1;
__pyx_t_1 = 0;
}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2206
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2211
* return False
* k += 1
* return True # <<<<<<<<<<<<<<
@@ -65787,7 +65978,7 @@ static PyObject *__pyx_pf_3_sa_14span_check(CYTHON_UNUSED PyObject *__pyx_self,
* def span_inc(vec, i, j):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -65807,9 +65998,9 @@ static PyObject *__pyx_pf_3_sa_14span_check(CYTHON_UNUSED PyObject *__pyx_self,
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_17span_inc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_3_sa_17span_inc = {__Pyx_NAMESTR("span_inc"), (PyCFunction)__pyx_pw_3_sa_17span_inc, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_3_sa_17span_inc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_3_sa_19span_inc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_3_sa_19span_inc = {__Pyx_NAMESTR("span_inc"), (PyCFunction)__pyx_pw_3_sa_19span_inc, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pw_3_sa_19span_inc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_vec = 0;
PyObject *__pyx_v_i = 0;
PyObject *__pyx_v_j = 0;
@@ -65837,16 +66028,16 @@ static PyObject *__pyx_pw_3_sa_17span_inc(PyObject *__pyx_self, PyObject *__pyx_
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2213; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2213; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_inc") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_inc") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2213; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
@@ -65861,18 +66052,18 @@ static PyObject *__pyx_pw_3_sa_17span_inc(PyObject *__pyx_self, PyObject *__pyx_
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("span_inc", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2213; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.span_inc", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_3_sa_16span_inc(__pyx_self, __pyx_v_vec, __pyx_v_i, __pyx_v_j);
+ __pyx_r = __pyx_pf_3_sa_18span_inc(__pyx_self, __pyx_v_vec, __pyx_v_i, __pyx_v_j);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2208
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2213
* return True
*
* def span_inc(vec, i, j): # <<<<<<<<<<<<<<
@@ -65880,7 +66071,7 @@ static PyObject *__pyx_pw_3_sa_17span_inc(PyObject *__pyx_self, PyObject *__pyx_
* while k <= j:
*/
-static PyObject *__pyx_pf_3_sa_16span_inc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vec, PyObject *__pyx_v_i, PyObject *__pyx_v_j) {
+static PyObject *__pyx_pf_3_sa_18span_inc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vec, PyObject *__pyx_v_i, PyObject *__pyx_v_j) {
PyObject *__pyx_v_k = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -65893,7 +66084,7 @@ static PyObject *__pyx_pf_3_sa_16span_inc(CYTHON_UNUSED PyObject *__pyx_self, Py
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("span_inc", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2209
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2214
*
* def span_inc(vec, i, j):
* k = i # <<<<<<<<<<<<<<
@@ -65903,7 +66094,7 @@ static PyObject *__pyx_pf_3_sa_16span_inc(CYTHON_UNUSED PyObject *__pyx_self, Py
__Pyx_INCREF(__pyx_v_i);
__pyx_v_k = __pyx_v_i;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2210
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2215
* def span_inc(vec, i, j):
* k = i
* while k <= j: # <<<<<<<<<<<<<<
@@ -65911,12 +66102,12 @@ static PyObject *__pyx_pf_3_sa_16span_inc(CYTHON_UNUSED PyObject *__pyx_self, Py
* k += 1
*/
while (1) {
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!__pyx_t_2) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2211
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2216
* k = i
* while k <= j:
* vec[k] += 1 # <<<<<<<<<<<<<<
@@ -65925,23 +66116,23 @@ static PyObject *__pyx_pf_3_sa_16span_inc(CYTHON_UNUSED PyObject *__pyx_self, Py
*/
__Pyx_INCREF(__pyx_v_k);
__pyx_t_1 = __pyx_v_k;
- __pyx_t_3 = PyObject_GetItem(__pyx_v_vec, __pyx_t_1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_v_vec, __pyx_t_1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyObject_SetItem(__pyx_v_vec, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_v_vec, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2212
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2217
* while k <= j:
* vec[k] += 1
* k += 1 # <<<<<<<<<<<<<<
*
* def span_dec(vec, i, j):
*/
- __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_v_k);
__pyx_v_k = __pyx_t_1;
@@ -65964,9 +66155,9 @@ static PyObject *__pyx_pf_3_sa_16span_inc(CYTHON_UNUSED PyObject *__pyx_self, Py
}
/* Python wrapper */
-static PyObject *__pyx_pw_3_sa_19span_dec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_3_sa_19span_dec = {__Pyx_NAMESTR("span_dec"), (PyCFunction)__pyx_pw_3_sa_19span_dec, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_3_sa_19span_dec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_3_sa_21span_dec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_3_sa_21span_dec = {__Pyx_NAMESTR("span_dec"), (PyCFunction)__pyx_pw_3_sa_21span_dec, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pw_3_sa_21span_dec(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_vec = 0;
PyObject *__pyx_v_i = 0;
PyObject *__pyx_v_j = 0;
@@ -65994,16 +66185,16 @@ static PyObject *__pyx_pw_3_sa_19span_dec(PyObject *__pyx_self, PyObject *__pyx_
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__i)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, 1); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__j)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, 2); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_dec") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "span_dec") < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
@@ -66018,18 +66209,18 @@ static PyObject *__pyx_pw_3_sa_19span_dec(PyObject *__pyx_self, PyObject *__pyx_
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("span_dec", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("_sa.span_dec", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_3_sa_18span_dec(__pyx_self, __pyx_v_vec, __pyx_v_i, __pyx_v_j);
+ __pyx_r = __pyx_pf_3_sa_20span_dec(__pyx_self, __pyx_v_vec, __pyx_v_i, __pyx_v_j);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2214
+/* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2219
* k += 1
*
* def span_dec(vec, i, j): # <<<<<<<<<<<<<<
@@ -66037,7 +66228,7 @@ static PyObject *__pyx_pw_3_sa_19span_dec(PyObject *__pyx_self, PyObject *__pyx_
* while k <= j:
*/
-static PyObject *__pyx_pf_3_sa_18span_dec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vec, PyObject *__pyx_v_i, PyObject *__pyx_v_j) {
+static PyObject *__pyx_pf_3_sa_20span_dec(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vec, PyObject *__pyx_v_i, PyObject *__pyx_v_j) {
PyObject *__pyx_v_k = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -66050,7 +66241,7 @@ static PyObject *__pyx_pf_3_sa_18span_dec(CYTHON_UNUSED PyObject *__pyx_self, Py
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("span_dec", 0);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2215
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2220
*
* def span_dec(vec, i, j):
* k = i # <<<<<<<<<<<<<<
@@ -66060,7 +66251,7 @@ static PyObject *__pyx_pf_3_sa_18span_dec(CYTHON_UNUSED PyObject *__pyx_self, Py
__Pyx_INCREF(__pyx_v_i);
__pyx_v_k = __pyx_v_i;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2216
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2221
* def span_dec(vec, i, j):
* k = i
* while k <= j: # <<<<<<<<<<<<<<
@@ -66068,12 +66259,12 @@ static PyObject *__pyx_pf_3_sa_18span_dec(CYTHON_UNUSED PyObject *__pyx_self, Py
* k += 1
*/
while (1) {
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_k, __pyx_v_j, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (!__pyx_t_2) break;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2217
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2222
* k = i
* while k <= j:
* vec[k] -= 1 # <<<<<<<<<<<<<<
@@ -66081,21 +66272,21 @@ static PyObject *__pyx_pf_3_sa_18span_dec(CYTHON_UNUSED PyObject *__pyx_self, Py
*/
__Pyx_INCREF(__pyx_v_k);
__pyx_t_1 = __pyx_v_k;
- __pyx_t_3 = PyObject_GetItem(__pyx_v_vec, __pyx_t_1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetItem(__pyx_v_vec, __pyx_t_1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyObject_SetItem(__pyx_v_vec, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_v_vec, __pyx_t_1, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2218
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2223
* while k <= j:
* vec[k] -= 1
* k += 1 # <<<<<<<<<<<<<<
*/
- __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_k, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_v_k);
__pyx_v_k = __pyx_t_1;
@@ -66131,7 +66322,7 @@ static int __pyx_pw_3_sa_13FeatureVector_1__cinit__(PyObject *__pyx_v_self, PyOb
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/features.pxi":7
+/* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":7
*
* cdef class FeatureVector:
* def __cinit__(self): # <<<<<<<<<<<<<<
@@ -66150,7 +66341,7 @@ static int __pyx_pf_3_sa_13FeatureVector___cinit__(struct __pyx_obj_3_sa_Feature
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/features.pxi":8
+ /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":8
* cdef class FeatureVector:
* def __cinit__(self):
* self.names = IntList(INITIAL_CAPACITY, INCREMENT) # <<<<<<<<<<<<<<
@@ -66178,7 +66369,7 @@ static int __pyx_pf_3_sa_13FeatureVector___cinit__(struct __pyx_obj_3_sa_Feature
__pyx_v_self->names = ((struct __pyx_obj_3_sa_IntList *)__pyx_t_2);
__pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/features.pxi":9
+ /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":9
* def __cinit__(self):
* self.names = IntList(INITIAL_CAPACITY, INCREMENT)
* self.values = FloatList(INITIAL_CAPACITY, INCREMENT) # <<<<<<<<<<<<<<
@@ -66275,7 +66466,7 @@ static PyObject *__pyx_pw_3_sa_13FeatureVector_3set(PyObject *__pyx_v_self, PyOb
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/features.pxi":11
+/* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":11
* self.values = FloatList(INITIAL_CAPACITY, INCREMENT)
*
* def set(self, unsigned name, float value): # <<<<<<<<<<<<<<
@@ -66293,7 +66484,7 @@ static PyObject *__pyx_pf_3_sa_13FeatureVector_2set(struct __pyx_obj_3_sa_Featur
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set", 0);
- /* "/home/m/workspace/cdec/python/src/sa/features.pxi":12
+ /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":12
*
* def set(self, unsigned name, float value):
* self.names.append(name) # <<<<<<<<<<<<<<
@@ -66307,7 +66498,7 @@ static PyObject *__pyx_pf_3_sa_13FeatureVector_2set(struct __pyx_obj_3_sa_Featur
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/features.pxi":13
+ /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":13
* def set(self, unsigned name, float value):
* self.names.append(name)
* self.values.append(value) # <<<<<<<<<<<<<<
@@ -66346,7 +66537,7 @@ static PyObject *__pyx_pw_3_sa_13FeatureVector_5__iter__(PyObject *__pyx_v_self)
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/features.pxi":15
+/* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":15
* self.values.append(value)
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -66412,7 +66603,7 @@ static PyObject *__pyx_gb_3_sa_13FeatureVector_6generator5(__pyx_GeneratorObject
__pyx_L3_first_run:;
if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/features.pxi":17
+ /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":17
* def __iter__(self):
* cdef unsigned i
* for i in range(self.names.len): # <<<<<<<<<<<<<<
@@ -66423,7 +66614,7 @@ static PyObject *__pyx_gb_3_sa_13FeatureVector_6generator5(__pyx_GeneratorObject
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_cur_scope->__pyx_v_i = __pyx_t_2;
- /* "/home/m/workspace/cdec/python/src/sa/features.pxi":18
+ /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":18
* cdef unsigned i
* for i in range(self.names.len):
* yield (FD.word(self.names[i]), self.values[i]) # <<<<<<<<<<<<<<
@@ -66487,7 +66678,7 @@ static PyObject *__pyx_pw_3_sa_13FeatureVector_8__str__(PyObject *__pyx_v_self)
}
static PyObject *__pyx_gb_3_sa_13FeatureVector_7__str___2generator17(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "/home/m/workspace/cdec/python/src/sa/features.pxi":21
+/* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":21
*
* def __str__(self):
* return ' '.join('%s=%s' % feat for feat in self) # <<<<<<<<<<<<<<
@@ -66590,7 +66781,7 @@ static PyObject *__pyx_gb_3_sa_13FeatureVector_7__str___2generator17(__pyx_Gener
__Pyx_GIVEREF(__pyx_t_4);
__pyx_cur_scope->__pyx_v_feat = __pyx_t_4;
__pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_154), __pyx_cur_scope->__pyx_v_feat); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_155), __pyx_cur_scope->__pyx_v_feat); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_4));
__pyx_r = ((PyObject *)__pyx_t_4);
__pyx_t_4 = 0;
@@ -66626,7 +66817,7 @@ static PyObject *__pyx_gb_3_sa_13FeatureVector_7__str___2generator17(__pyx_Gener
return NULL;
}
-/* "/home/m/workspace/cdec/python/src/sa/features.pxi":20
+/* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":20
* yield (FD.word(self.names[i]), self.values[i])
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -66655,7 +66846,7 @@ static PyObject *__pyx_pf_3_sa_13FeatureVector_7__str__(struct __pyx_obj_3_sa_Fe
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
- /* "/home/m/workspace/cdec/python/src/sa/features.pxi":21
+ /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":21
*
* def __str__(self):
* return ' '.join('%s=%s' % feat for feat in self) # <<<<<<<<<<<<<<
@@ -66711,7 +66902,7 @@ static int __pyx_pw_3_sa_6Scorer_1__init__(PyObject *__pyx_v_self, PyObject *__p
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/features.pxi":25
+/* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":25
* cdef class Scorer:
* cdef models
* def __init__(self, *models): # <<<<<<<<<<<<<<
@@ -66734,7 +66925,7 @@ static int __pyx_pf_3_sa_6Scorer___init__(struct __pyx_obj_3_sa_Scorer *__pyx_v_
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "/home/m/workspace/cdec/python/src/sa/features.pxi":26
+ /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":26
* cdef models
* def __init__(self, *models):
* names = [FD.index(<char *>model.__name__) for model in models] # <<<<<<<<<<<<<<
@@ -66768,7 +66959,7 @@ static int __pyx_pf_3_sa_6Scorer___init__(struct __pyx_obj_3_sa_Scorer *__pyx_v_
__pyx_v_names = __pyx_t_1;
__Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/features.pxi":27
+ /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":27
* def __init__(self, *models):
* names = [FD.index(<char *>model.__name__) for model in models]
* self.models = zip(names, models) # <<<<<<<<<<<<<<
@@ -66807,7 +66998,7 @@ static int __pyx_pf_3_sa_6Scorer___init__(struct __pyx_obj_3_sa_Scorer *__pyx_v_
return __pyx_r;
}
-/* "/home/m/workspace/cdec/python/src/sa/features.pxi":29
+/* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":29
* self.models = zip(names, models)
*
* cdef FeatureVector score(self, ctx): # <<<<<<<<<<<<<<
@@ -66834,7 +67025,7 @@ static struct __pyx_obj_3_sa_FeatureVector *__pyx_f_3_sa_6Scorer_score(struct __
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("score", 0);
- /* "/home/m/workspace/cdec/python/src/sa/features.pxi":30
+ /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":30
*
* cdef FeatureVector score(self, ctx):
* cdef FeatureVector scores = FeatureVector() # <<<<<<<<<<<<<<
@@ -66846,7 +67037,7 @@ static struct __pyx_obj_3_sa_FeatureVector *__pyx_f_3_sa_6Scorer_score(struct __
__pyx_v_scores = ((struct __pyx_obj_3_sa_FeatureVector *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/features.pxi":31
+ /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":31
* cdef FeatureVector score(self, ctx):
* cdef FeatureVector scores = FeatureVector()
* for name, model in self.models: # <<<<<<<<<<<<<<
@@ -66943,7 +67134,7 @@ static struct __pyx_obj_3_sa_FeatureVector *__pyx_f_3_sa_6Scorer_score(struct __
__pyx_v_model = __pyx_t_6;
__pyx_t_6 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/features.pxi":32
+ /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":32
* cdef FeatureVector scores = FeatureVector()
* for name, model in self.models:
* scores.set(name, model(ctx)) # <<<<<<<<<<<<<<
@@ -66975,7 +67166,7 @@ static struct __pyx_obj_3_sa_FeatureVector *__pyx_f_3_sa_6Scorer_score(struct __
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/features.pxi":33
+ /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":33
* for name, model in self.models:
* scores.set(name, model(ctx))
* return scores # <<<<<<<<<<<<<<
@@ -76407,6 +76598,8 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_19_input(PyTypeObject *t,
p->__pyx_v_genexpr = 0;
p->__pyx_v_hiero_phrase = 0;
p->__pyx_v_input_match = 0;
+ p->__pyx_v_intersect_start_time = 0;
+ p->__pyx_v_intersect_stop_time = 0;
p->__pyx_v_is_shadow_path = 0;
p->__pyx_v_key = 0;
p->__pyx_v_lex_i = 0;
@@ -76438,7 +76631,7 @@ static PyObject *__pyx_tp_new_3_sa___pyx_scope_struct_19_input(PyTypeObject *t,
p->__pyx_v_xcat_index = 0;
p->__pyx_v_xnode = 0;
p->__pyx_v_xroot = 0;
- p->__pyx_t_1 = 0;
+ p->__pyx_t_3 = 0;
p->__pyx_t_4 = 0;
p->__pyx_t_5 = 0;
return o;
@@ -76467,6 +76660,8 @@ static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_19_input(PyObject *o) {
Py_CLEAR(p->__pyx_v_genexpr);
Py_CLEAR(p->__pyx_v_hiero_phrase);
Py_CLEAR(p->__pyx_v_input_match);
+ Py_CLEAR(p->__pyx_v_intersect_start_time);
+ Py_CLEAR(p->__pyx_v_intersect_stop_time);
Py_CLEAR(p->__pyx_v_is_shadow_path);
Py_CLEAR(p->__pyx_v_key);
Py_CLEAR(p->__pyx_v_lex_i);
@@ -76498,7 +76693,7 @@ static void __pyx_tp_dealloc_3_sa___pyx_scope_struct_19_input(PyObject *o) {
Py_CLEAR(p->__pyx_v_xcat_index);
Py_CLEAR(p->__pyx_v_xnode);
Py_CLEAR(p->__pyx_v_xroot);
- Py_CLEAR(p->__pyx_t_1);
+ Py_CLEAR(p->__pyx_t_3);
Py_CLEAR(p->__pyx_t_4);
Py_CLEAR(p->__pyx_t_5);
(*Py_TYPE(o)->tp_free)(o);
@@ -76570,6 +76765,12 @@ static int __pyx_tp_traverse_3_sa___pyx_scope_struct_19_input(PyObject *o, visit
if (p->__pyx_v_input_match) {
e = (*v)(p->__pyx_v_input_match, a); if (e) return e;
}
+ if (p->__pyx_v_intersect_start_time) {
+ e = (*v)(p->__pyx_v_intersect_start_time, a); if (e) return e;
+ }
+ if (p->__pyx_v_intersect_stop_time) {
+ e = (*v)(p->__pyx_v_intersect_stop_time, a); if (e) return e;
+ }
if (p->__pyx_v_is_shadow_path) {
e = (*v)(p->__pyx_v_is_shadow_path, a); if (e) return e;
}
@@ -76663,8 +76864,8 @@ static int __pyx_tp_traverse_3_sa___pyx_scope_struct_19_input(PyObject *o, visit
if (p->__pyx_v_xroot) {
e = (*v)(p->__pyx_v_xroot, a); if (e) return e;
}
- if (p->__pyx_t_1) {
- e = (*v)(p->__pyx_t_1, a); if (e) return e;
+ if (p->__pyx_t_3) {
+ e = (*v)(p->__pyx_t_3, a); if (e) return e;
}
if (p->__pyx_t_4) {
e = (*v)(p->__pyx_t_4, a); if (e) return e;
@@ -76741,6 +76942,12 @@ static int __pyx_tp_clear_3_sa___pyx_scope_struct_19_input(PyObject *o) {
tmp = ((PyObject*)p->__pyx_v_input_match);
p->__pyx_v_input_match = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_intersect_start_time);
+ p->__pyx_v_intersect_start_time = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->__pyx_v_intersect_stop_time);
+ p->__pyx_v_intersect_stop_time = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
tmp = ((PyObject*)p->__pyx_v_is_shadow_path);
p->__pyx_v_is_shadow_path = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
@@ -76834,8 +77041,8 @@ static int __pyx_tp_clear_3_sa___pyx_scope_struct_19_input(PyObject *o) {
tmp = ((PyObject*)p->__pyx_v_xroot);
p->__pyx_v_xroot = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
- tmp = ((PyObject*)p->__pyx_t_1);
- p->__pyx_t_1 = Py_None; Py_INCREF(Py_None);
+ tmp = ((PyObject*)p->__pyx_t_3);
+ p->__pyx_t_3 = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
tmp = ((PyObject*)p->__pyx_t_4);
p->__pyx_t_4 = Py_None; Py_INCREF(Py_None);
@@ -79165,18 +79372,19 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_kp_s_131, __pyx_k_131, sizeof(__pyx_k_131), 0, 0, 1, 0},
{&__pyx_kp_s_132, __pyx_k_132, sizeof(__pyx_k_132), 0, 0, 1, 0},
{&__pyx_kp_s_133, __pyx_k_133, sizeof(__pyx_k_133), 0, 0, 1, 0},
- {&__pyx_kp_s_136, __pyx_k_136, sizeof(__pyx_k_136), 0, 0, 1, 0},
+ {&__pyx_kp_s_134, __pyx_k_134, sizeof(__pyx_k_134), 0, 0, 1, 0},
{&__pyx_kp_s_137, __pyx_k_137, sizeof(__pyx_k_137), 0, 0, 1, 0},
{&__pyx_kp_s_138, __pyx_k_138, sizeof(__pyx_k_138), 0, 0, 1, 0},
{&__pyx_kp_s_139, __pyx_k_139, sizeof(__pyx_k_139), 0, 0, 1, 0},
{&__pyx_kp_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 0},
- {&__pyx_kp_s_141, __pyx_k_141, sizeof(__pyx_k_141), 0, 0, 1, 0},
- {&__pyx_kp_s_145, __pyx_k_145, sizeof(__pyx_k_145), 0, 0, 1, 0},
- {&__pyx_n_s_151, __pyx_k_151, sizeof(__pyx_k_151), 0, 0, 1, 1},
- {&__pyx_kp_s_154, __pyx_k_154, sizeof(__pyx_k_154), 0, 0, 1, 0},
+ {&__pyx_kp_s_140, __pyx_k_140, sizeof(__pyx_k_140), 0, 0, 1, 0},
+ {&__pyx_kp_s_142, __pyx_k_142, sizeof(__pyx_k_142), 0, 0, 1, 0},
+ {&__pyx_kp_s_146, __pyx_k_146, sizeof(__pyx_k_146), 0, 0, 1, 0},
+ {&__pyx_n_s_152, __pyx_k_152, sizeof(__pyx_k_152), 0, 0, 1, 1},
+ {&__pyx_kp_s_155, __pyx_k_155, sizeof(__pyx_k_155), 0, 0, 1, 0},
{&__pyx_kp_s_157, __pyx_k_157, sizeof(__pyx_k_157), 0, 0, 1, 0},
- {&__pyx_kp_s_158, __pyx_k_158, sizeof(__pyx_k_158), 0, 0, 1, 0},
- {&__pyx_kp_s_162, __pyx_k_162, sizeof(__pyx_k_162), 0, 0, 1, 0},
+ {&__pyx_kp_s_160, __pyx_k_160, sizeof(__pyx_k_160), 0, 0, 1, 0},
+ {&__pyx_kp_s_164, __pyx_k_164, sizeof(__pyx_k_164), 0, 0, 1, 0},
{&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0},
{&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
{&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0},
@@ -79383,6 +79591,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s__min_bound, __pyx_k__min_bound, sizeof(__pyx_k__min_bound), 0, 0, 1, 1},
{&__pyx_n_s__min_dist, __pyx_k__min_dist, sizeof(__pyx_k__min_dist), 0, 0, 1, 1},
{&__pyx_n_s__min_gap_size, __pyx_k__min_gap_size, sizeof(__pyx_k__min_gap_size), 0, 0, 1, 1},
+ {&__pyx_n_s__monitor_cpu, __pyx_k__monitor_cpu, sizeof(__pyx_k__monitor_cpu), 0, 0, 1, 1},
{&__pyx_n_s__name, __pyx_k__name, sizeof(__pyx_k__name), 0, 0, 1, 1},
{&__pyx_n_s__namedtuple, __pyx_k__namedtuple, sizeof(__pyx_k__namedtuple), 0, 0, 1, 1},
{&__pyx_n_s__new_e_i, __pyx_k__new_e_i, sizeof(__pyx_k__new_e_i), 0, 0, 1, 1},
@@ -79492,8 +79701,8 @@ static int __Pyx_InitCachedBuiltins(void) {
__pyx_builtin_zip = __Pyx_GetName(__pyx_b, __pyx_n_s__zip); if (!__pyx_builtin_zip) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_n_s__StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_builtin_cmp = __Pyx_GetName(__pyx_b, __pyx_n_s__cmp); if (!__pyx_builtin_cmp) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_sorted = __Pyx_GetName(__pyx_b, __pyx_n_s__sorted); if (!__pyx_builtin_sorted) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_max = __Pyx_GetName(__pyx_b, __pyx_n_s__max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_sorted = __Pyx_GetName(__pyx_b, __pyx_n_s__sorted); if (!__pyx_builtin_sorted) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_max = __Pyx_GetName(__pyx_b, __pyx_n_s__max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
return 0;
__pyx_L1_error:;
return -1;
@@ -79503,7 +79712,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":20
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":20
* self.word2id = {"END_OF_FILE":0, "END_OF_LINE":1}
* self.id2word = ["END_OF_FILE", "END_OF_LINE"]
* self.data = IntList(1000,1000) # <<<<<<<<<<<<<<
@@ -79520,7 +79729,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(__pyx_int_1000);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10));
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":21
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":21
* self.id2word = ["END_OF_FILE", "END_OF_LINE"]
* self.data = IntList(1000,1000)
* self.sent_id = IntList(1000,1000) # <<<<<<<<<<<<<<
@@ -79537,7 +79746,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(__pyx_int_1000);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11));
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":22
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":22
* self.data = IntList(1000,1000)
* self.sent_id = IntList(1000,1000)
* self.sent_index = IntList(1000,1000) # <<<<<<<<<<<<<<
@@ -79554,7 +79763,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(__pyx_int_1000);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_12));
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":66
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":66
* f.write("%s " % self.get_word(w_id))
* if w_id == 1:
* f.write("\n") # <<<<<<<<<<<<<<
@@ -79568,7 +79777,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_15));
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":61
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":61
*
* def write_text(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -79588,7 +79797,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(Py_None);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16));
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":69
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":69
*
* def read_text(self, char* filename):
* with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<<
@@ -79608,7 +79817,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(Py_None);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17));
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":74
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":74
* def read_bitext(self, char* filename, int side):
* with gzip_or_text(filename) as fp:
* data = (line.split(' ||| ')[side] for line in fp) # <<<<<<<<<<<<<<
@@ -79622,7 +79831,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_18));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19));
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":73
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":73
*
* def read_bitext(self, char* filename, int side):
* with gzip_or_text(filename) as fp: # <<<<<<<<<<<<<<
@@ -79642,7 +79851,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(Py_None);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_20));
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":144
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":144
* for i in self.data:
* f.write("%d " %i)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -79656,7 +79865,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_22));
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":147
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":147
* for i in self.sent_index:
* f.write("%d " %i)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -79670,7 +79879,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_23));
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":150
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":150
* for i in self.sent_id:
* f.write("%d " %i)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -79684,7 +79893,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24));
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":153
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":153
* for word in self.id2word:
* f.write("%s %d " % (word, self.word2id[word]))
* f.write("\n") # <<<<<<<<<<<<<<
@@ -79698,7 +79907,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_26));
- /* "/home/m/workspace/cdec/python/src/sa/data_array.pxi":156
+ /* "/home/pauldb/workspace/cdec/python/src/sa/data_array.pxi":156
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -79717,7 +79926,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(Py_None);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_28));
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":46
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":46
*
* def __cinit__(self, from_binary=None, from_text=None):
* self.links = IntList(1000,1000) # <<<<<<<<<<<<<<
@@ -79734,7 +79943,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(__pyx_int_1000);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_29));
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":47
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":47
* def __cinit__(self, from_binary=None, from_text=None):
* self.links = IntList(1000,1000)
* self.sent_index = IntList(1000,1000) # <<<<<<<<<<<<<<
@@ -79751,7 +79960,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(__pyx_int_1000);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_30));
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":59
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":59
* pairs = line.split()
* for pair in pairs:
* (i, j) = map(int, pair.split('-')) # <<<<<<<<<<<<<<
@@ -79765,7 +79974,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_31));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_32));
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":54
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":54
*
* def read_text(self, char* filename):
* with gzip_or_text(filename) as f: # <<<<<<<<<<<<<<
@@ -79785,7 +79994,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(Py_None);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_33));
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":75
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":75
* for i, link in enumerate(self.links):
* while i >= self.sent_index[sent_num]:
* f.write("\n") # <<<<<<<<<<<<<<
@@ -79799,7 +80008,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_34));
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":78
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":78
* sent_num = sent_num + 1
* f.write("%d-%d " % self.unlink(link))
* f.write("\n") # <<<<<<<<<<<<<<
@@ -79813,7 +80022,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_36));
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":71
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":71
*
* def write_text(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -79833,7 +80042,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(Py_None);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_37));
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":92
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":92
* for link in self.links:
* f.write("%d " % link)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -79847,7 +80056,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_38));
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":95
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":95
* for i in self.sent_index:
* f.write("%d " % i)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -79861,7 +80070,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_39));
- /* "/home/m/workspace/cdec/python/src/sa/alignment.pxi":88
+ /* "/home/pauldb/workspace/cdec/python/src/sa/alignment.pxi":88
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -79881,7 +80090,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(Py_None);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_40));
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":297
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":297
*
* # Re-read file, placing words into buckets
* f.seek(0) # <<<<<<<<<<<<<<
@@ -79895,7 +80104,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(__pyx_int_0);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_43));
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":273
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":273
*
* fcount = IntList()
* with gzip_or_text(filename) as f: # <<<<<<<<<<<<<<
@@ -79915,7 +80124,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(Py_None);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_44));
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":339
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":339
*
* if i > j:
* raise Exception("Sort error in CLex") # <<<<<<<<<<<<<<
@@ -79929,7 +80138,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_46));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_47));
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":362
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":362
* for i in self.f_index:
* f.write("%d " % i)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -79943,7 +80152,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_49));
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":365
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":365
* for i, s1, s2 in zip(self.e_index, self.col1, self.col2):
* f.write("%d %f %f " % (i, s1, s2))
* f.write("\n") # <<<<<<<<<<<<<<
@@ -79957,7 +80166,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_51));
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":368
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":368
* for i, w in enumerate(self.id2fword):
* f.write("%d %s " % (i, w))
* f.write("\n") # <<<<<<<<<<<<<<
@@ -79971,7 +80180,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_53));
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":371
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":371
* for i, w in enumerate(self.id2eword):
* f.write("%d %s " % (i, w))
* f.write("\n") # <<<<<<<<<<<<<<
@@ -79985,7 +80194,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_54));
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":359
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":359
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -80005,7 +80214,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(Py_None);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_55));
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":404
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":404
* cdef i, N, e_id, f_id
*
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -80025,7 +80234,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(Py_None);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_57));
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":13
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":13
* cdef IntList rank
*
* logger.info("Constructing LCP array") # <<<<<<<<<<<<<<
@@ -80039,7 +80248,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_60));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_61));
- /* "/home/m/workspace/cdec/python/src/sa/lcp.pxi":34
+ /* "/home/pauldb/workspace/cdec/python/src/sa/lcp.pxi":34
* if h > 0:
* h = h-1
* logger.info("LCP array completed") # <<<<<<<<<<<<<<
@@ -80053,7 +80262,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_62));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_63));
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":297
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":297
* pattern_rank = {}
*
* logger.info("Precomputing frequent intersections") # <<<<<<<<<<<<<<
@@ -80067,7 +80276,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_72));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_73));
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":314
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":314
* queue = IntList(increment=1000)
*
* logger.info(" Computing inverted indexes...") # <<<<<<<<<<<<<<
@@ -80081,7 +80290,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_74));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_75));
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":329
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":329
* trie_node_data_append(node, i)
*
* logger.info(" Computing collocations...") # <<<<<<<<<<<<<<
@@ -80095,7 +80304,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_76));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_77));
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":393
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":393
* for pattern2 in J_set:
* if len(pattern1) + len(pattern2) + 1 < self.max_length:
* combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<<
@@ -80109,7 +80318,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(__pyx_int_neg_1);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_79));
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":400
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":400
* x = x+1
* if len(pattern1) + len(pattern2) + 1 <= self.max_length:
* combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<<
@@ -80123,7 +80332,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(__pyx_int_neg_1);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_80));
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":407
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":407
* x = x+2
* if len(pattern1) + len(pattern2) + 1<= self.max_length:
* combined_pattern = pattern1 + (-1,) + pattern2 # <<<<<<<<<<<<<<
@@ -80137,7 +80346,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(__pyx_int_neg_1);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_81));
- /* "/home/m/workspace/cdec/python/src/sa/precomputation.pxi":409
+ /* "/home/pauldb/workspace/cdec/python/src/sa/precomputation.pxi":409
* combined_pattern = pattern1 + (-1,) + pattern2
* IJ_set.add(combined_pattern)
* combined_pattern = pattern2 + (-1,) + pattern1 # <<<<<<<<<<<<<<
@@ -80151,7 +80360,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(__pyx_int_neg_1);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_82));
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":94
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":94
*
* '''Step 3: read off suffix array from inverse suffix array'''
* logger.info(" Finalizing sort...") # <<<<<<<<<<<<<<
@@ -80165,7 +80374,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_92));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_93));
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":193
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":193
* for a_i in self.sa:
* f.write("%d " % a_i)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -80179,7 +80388,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_96));
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":196
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":196
* for w_i in self.ha:
* f.write("%d " % w_i)
* f.write("\n") # <<<<<<<<<<<<<<
@@ -80193,7 +80402,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_14));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_97));
- /* "/home/m/workspace/cdec/python/src/sa/suffix_array.pxi":189
+ /* "/home/pauldb/workspace/cdec/python/src/sa/suffix_array.pxi":189
*
* def write_enhanced(self, char* filename):
* with open(filename, "w") as f: # <<<<<<<<<<<<<<
@@ -80213,7 +80422,7 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(Py_None);
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_98));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":119
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":119
* logger.info("Sampling strategy: uniform, max sample size = %d", sample_size)
* else:
* logger.info("Sampling strategy: no sampling") # <<<<<<<<<<<<<<
@@ -80227,270 +80436,279 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_101));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_102));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":338
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":339
* self.rules.root = ExtendedTrieNode(phrase_location=PhraseLocation())
* if alignment is None:
* raise Exception("Must specify an alignment object") # <<<<<<<<<<<<<<
* self.alignment = alignment
*
*/
- __pyx_k_tuple_107 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_107)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_107 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_107)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_107);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_106));
PyTuple_SET_ITEM(__pyx_k_tuple_107, 0, ((PyObject *)__pyx_kp_s_106));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_106));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_107));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1062
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1064
* else:
* #ERROR: We never get here
* raise Exception("Keyword trie error") # <<<<<<<<<<<<<<
* # checking whether lookup_required
* if lookup_required:
*/
- __pyx_k_tuple_122 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_122)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_k_tuple_122 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_122)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_k_tuple_122);
__Pyx_INCREF(((PyObject *)__pyx_kp_s_121));
PyTuple_SET_ITEM(__pyx_k_tuple_122, 0, ((PyObject *)__pyx_kp_s_121));
__Pyx_GIVEREF(((PyObject *)__pyx_kp_s_121));
__Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_122));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":1913
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":1918
* # f_ i and j are current, e_ i and j are previous
* # We care _considering_ f_j, so it is not yet in counts
* def extract(f_i, f_j, e_i, e_j, min_bound, wc, links, nt, nt_open): # <<<<<<<<<<<<<<
* # Phrase extraction limits
* if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size:
*/
- __pyx_k_tuple_134 = PyTuple_New(19); if (unlikely(!__pyx_k_tuple_134)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_134);
+ __pyx_k_tuple_135 = PyTuple_New(19); if (unlikely(!__pyx_k_tuple_135)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_135);
__Pyx_INCREF(((PyObject *)__pyx_n_s__f_i));
- PyTuple_SET_ITEM(__pyx_k_tuple_134, 0, ((PyObject *)__pyx_n_s__f_i));
+ PyTuple_SET_ITEM(__pyx_k_tuple_135, 0, ((PyObject *)__pyx_n_s__f_i));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__f_i));
__Pyx_INCREF(((PyObject *)__pyx_n_s__f_j));
- PyTuple_SET_ITEM(__pyx_k_tuple_134, 1, ((PyObject *)__pyx_n_s__f_j));
+ PyTuple_SET_ITEM(__pyx_k_tuple_135, 1, ((PyObject *)__pyx_n_s__f_j));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__f_j));
__Pyx_INCREF(((PyObject *)__pyx_n_s__e_i));
- PyTuple_SET_ITEM(__pyx_k_tuple_134, 2, ((PyObject *)__pyx_n_s__e_i));
+ PyTuple_SET_ITEM(__pyx_k_tuple_135, 2, ((PyObject *)__pyx_n_s__e_i));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__e_i));
__Pyx_INCREF(((PyObject *)__pyx_n_s__e_j));
- PyTuple_SET_ITEM(__pyx_k_tuple_134, 3, ((PyObject *)__pyx_n_s__e_j));
+ PyTuple_SET_ITEM(__pyx_k_tuple_135, 3, ((PyObject *)__pyx_n_s__e_j));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__e_j));
__Pyx_INCREF(((PyObject *)__pyx_n_s__min_bound));
- PyTuple_SET_ITEM(__pyx_k_tuple_134, 4, ((PyObject *)__pyx_n_s__min_bound));
+ PyTuple_SET_ITEM(__pyx_k_tuple_135, 4, ((PyObject *)__pyx_n_s__min_bound));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__min_bound));
__Pyx_INCREF(((PyObject *)__pyx_n_s__wc));
- PyTuple_SET_ITEM(__pyx_k_tuple_134, 5, ((PyObject *)__pyx_n_s__wc));
+ PyTuple_SET_ITEM(__pyx_k_tuple_135, 5, ((PyObject *)__pyx_n_s__wc));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__wc));
__Pyx_INCREF(((PyObject *)__pyx_n_s__links));
- PyTuple_SET_ITEM(__pyx_k_tuple_134, 6, ((PyObject *)__pyx_n_s__links));
+ PyTuple_SET_ITEM(__pyx_k_tuple_135, 6, ((PyObject *)__pyx_n_s__links));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__links));
__Pyx_INCREF(((PyObject *)__pyx_n_s__nt));
- PyTuple_SET_ITEM(__pyx_k_tuple_134, 7, ((PyObject *)__pyx_n_s__nt));
+ PyTuple_SET_ITEM(__pyx_k_tuple_135, 7, ((PyObject *)__pyx_n_s__nt));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__nt));
__Pyx_INCREF(((PyObject *)__pyx_n_s__nt_open));
- PyTuple_SET_ITEM(__pyx_k_tuple_134, 8, ((PyObject *)__pyx_n_s__nt_open));
+ PyTuple_SET_ITEM(__pyx_k_tuple_135, 8, ((PyObject *)__pyx_n_s__nt_open));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__nt_open));
__Pyx_INCREF(((PyObject *)__pyx_n_s__link_i));
- PyTuple_SET_ITEM(__pyx_k_tuple_134, 9, ((PyObject *)__pyx_n_s__link_i));
+ PyTuple_SET_ITEM(__pyx_k_tuple_135, 9, ((PyObject *)__pyx_n_s__link_i));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__link_i));
__Pyx_INCREF(((PyObject *)__pyx_n_s__link_j));
- PyTuple_SET_ITEM(__pyx_k_tuple_134, 10, ((PyObject *)__pyx_n_s__link_j));
+ PyTuple_SET_ITEM(__pyx_k_tuple_135, 10, ((PyObject *)__pyx_n_s__link_j));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__link_j));
__Pyx_INCREF(((PyObject *)__pyx_n_s__new_e_i));
- PyTuple_SET_ITEM(__pyx_k_tuple_134, 11, ((PyObject *)__pyx_n_s__new_e_i));
+ PyTuple_SET_ITEM(__pyx_k_tuple_135, 11, ((PyObject *)__pyx_n_s__new_e_i));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__new_e_i));
__Pyx_INCREF(((PyObject *)__pyx_n_s__new_e_j));
- PyTuple_SET_ITEM(__pyx_k_tuple_134, 12, ((PyObject *)__pyx_n_s__new_e_j));
+ PyTuple_SET_ITEM(__pyx_k_tuple_135, 12, ((PyObject *)__pyx_n_s__new_e_j));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__new_e_j));
__Pyx_INCREF(((PyObject *)__pyx_n_s__new_min_bound));
- PyTuple_SET_ITEM(__pyx_k_tuple_134, 13, ((PyObject *)__pyx_n_s__new_min_bound));
+ PyTuple_SET_ITEM(__pyx_k_tuple_135, 13, ((PyObject *)__pyx_n_s__new_min_bound));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__new_min_bound));
__Pyx_INCREF(((PyObject *)__pyx_n_s__i));
- PyTuple_SET_ITEM(__pyx_k_tuple_134, 14, ((PyObject *)__pyx_n_s__i));
+ PyTuple_SET_ITEM(__pyx_k_tuple_135, 14, ((PyObject *)__pyx_n_s__i));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
__Pyx_INCREF(((PyObject *)__pyx_n_s__nt_collision));
- PyTuple_SET_ITEM(__pyx_k_tuple_134, 15, ((PyObject *)__pyx_n_s__nt_collision));
+ PyTuple_SET_ITEM(__pyx_k_tuple_135, 15, ((PyObject *)__pyx_n_s__nt_collision));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__nt_collision));
__Pyx_INCREF(((PyObject *)__pyx_n_s__link));
- PyTuple_SET_ITEM(__pyx_k_tuple_134, 16, ((PyObject *)__pyx_n_s__link));
+ PyTuple_SET_ITEM(__pyx_k_tuple_135, 16, ((PyObject *)__pyx_n_s__link));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__link));
__Pyx_INCREF(((PyObject *)__pyx_n_s__plus_links));
- PyTuple_SET_ITEM(__pyx_k_tuple_134, 17, ((PyObject *)__pyx_n_s__plus_links));
+ PyTuple_SET_ITEM(__pyx_k_tuple_135, 17, ((PyObject *)__pyx_n_s__plus_links));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__plus_links));
__Pyx_INCREF(((PyObject *)__pyx_n_s__old_last_nt));
- PyTuple_SET_ITEM(__pyx_k_tuple_134, 18, ((PyObject *)__pyx_n_s__old_last_nt));
+ PyTuple_SET_ITEM(__pyx_k_tuple_135, 18, ((PyObject *)__pyx_n_s__old_last_nt));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__old_last_nt));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_134));
- __pyx_k_codeobj_135 = (PyObject*)__Pyx_PyCode_New(9, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_136, __pyx_n_s__extract, 1913, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_135)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_135));
+ __pyx_k_codeobj_136 = (PyObject*)__Pyx_PyCode_New(9, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_135, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_137, __pyx_n_s__extract, 1918, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_136)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2120
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2125
* # Debugging
* def dump_online_stats(self):
* logger.info('------------------------------') # <<<<<<<<<<<<<<
* logger.info(' Online Stats ')
* logger.info('------------------------------')
*/
- __pyx_k_tuple_140 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_140)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_140);
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_139));
- PyTuple_SET_ITEM(__pyx_k_tuple_140, 0, ((PyObject *)__pyx_kp_s_139));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_139));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_140));
+ __pyx_k_tuple_141 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_141)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_141);
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_140));
+ PyTuple_SET_ITEM(__pyx_k_tuple_141, 0, ((PyObject *)__pyx_kp_s_140));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_140));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_141));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2121
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2126
* def dump_online_stats(self):
* logger.info('------------------------------')
* logger.info(' Online Stats ') # <<<<<<<<<<<<<<
* logger.info('------------------------------')
* logger.info('f')
*/
- __pyx_k_tuple_142 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_142)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_142);
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_141));
- PyTuple_SET_ITEM(__pyx_k_tuple_142, 0, ((PyObject *)__pyx_kp_s_141));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_141));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_142));
+ __pyx_k_tuple_143 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_143)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_143);
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_142));
+ PyTuple_SET_ITEM(__pyx_k_tuple_143, 0, ((PyObject *)__pyx_kp_s_142));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_142));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_143));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2122
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2127
* logger.info('------------------------------')
* logger.info(' Online Stats ')
* logger.info('------------------------------') # <<<<<<<<<<<<<<
* logger.info('f')
* for w in self.bilex_f:
*/
- __pyx_k_tuple_143 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_143)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_143);
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_139));
- PyTuple_SET_ITEM(__pyx_k_tuple_143, 0, ((PyObject *)__pyx_kp_s_139));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_139));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_143));
+ __pyx_k_tuple_144 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_144)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_144);
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_140));
+ PyTuple_SET_ITEM(__pyx_k_tuple_144, 0, ((PyObject *)__pyx_kp_s_140));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_140));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_144));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2123
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2128
* logger.info(' Online Stats ')
* logger.info('------------------------------')
* logger.info('f') # <<<<<<<<<<<<<<
* for w in self.bilex_f:
* logger.info(sym_tostring(w) + ' : ' + str(self.bilex_f[w]))
*/
- __pyx_k_tuple_144 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_144)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_144);
+ __pyx_k_tuple_145 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_145)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_145);
__Pyx_INCREF(((PyObject *)__pyx_n_s__f));
- PyTuple_SET_ITEM(__pyx_k_tuple_144, 0, ((PyObject *)__pyx_n_s__f));
+ PyTuple_SET_ITEM(__pyx_k_tuple_145, 0, ((PyObject *)__pyx_n_s__f));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__f));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_144));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_145));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2126
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2131
* for w in self.bilex_f:
* logger.info(sym_tostring(w) + ' : ' + str(self.bilex_f[w]))
* logger.info('e') # <<<<<<<<<<<<<<
* for w in self.bilex_e:
* logger.info(sym_tostring(w) + ' : ' + str(self.bilex_e[w]))
*/
- __pyx_k_tuple_146 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_146)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_146);
+ __pyx_k_tuple_147 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_147)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_147);
__Pyx_INCREF(((PyObject *)__pyx_n_s__e));
- PyTuple_SET_ITEM(__pyx_k_tuple_146, 0, ((PyObject *)__pyx_n_s__e));
+ PyTuple_SET_ITEM(__pyx_k_tuple_147, 0, ((PyObject *)__pyx_n_s__e));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__e));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_146));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_147));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2129
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2134
* for w in self.bilex_e:
* logger.info(sym_tostring(w) + ' : ' + str(self.bilex_e[w]))
* logger.info('fe') # <<<<<<<<<<<<<<
* for w in self.bilex_fe:
* for w2 in self.bilex_fe[w]:
*/
- __pyx_k_tuple_147 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_147)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_147);
+ __pyx_k_tuple_148 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_148)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_148);
__Pyx_INCREF(((PyObject *)__pyx_n_s__fe));
- PyTuple_SET_ITEM(__pyx_k_tuple_147, 0, ((PyObject *)__pyx_n_s__fe));
+ PyTuple_SET_ITEM(__pyx_k_tuple_148, 0, ((PyObject *)__pyx_n_s__fe));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__fe));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_147));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_148));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2133
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2138
* for w2 in self.bilex_fe[w]:
* logger.info(sym_tostring(w) + ' : ' + sym_tostring(w2) + ' : ' + str(self.bilex_fe[w][w2]))
* logger.info('F') # <<<<<<<<<<<<<<
* for ph in self.phrases_f:
* logger.info(str(ph) + ' ||| ' + str(self.phrases_f[ph]))
*/
- __pyx_k_tuple_148 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_148)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_148);
+ __pyx_k_tuple_149 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_149)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_149);
__Pyx_INCREF(((PyObject *)__pyx_n_s__F));
- PyTuple_SET_ITEM(__pyx_k_tuple_148, 0, ((PyObject *)__pyx_n_s__F));
+ PyTuple_SET_ITEM(__pyx_k_tuple_149, 0, ((PyObject *)__pyx_n_s__F));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__F));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_148));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_149));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2136
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2141
* for ph in self.phrases_f:
* logger.info(str(ph) + ' ||| ' + str(self.phrases_f[ph]))
* logger.info('E') # <<<<<<<<<<<<<<
* for ph in self.phrases_e:
* logger.info(str(ph) + ' ||| ' + str(self.phrases_e[ph]))
*/
- __pyx_k_tuple_149 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_149)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_149);
+ __pyx_k_tuple_150 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_150)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_150);
__Pyx_INCREF(((PyObject *)__pyx_n_s__E));
- PyTuple_SET_ITEM(__pyx_k_tuple_149, 0, ((PyObject *)__pyx_n_s__E));
+ PyTuple_SET_ITEM(__pyx_k_tuple_150, 0, ((PyObject *)__pyx_n_s__E));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__E));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_149));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_150));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2139
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2144
* for ph in self.phrases_e:
* logger.info(str(ph) + ' ||| ' + str(self.phrases_e[ph]))
* logger.info('FE') # <<<<<<<<<<<<<<
* self.dump_online_rules()
*
*/
- __pyx_k_tuple_150 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_150)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_150);
+ __pyx_k_tuple_151 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_151)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_151);
__Pyx_INCREF(((PyObject *)__pyx_n_s__FE));
- PyTuple_SET_ITEM(__pyx_k_tuple_150, 0, ((PyObject *)__pyx_n_s__FE));
+ PyTuple_SET_ITEM(__pyx_k_tuple_151, 0, ((PyObject *)__pyx_n_s__FE));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__FE));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_150));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_151));
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2166
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2171
* phrases = set() # (fphrase, lex_i, lex_j)
*
* def extract(f_i, f_j, lex_i, lex_j, wc, ntc, syms): # <<<<<<<<<<<<<<
* # Phrase extraction limits
* if f_j > (f_len - 1) or (f_j - f_i) + 1 > self.max_initial_size:
*/
- __pyx_k_tuple_152 = PyTuple_New(10); if (unlikely(!__pyx_k_tuple_152)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_152);
+ __pyx_k_tuple_153 = PyTuple_New(10); if (unlikely(!__pyx_k_tuple_153)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_153);
__Pyx_INCREF(((PyObject *)__pyx_n_s__f_i));
- PyTuple_SET_ITEM(__pyx_k_tuple_152, 0, ((PyObject *)__pyx_n_s__f_i));
+ PyTuple_SET_ITEM(__pyx_k_tuple_153, 0, ((PyObject *)__pyx_n_s__f_i));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__f_i));
__Pyx_INCREF(((PyObject *)__pyx_n_s__f_j));
- PyTuple_SET_ITEM(__pyx_k_tuple_152, 1, ((PyObject *)__pyx_n_s__f_j));
+ PyTuple_SET_ITEM(__pyx_k_tuple_153, 1, ((PyObject *)__pyx_n_s__f_j));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__f_j));
__Pyx_INCREF(((PyObject *)__pyx_n_s__lex_i));
- PyTuple_SET_ITEM(__pyx_k_tuple_152, 2, ((PyObject *)__pyx_n_s__lex_i));
+ PyTuple_SET_ITEM(__pyx_k_tuple_153, 2, ((PyObject *)__pyx_n_s__lex_i));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__lex_i));
__Pyx_INCREF(((PyObject *)__pyx_n_s__lex_j));
- PyTuple_SET_ITEM(__pyx_k_tuple_152, 3, ((PyObject *)__pyx_n_s__lex_j));
+ PyTuple_SET_ITEM(__pyx_k_tuple_153, 3, ((PyObject *)__pyx_n_s__lex_j));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__lex_j));
__Pyx_INCREF(((PyObject *)__pyx_n_s__wc));
- PyTuple_SET_ITEM(__pyx_k_tuple_152, 4, ((PyObject *)__pyx_n_s__wc));
+ PyTuple_SET_ITEM(__pyx_k_tuple_153, 4, ((PyObject *)__pyx_n_s__wc));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__wc));
__Pyx_INCREF(((PyObject *)__pyx_n_s__ntc));
- PyTuple_SET_ITEM(__pyx_k_tuple_152, 5, ((PyObject *)__pyx_n_s__ntc));
+ PyTuple_SET_ITEM(__pyx_k_tuple_153, 5, ((PyObject *)__pyx_n_s__ntc));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__ntc));
__Pyx_INCREF(((PyObject *)__pyx_n_s__syms));
- PyTuple_SET_ITEM(__pyx_k_tuple_152, 6, ((PyObject *)__pyx_n_s__syms));
+ PyTuple_SET_ITEM(__pyx_k_tuple_153, 6, ((PyObject *)__pyx_n_s__syms));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__syms));
__Pyx_INCREF(((PyObject *)__pyx_n_s__f));
- PyTuple_SET_ITEM(__pyx_k_tuple_152, 7, ((PyObject *)__pyx_n_s__f));
+ PyTuple_SET_ITEM(__pyx_k_tuple_153, 7, ((PyObject *)__pyx_n_s__f));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__f));
__Pyx_INCREF(((PyObject *)__pyx_n_s__new_lex_i));
- PyTuple_SET_ITEM(__pyx_k_tuple_152, 8, ((PyObject *)__pyx_n_s__new_lex_i));
+ PyTuple_SET_ITEM(__pyx_k_tuple_153, 8, ((PyObject *)__pyx_n_s__new_lex_i));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__new_lex_i));
__Pyx_INCREF(((PyObject *)__pyx_n_s__new_lex_j));
- PyTuple_SET_ITEM(__pyx_k_tuple_152, 9, ((PyObject *)__pyx_n_s__new_lex_j));
+ PyTuple_SET_ITEM(__pyx_k_tuple_153, 9, ((PyObject *)__pyx_n_s__new_lex_j));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__new_lex_j));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_152));
- __pyx_k_codeobj_153 = (PyObject*)__Pyx_PyCode_New(7, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_152, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_136, __pyx_n_s__extract, 2166, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_153)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_153));
+ __pyx_k_codeobj_154 = (PyObject*)__Pyx_PyCode_New(7, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_137, __pyx_n_s__extract, 2171, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_154)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "_sa.pyx":5
+ * import gzip
+ *
+ * def monitor_cpu(): # <<<<<<<<<<<<<<
+ * return (resource.getrusage(resource.RUSAGE_SELF).ru_utime+
+ * resource.getrusage(resource.RUSAGE_SELF).ru_stime)
+ */
+ __pyx_k_codeobj_156 = (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_157, __pyx_n_s__monitor_cpu, 5, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_156)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "_sa.pyx":9
* resource.getrusage(resource.RUSAGE_SELF).ru_stime)
@@ -80499,16 +80717,16 @@ static int __Pyx_InitCachedConstants(void) {
* if filename.endswith('.gz'):
* return gzip.GzipFile(filename)
*/
- __pyx_k_tuple_155 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_155)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_155);
+ __pyx_k_tuple_158 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_158)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_158);
__Pyx_INCREF(((PyObject *)__pyx_n_s__filename));
- PyTuple_SET_ITEM(__pyx_k_tuple_155, 0, ((PyObject *)__pyx_n_s__filename));
+ PyTuple_SET_ITEM(__pyx_k_tuple_158, 0, ((PyObject *)__pyx_n_s__filename));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__filename));
__Pyx_INCREF(((PyObject *)__pyx_n_s__filename));
- PyTuple_SET_ITEM(__pyx_k_tuple_155, 1, ((PyObject *)__pyx_n_s__filename));
+ PyTuple_SET_ITEM(__pyx_k_tuple_158, 1, ((PyObject *)__pyx_n_s__filename));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__filename));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_155));
- __pyx_k_codeobj_156 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_157, __pyx_n_s__gzip_or_text, 9, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_156)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_158));
+ __pyx_k_codeobj_159 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_158, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_157, __pyx_n_s__gzip_or_text, 9, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_159)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "_sa.pyx":15
* return open(filename)
@@ -80517,209 +80735,209 @@ static int __Pyx_InitCachedConstants(void) {
*
* include "float_list.pxi"
*/
- __pyx_k_tuple_159 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_159)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_159);
- __Pyx_INCREF(((PyObject *)__pyx_kp_s_158));
- PyTuple_SET_ITEM(__pyx_k_tuple_159, 0, ((PyObject *)__pyx_kp_s_158));
- __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_158));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_159));
+ __pyx_k_tuple_161 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_161)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_161);
+ __Pyx_INCREF(((PyObject *)__pyx_kp_s_160));
+ PyTuple_SET_ITEM(__pyx_k_tuple_161, 0, ((PyObject *)__pyx_kp_s_160));
+ __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_160));
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_161));
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":107
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":107
* return ALPHABET.fromstring(string, terminal)
*
* def isvar(sym): # <<<<<<<<<<<<<<
* return sym_isvar(sym)
*
*/
- __pyx_k_tuple_160 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_160)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_160);
+ __pyx_k_tuple_162 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_162)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_162);
__Pyx_INCREF(((PyObject *)__pyx_n_s__sym));
- PyTuple_SET_ITEM(__pyx_k_tuple_160, 0, ((PyObject *)__pyx_n_s__sym));
+ PyTuple_SET_ITEM(__pyx_k_tuple_162, 0, ((PyObject *)__pyx_n_s__sym));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__sym));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_160));
- __pyx_k_codeobj_161 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_160, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_162, __pyx_n_s__isvar, 107, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_161)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_162));
+ __pyx_k_codeobj_163 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_162, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_164, __pyx_n_s__isvar, 107, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_163)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":110
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":110
* return sym_isvar(sym)
*
* def make_lattice(words): # <<<<<<<<<<<<<<
* word_ids = (sym_fromstring(word, True) for word in words)
* return tuple(((word, None, 1), ) for word in word_ids)
*/
- __pyx_k_tuple_163 = PyTuple_New(5); if (unlikely(!__pyx_k_tuple_163)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_163);
+ __pyx_k_tuple_165 = PyTuple_New(5); if (unlikely(!__pyx_k_tuple_165)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_165);
__Pyx_INCREF(((PyObject *)__pyx_n_s__words));
- PyTuple_SET_ITEM(__pyx_k_tuple_163, 0, ((PyObject *)__pyx_n_s__words));
+ PyTuple_SET_ITEM(__pyx_k_tuple_165, 0, ((PyObject *)__pyx_n_s__words));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__words));
__Pyx_INCREF(((PyObject *)__pyx_n_s__word_ids));
- PyTuple_SET_ITEM(__pyx_k_tuple_163, 1, ((PyObject *)__pyx_n_s__word_ids));
+ PyTuple_SET_ITEM(__pyx_k_tuple_165, 1, ((PyObject *)__pyx_n_s__word_ids));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__word_ids));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_163, 2, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_165, 2, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_163, 3, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_165, 3, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_163, 4, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_165, 4, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_163));
- __pyx_k_codeobj_164 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_163, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_162, __pyx_n_s__make_lattice, 110, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_164)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_165));
+ __pyx_k_codeobj_166 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_165, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_164, __pyx_n_s__make_lattice, 110, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_166)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":114
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":114
* return tuple(((word, None, 1), ) for word in word_ids)
*
* def decode_lattice(lattice): # <<<<<<<<<<<<<<
* return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc
* for arc in node for node in lattice)
*/
- __pyx_k_tuple_165 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_165)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_165);
+ __pyx_k_tuple_167 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_167)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_167);
__Pyx_INCREF(((PyObject *)__pyx_n_s__lattice));
- PyTuple_SET_ITEM(__pyx_k_tuple_165, 0, ((PyObject *)__pyx_n_s__lattice));
+ PyTuple_SET_ITEM(__pyx_k_tuple_167, 0, ((PyObject *)__pyx_n_s__lattice));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__lattice));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_165, 1, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_167, 1, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_165, 2, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_167, 2, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_165));
- __pyx_k_codeobj_166 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_165, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_162, __pyx_n_s__decode_lattice, 114, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_166)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_167));
+ __pyx_k_codeobj_168 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_167, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_164, __pyx_n_s__decode_lattice, 114, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_168)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":118
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":118
* for arc in node for node in lattice)
*
* def decode_sentence(lattice): # <<<<<<<<<<<<<<
* return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice)
*
*/
- __pyx_k_tuple_167 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_167)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_167);
+ __pyx_k_tuple_169 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_169)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_169);
__Pyx_INCREF(((PyObject *)__pyx_n_s__lattice));
- PyTuple_SET_ITEM(__pyx_k_tuple_167, 0, ((PyObject *)__pyx_n_s__lattice));
+ PyTuple_SET_ITEM(__pyx_k_tuple_169, 0, ((PyObject *)__pyx_n_s__lattice));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__lattice));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_167, 1, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_169, 1, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_167, 2, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_169, 2, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_167));
- __pyx_k_codeobj_168 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_167, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_162, __pyx_n_s__decode_sentence, 118, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_168)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_169));
+ __pyx_k_codeobj_170 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_169, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_164, __pyx_n_s__decode_sentence, 118, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_170)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":121
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":121
* return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice)
*
* def encode_words(words): # <<<<<<<<<<<<<<
* return tuple(sym_fromstring(word, True) for word in words)
*
*/
- __pyx_k_tuple_169 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_169)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_169);
+ __pyx_k_tuple_171 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_171)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_171);
__Pyx_INCREF(((PyObject *)__pyx_n_s__words));
- PyTuple_SET_ITEM(__pyx_k_tuple_169, 0, ((PyObject *)__pyx_n_s__words));
+ PyTuple_SET_ITEM(__pyx_k_tuple_171, 0, ((PyObject *)__pyx_n_s__words));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__words));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_169, 1, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_171, 1, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_169, 2, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_171, 2, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_169));
- __pyx_k_codeobj_170 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_169, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_162, __pyx_n_s__encode_words, 121, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_170)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_171));
+ __pyx_k_codeobj_172 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_171, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_164, __pyx_n_s__encode_words, 121, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_172)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":124
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":124
* return tuple(sym_fromstring(word, True) for word in words)
*
* def decode_words(syms): # <<<<<<<<<<<<<<
* return tuple(sym_tostring(sym) for sym in syms)
*/
- __pyx_k_tuple_171 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_171)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_171);
+ __pyx_k_tuple_173 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_173)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_173);
__Pyx_INCREF(((PyObject *)__pyx_n_s__syms));
- PyTuple_SET_ITEM(__pyx_k_tuple_171, 0, ((PyObject *)__pyx_n_s__syms));
+ PyTuple_SET_ITEM(__pyx_k_tuple_173, 0, ((PyObject *)__pyx_n_s__syms));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__syms));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_171, 1, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_173, 1, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
__Pyx_INCREF(((PyObject *)__pyx_n_s__genexpr));
- PyTuple_SET_ITEM(__pyx_k_tuple_171, 2, ((PyObject *)__pyx_n_s__genexpr));
+ PyTuple_SET_ITEM(__pyx_k_tuple_173, 2, ((PyObject *)__pyx_n_s__genexpr));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__genexpr));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_171));
- __pyx_k_codeobj_172 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_171, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_162, __pyx_n_s__decode_words, 124, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_172)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_173));
+ __pyx_k_codeobj_174 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_173, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_164, __pyx_n_s__decode_words, 124, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_174)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2200
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2205
*
* # Spans are _inclusive_ on both ends [i, j]
* def span_check(vec, i, j): # <<<<<<<<<<<<<<
* k = i
* while k <= j:
*/
- __pyx_k_tuple_174 = PyTuple_New(4); if (unlikely(!__pyx_k_tuple_174)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_174);
+ __pyx_k_tuple_176 = PyTuple_New(4); if (unlikely(!__pyx_k_tuple_176)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_176);
__Pyx_INCREF(((PyObject *)__pyx_n_s__vec));
- PyTuple_SET_ITEM(__pyx_k_tuple_174, 0, ((PyObject *)__pyx_n_s__vec));
+ PyTuple_SET_ITEM(__pyx_k_tuple_176, 0, ((PyObject *)__pyx_n_s__vec));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__vec));
__Pyx_INCREF(((PyObject *)__pyx_n_s__i));
- PyTuple_SET_ITEM(__pyx_k_tuple_174, 1, ((PyObject *)__pyx_n_s__i));
+ PyTuple_SET_ITEM(__pyx_k_tuple_176, 1, ((PyObject *)__pyx_n_s__i));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
__Pyx_INCREF(((PyObject *)__pyx_n_s__j));
- PyTuple_SET_ITEM(__pyx_k_tuple_174, 2, ((PyObject *)__pyx_n_s__j));
+ PyTuple_SET_ITEM(__pyx_k_tuple_176, 2, ((PyObject *)__pyx_n_s__j));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__j));
__Pyx_INCREF(((PyObject *)__pyx_n_s__k));
- PyTuple_SET_ITEM(__pyx_k_tuple_174, 3, ((PyObject *)__pyx_n_s__k));
+ PyTuple_SET_ITEM(__pyx_k_tuple_176, 3, ((PyObject *)__pyx_n_s__k));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__k));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_174));
- __pyx_k_codeobj_175 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_174, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_136, __pyx_n_s__span_check, 2200, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_175)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_176));
+ __pyx_k_codeobj_177 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_176, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_137, __pyx_n_s__span_check, 2205, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_177)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2208
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2213
* return True
*
* def span_inc(vec, i, j): # <<<<<<<<<<<<<<
* k = i
* while k <= j:
*/
- __pyx_k_tuple_176 = PyTuple_New(4); if (unlikely(!__pyx_k_tuple_176)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_176);
+ __pyx_k_tuple_178 = PyTuple_New(4); if (unlikely(!__pyx_k_tuple_178)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_178);
__Pyx_INCREF(((PyObject *)__pyx_n_s__vec));
- PyTuple_SET_ITEM(__pyx_k_tuple_176, 0, ((PyObject *)__pyx_n_s__vec));
+ PyTuple_SET_ITEM(__pyx_k_tuple_178, 0, ((PyObject *)__pyx_n_s__vec));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__vec));
__Pyx_INCREF(((PyObject *)__pyx_n_s__i));
- PyTuple_SET_ITEM(__pyx_k_tuple_176, 1, ((PyObject *)__pyx_n_s__i));
+ PyTuple_SET_ITEM(__pyx_k_tuple_178, 1, ((PyObject *)__pyx_n_s__i));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
__Pyx_INCREF(((PyObject *)__pyx_n_s__j));
- PyTuple_SET_ITEM(__pyx_k_tuple_176, 2, ((PyObject *)__pyx_n_s__j));
+ PyTuple_SET_ITEM(__pyx_k_tuple_178, 2, ((PyObject *)__pyx_n_s__j));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__j));
__Pyx_INCREF(((PyObject *)__pyx_n_s__k));
- PyTuple_SET_ITEM(__pyx_k_tuple_176, 3, ((PyObject *)__pyx_n_s__k));
+ PyTuple_SET_ITEM(__pyx_k_tuple_178, 3, ((PyObject *)__pyx_n_s__k));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__k));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_176));
- __pyx_k_codeobj_177 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_176, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_136, __pyx_n_s__span_inc, 2208, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_177)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_178));
+ __pyx_k_codeobj_179 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_178, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_137, __pyx_n_s__span_inc, 2213, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_179)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2214
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2219
* k += 1
*
* def span_dec(vec, i, j): # <<<<<<<<<<<<<<
* k = i
* while k <= j:
*/
- __pyx_k_tuple_178 = PyTuple_New(4); if (unlikely(!__pyx_k_tuple_178)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_178);
+ __pyx_k_tuple_180 = PyTuple_New(4); if (unlikely(!__pyx_k_tuple_180)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_k_tuple_180);
__Pyx_INCREF(((PyObject *)__pyx_n_s__vec));
- PyTuple_SET_ITEM(__pyx_k_tuple_178, 0, ((PyObject *)__pyx_n_s__vec));
+ PyTuple_SET_ITEM(__pyx_k_tuple_180, 0, ((PyObject *)__pyx_n_s__vec));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__vec));
__Pyx_INCREF(((PyObject *)__pyx_n_s__i));
- PyTuple_SET_ITEM(__pyx_k_tuple_178, 1, ((PyObject *)__pyx_n_s__i));
+ PyTuple_SET_ITEM(__pyx_k_tuple_180, 1, ((PyObject *)__pyx_n_s__i));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
__Pyx_INCREF(((PyObject *)__pyx_n_s__j));
- PyTuple_SET_ITEM(__pyx_k_tuple_178, 2, ((PyObject *)__pyx_n_s__j));
+ PyTuple_SET_ITEM(__pyx_k_tuple_180, 2, ((PyObject *)__pyx_n_s__j));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__j));
__Pyx_INCREF(((PyObject *)__pyx_n_s__k));
- PyTuple_SET_ITEM(__pyx_k_tuple_178, 3, ((PyObject *)__pyx_n_s__k));
+ PyTuple_SET_ITEM(__pyx_k_tuple_180, 3, ((PyObject *)__pyx_n_s__k));
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__k));
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_178));
- __pyx_k_codeobj_179 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_178, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_136, __pyx_n_s__span_dec, 2214, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_179)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_180));
+ __pyx_k_codeobj_181 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_180, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_137, __pyx_n_s__span_dec, 2219, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_181)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
@@ -81023,21 +81241,21 @@ PyMODINIT_FUNC PyInit__sa(void)
__pyx_ptype_3_sa___pyx_scope_struct_17_genexpr = &__pyx_type_3_sa___pyx_scope_struct_17_genexpr;
if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_18_alignments) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct_18_alignments = &__pyx_type_3_sa___pyx_scope_struct_18_alignments;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_19_input) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_19_input) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 973; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct_19_input = &__pyx_type_3_sa___pyx_scope_struct_19_input;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_20_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_20_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct_20_genexpr = &__pyx_type_3_sa___pyx_scope_struct_20_genexpr;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_21_add_instance) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_21_add_instance) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct_21_add_instance = &__pyx_type_3_sa___pyx_scope_struct_21_add_instance;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_22_form_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_22_form_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct_22_form_rule = &__pyx_type_3_sa___pyx_scope_struct_22_form_rule;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_23_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_23_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct_23_genexpr = &__pyx_type_3_sa___pyx_scope_struct_23_genexpr;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_24_fmt_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_24_fmt_rule) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct_24_fmt_rule = &__pyx_type_3_sa___pyx_scope_struct_24_fmt_rule;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_25_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_25_genexpr) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct_25_genexpr = &__pyx_type_3_sa___pyx_scope_struct_25_genexpr;
- if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_26_get_f_phrases) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_26_get_f_phrases) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct_26_get_f_phrases = &__pyx_type_3_sa___pyx_scope_struct_26_get_f_phrases;
if (PyType_Ready(&__pyx_type_3_sa___pyx_scope_struct_27___iter__) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_ptype_3_sa___pyx_scope_struct_27___iter__ = &__pyx_type_3_sa___pyx_scope_struct_27___iter__;
@@ -81076,13 +81294,25 @@ PyMODINIT_FUNC PyInit__sa(void)
* import resource
* import gzip # <<<<<<<<<<<<<<
*
- * cdef float monitor_cpu():
+ * def monitor_cpu():
*/
__pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__gzip), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyObject_SetAttr(__pyx_m, __pyx_n_s__gzip, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ /* "_sa.pyx":5
+ * import gzip
+ *
+ * def monitor_cpu(): # <<<<<<<<<<<<<<
+ * return (resource.getrusage(resource.RUSAGE_SELF).ru_utime+
+ * resource.getrusage(resource.RUSAGE_SELF).ru_stime)
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_1monitor_cpu, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__monitor_cpu, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
/* "_sa.pyx":9
* resource.getrusage(resource.RUSAGE_SELF).ru_stime)
*
@@ -81090,7 +81320,7 @@ PyMODINIT_FUNC PyInit__sa(void)
* if filename.endswith('.gz'):
* return gzip.GzipFile(filename)
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_1gzip_or_text, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_3gzip_or_text, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyObject_SetAttr(__pyx_m, __pyx_n_s__gzip_or_text, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -81107,13 +81337,13 @@ PyMODINIT_FUNC PyInit__sa(void)
__pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__getLogger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_159), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_161), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_s__logger, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/bilex.pxi":54
+ /* "/home/pauldb/workspace/cdec/python/src/sa/bilex.pxi":54
* cdef id2eword, id2fword, eword2id, fword2id
*
* def __cinit__(self, from_text=None, from_data=False, from_binary=None, # <<<<<<<<<<<<<<
@@ -81126,7 +81356,7 @@ PyMODINIT_FUNC PyInit__sa(void)
__Pyx_GIVEREF(__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":17
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":17
* from libc.string cimport memset
*
* cdef int MIN_BOTTOM_SIZE = 32 # <<<<<<<<<<<<<<
@@ -81135,7 +81365,7 @@ PyMODINIT_FUNC PyInit__sa(void)
*/
__pyx_v_3_sa_MIN_BOTTOM_SIZE = 32;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":18
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":18
*
* cdef int MIN_BOTTOM_SIZE = 32
* cdef int MIN_BOTTOM_BITS = 5 # <<<<<<<<<<<<<<
@@ -81144,7 +81374,7 @@ PyMODINIT_FUNC PyInit__sa(void)
*/
__pyx_v_3_sa_MIN_BOTTOM_BITS = 5;
- /* "/home/m/workspace/cdec/python/src/sa/veb.pxi":28
+ /* "/home/pauldb/workspace/cdec/python/src/sa/veb.pxi":28
* LOWER_MASK[i] = mask
*
* _init_lower_mask() # <<<<<<<<<<<<<<
@@ -81153,7 +81383,7 @@ PyMODINIT_FUNC PyInit__sa(void)
*/
__pyx_f_3_sa__init_lower_mask();
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":4
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":4
* from libc.stdlib cimport malloc, realloc, strtol
*
* cdef int INDEX_SHIFT = 3 # <<<<<<<<<<<<<<
@@ -81162,7 +81392,7 @@ PyMODINIT_FUNC PyInit__sa(void)
*/
__pyx_v_3_sa_INDEX_SHIFT = 3;
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":5
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":5
*
* cdef int INDEX_SHIFT = 3
* cdef int INDEX_MASK = (1<<INDEX_SHIFT)-1 # <<<<<<<<<<<<<<
@@ -81171,7 +81401,7 @@ PyMODINIT_FUNC PyInit__sa(void)
*/
__pyx_v_3_sa_INDEX_MASK = ((1 << __pyx_v_3_sa_INDEX_SHIFT) - 1);
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":87
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":87
* return self.terminals.index(s)
*
* cdef Alphabet ALPHABET = Alphabet() # <<<<<<<<<<<<<<
@@ -81186,78 +81416,78 @@ PyMODINIT_FUNC PyInit__sa(void)
__pyx_v_3_sa_ALPHABET = ((struct __pyx_obj_3_sa_Alphabet *)__pyx_t_1);
__pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":107
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":107
* return ALPHABET.fromstring(string, terminal)
*
* def isvar(sym): # <<<<<<<<<<<<<<
* return sym_isvar(sym)
*
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_3isvar, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_5isvar, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyObject_SetAttr(__pyx_m, __pyx_n_s__isvar, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":110
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":110
* return sym_isvar(sym)
*
* def make_lattice(words): # <<<<<<<<<<<<<<
* word_ids = (sym_fromstring(word, True) for word in words)
* return tuple(((word, None, 1), ) for word in word_ids)
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_5make_lattice, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_7make_lattice, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyObject_SetAttr(__pyx_m, __pyx_n_s__make_lattice, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":114
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":114
* return tuple(((word, None, 1), ) for word in word_ids)
*
* def decode_lattice(lattice): # <<<<<<<<<<<<<<
* return tuple((sym_tostring(sym), weight, dist) for (sym, weight, dist) in arc
* for arc in node for node in lattice)
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_7decode_lattice, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_9decode_lattice, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyObject_SetAttr(__pyx_m, __pyx_n_s__decode_lattice, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":118
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":118
* for arc in node for node in lattice)
*
* def decode_sentence(lattice): # <<<<<<<<<<<<<<
* return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice)
*
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_9decode_sentence, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_11decode_sentence, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyObject_SetAttr(__pyx_m, __pyx_n_s__decode_sentence, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":121
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":121
* return tuple(sym_tostring(sym) for ((sym, _, _),) in lattice)
*
* def encode_words(words): # <<<<<<<<<<<<<<
* return tuple(sym_fromstring(word, True) for word in words)
*
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_11encode_words, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_13encode_words, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyObject_SetAttr(__pyx_m, __pyx_n_s__encode_words, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/sym.pxi":124
+ /* "/home/pauldb/workspace/cdec/python/src/sa/sym.pxi":124
* return tuple(sym_fromstring(word, True) for word in words)
*
* def decode_words(syms): # <<<<<<<<<<<<<<
* return tuple(sym_tostring(sym) for sym in syms)
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_13decode_words, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3_sa_15decode_words, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
if (PyObject_SetAttr(__pyx_m, __pyx_n_s__decode_words, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":5
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":5
* # Much faster than the Python numbers reported there.
* # Note to reader: this code is closer to C than Python
* import gc # <<<<<<<<<<<<<<
@@ -81269,7 +81499,7 @@ PyMODINIT_FUNC PyInit__sa(void)
if (PyObject_SetAttr(__pyx_m, __pyx_n_s__gc, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":6
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":6
* # Note to reader: this code is closer to C than Python
* import gc
* import itertools # <<<<<<<<<<<<<<
@@ -81281,7 +81511,7 @@ PyMODINIT_FUNC PyInit__sa(void)
if (PyObject_SetAttr(__pyx_m, __pyx_n_s__itertools, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":12
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":12
* from libc.math cimport fmod, ceil, floor, log
*
* from collections import defaultdict, Counter, namedtuple # <<<<<<<<<<<<<<
@@ -81328,7 +81558,7 @@ PyMODINIT_FUNC PyInit__sa(void)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":14
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":14
* from collections import defaultdict, Counter, namedtuple
*
* FeatureContext = namedtuple('FeatureContext', # <<<<<<<<<<<<<<
@@ -81338,7 +81568,7 @@ PyMODINIT_FUNC PyInit__sa(void)
__pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__namedtuple); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":15
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":15
*
* FeatureContext = namedtuple('FeatureContext',
* ['fphrase', # <<<<<<<<<<<<<<
@@ -81401,7 +81631,7 @@ PyMODINIT_FUNC PyInit__sa(void)
if (PyObject_SetAttr(__pyx_m, __pyx_n_s__FeatureContext, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":30
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":30
* ])
*
* OnlineFeatureContext = namedtuple('OnlineFeatureContext', # <<<<<<<<<<<<<<
@@ -81411,7 +81641,7 @@ PyMODINIT_FUNC PyInit__sa(void)
__pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__namedtuple); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":31
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":31
*
* OnlineFeatureContext = namedtuple('OnlineFeatureContext',
* ['fcount', # <<<<<<<<<<<<<<
@@ -81440,9 +81670,9 @@ PyMODINIT_FUNC PyInit__sa(void)
__Pyx_GIVEREF(((PyObject *)__pyx_n_s__bilex_fe));
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(((PyObject *)__pyx_n_s_151));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s_151));
- __Pyx_GIVEREF(((PyObject *)__pyx_n_s_151));
+ __Pyx_INCREF(((PyObject *)__pyx_n_s_152));
+ PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s_152));
+ __Pyx_GIVEREF(((PyObject *)__pyx_n_s_152));
PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_t_3));
__Pyx_GIVEREF(((PyObject *)__pyx_t_3));
__pyx_t_3 = 0;
@@ -81450,10 +81680,10 @@ PyMODINIT_FUNC PyInit__sa(void)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_151, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_152, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":39
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":39
* ])
*
* cdef int PRECOMPUTE = 0 # <<<<<<<<<<<<<<
@@ -81462,7 +81692,7 @@ PyMODINIT_FUNC PyInit__sa(void)
*/
__pyx_v_3_sa_PRECOMPUTE = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":40
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":40
*
* cdef int PRECOMPUTE = 0
* cdef int MERGE = 1 # <<<<<<<<<<<<<<
@@ -81471,7 +81701,7 @@ PyMODINIT_FUNC PyInit__sa(void)
*/
__pyx_v_3_sa_MERGE = 1;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":41
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":41
* cdef int PRECOMPUTE = 0
* cdef int MERGE = 1
* cdef int BAEZA_YATES = 2 # <<<<<<<<<<<<<<
@@ -81480,16 +81710,16 @@ PyMODINIT_FUNC PyInit__sa(void)
*/
__pyx_v_3_sa_BAEZA_YATES = 2;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":44
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":44
*
* # NOTE: was encoded as a non-terminal in the previous version
* cdef int EPSILON = sym_fromstring('*EPS*', True) # <<<<<<<<<<<<<<
*
* cdef class TrieNode:
*/
- __pyx_v_3_sa_EPSILON = __pyx_f_3_sa_sym_fromstring(__pyx_k_173, 1);
+ __pyx_v_3_sa_EPSILON = __pyx_f_3_sa_sym_fromstring(__pyx_k_175, 1);
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":67
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":67
* cdef public int count
* cdef public root
* def __cinit__(self, extended=False): # <<<<<<<<<<<<<<
@@ -81502,43 +81732,43 @@ PyMODINIT_FUNC PyInit__sa(void)
__Pyx_GIVEREF(__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2200
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2205
*
* # Spans are _inclusive_ on both ends [i, j]
* def span_check(vec, i, j): # <<<<<<<<<<<<<<
* k = i
* while k <= j:
*/
- __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3_sa_15span_check, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3_sa_17span_check, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__span_check, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__span_check, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2208
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2213
* return True
*
* def span_inc(vec, i, j): # <<<<<<<<<<<<<<
* k = i
* while k <= j:
*/
- __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3_sa_17span_inc, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3_sa_19span_inc, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__span_inc, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__span_inc, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/rulefactory.pxi":2214
+ /* "/home/pauldb/workspace/cdec/python/src/sa/rulefactory.pxi":2219
* k += 1
*
* def span_dec(vec, i, j): # <<<<<<<<<<<<<<
* k = i
* while k <= j:
*/
- __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3_sa_19span_dec, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_3_sa_21span_dec, NULL, __pyx_n_s___sa); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s__span_dec, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s__span_dec, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 2219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/features.pxi":1
+ /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":1
* cdef StringMap FD = StringMap() # Feature name dictionary # <<<<<<<<<<<<<<
*
* INITIAL_CAPACITY = 7 # default number of features
@@ -81551,7 +81781,7 @@ PyMODINIT_FUNC PyInit__sa(void)
__pyx_v_3_sa_FD = ((struct __pyx_obj_3_sa_StringMap *)__pyx_t_3);
__pyx_t_3 = 0;
- /* "/home/m/workspace/cdec/python/src/sa/features.pxi":3
+ /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":3
* cdef StringMap FD = StringMap() # Feature name dictionary
*
* INITIAL_CAPACITY = 7 # default number of features # <<<<<<<<<<<<<<
@@ -81560,7 +81790,7 @@ PyMODINIT_FUNC PyInit__sa(void)
*/
if (PyObject_SetAttr(__pyx_m, __pyx_n_s__INITIAL_CAPACITY, __pyx_int_7) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /* "/home/m/workspace/cdec/python/src/sa/features.pxi":4
+ /* "/home/pauldb/workspace/cdec/python/src/sa/features.pxi":4
*
* INITIAL_CAPACITY = 7 # default number of features
* INCREMENT = INITIAL_CAPACITY # double size # <<<<<<<<<<<<<<
diff --git a/python/src/sa/_sa.pyx b/python/src/sa/_sa.pyx
index 50da4235..4716d174 100644
--- a/python/src/sa/_sa.pyx
+++ b/python/src/sa/_sa.pyx
@@ -2,7 +2,7 @@ import logging
import resource
import gzip
-cdef float monitor_cpu():
+def monitor_cpu():
return (resource.getrusage(resource.RUSAGE_SELF).ru_utime+
resource.getrusage(resource.RUSAGE_SELF).ru_stime)
diff --git a/python/src/sa/rulefactory.pxi b/python/src/sa/rulefactory.pxi
index 7063c2da..d7fca750 100644
--- a/python/src/sa/rulefactory.pxi
+++ b/python/src/sa/rulefactory.pxi
@@ -260,6 +260,7 @@ cdef class HieroCachingRuleFactory:
cdef prev_norm_prefix
cdef float extract_time
+ cdef float intersect_time
cdef SuffixArray fsa
cdef DataArray fda
cdef DataArray eda
@@ -979,10 +980,11 @@ cdef class HieroCachingRuleFactory:
cdef IntList sample, chunklen
cdef Matching matching
cdef Phrase hiero_phrase
-
+
flen = len(fwords)
start_time = monitor_cpu()
self.extract_time = 0.0
+ self.intersect_time = 0.0
nodes_isteps_away_buffer = {}
hit = 0
reachable_buffer = {}
@@ -1072,7 +1074,10 @@ cdef class HieroCachingRuleFactory:
else:
if arity > 0:
# Intersecting because of arity > 0
+ intersect_start_time = monitor_cpu()
phrase_location = self.intersect(node, node.suffix_link.children[word_id], hiero_phrase)
+ intersect_stop_time = monitor_cpu()
+ self.intersect_time += intersect_stop_time - intersect_start_time
else:
# Suffix array search
phrase_location = node.phrase_location
@@ -1203,6 +1208,7 @@ cdef class HieroCachingRuleFactory:
logger.info("Total time for rule lookup, extraction, and scoring = %f seconds", (stop_time - start_time))
gc.collect()
logger.info(" Extract time = %f seconds", self.extract_time)
+ logger.info(" Intersect time = %f seconds", self.intersect_time)
cdef int find_fixpoint(self,
@@ -1674,7 +1680,6 @@ cdef class HieroCachingRuleFactory:
for (phrase2,eindexes) in phrase_list:
als1 = self.create_alignments(sent_links,num_links,self.findexes,eindexes)
extracts.append((fphr, phrase2, pair_count, tuple(als1)))
-
if (num_gaps < self.max_nonterminals and
phrase_len < self.max_length and
f_back_high - f_back_low + self.train_min_gap_size <= self.train_max_initial_size):
@@ -1809,12 +1814,12 @@ cdef class HieroCachingRuleFactory:
met_constraints = 0
if (met_constraints and
- self.find_fixpoint(f_x_low, f_x_high,
+ (self.find_fixpoint(f_x_low, f_x_high,
f_links_low, f_links_high, e_links_low, e_links_high,
e_low, e_high, &e_x_low, &e_x_high, &f_x_low, &f_x_high,
f_sent_len, e_sent_len,
self.train_max_initial_size, self.train_max_initial_size,
- 1, 1, 2, 1, 1, 1, 1) and
+ 1, 1, 2, 1, 1, 1, 1) == 1) and
((not self.tight_phrases) or (f_links_low[f_x_low] != -1 and f_links_low[f_x_high-1] != -1)) and
self.find_fixpoint(f_x_low, f_low,
f_links_low, f_links_high, e_links_low, e_links_high,