diff options
| author | Victor Chahuneau <vchahune@cs.cmu.edu> | 2012-07-27 22:25:15 -0400 | 
|---|---|---|
| committer | Victor Chahuneau <vchahune@cs.cmu.edu> | 2012-07-27 22:25:15 -0400 | 
| commit | 1d481414a2fa8505a2591c88e2b7b8f86a682ca2 (patch) | |
| tree | ed5e9dff569d89da453578ce3d109991623d9303 /python/src/sa/rulefactory.pxi | |
| parent | b317e0efd2398d75d70e027bb1e2cf442e683981 (diff) | |
[python] conversion from cdec.sa.Rule to cdec.TRule
+ remove configobj dependency
+ re-structure packages (no more top-level library)
+ "const" stuff
+ use __new__ instead of constructor for some objects
Diffstat (limited to 'python/src/sa/rulefactory.pxi')
| -rw-r--r-- | python/src/sa/rulefactory.pxi | 3 | 
1 files changed, 1 insertions, 2 deletions
diff --git a/python/src/sa/rulefactory.pxi b/python/src/sa/rulefactory.pxi index 24bb680f..1c8d25a4 100644 --- a/python/src/sa/rulefactory.pxi +++ b/python/src/sa/rulefactory.pxi @@ -975,7 +975,6 @@ cdef class HieroCachingRuleFactory:                      continue                  phrase = prefix + (word_id,) -                str_phrase = map(sym_tostring, phrase)                  hiero_phrase = Phrase(phrase)                  arity = hiero_phrase.arity() @@ -1019,7 +1018,7 @@ cdef class HieroCachingRuleFactory:                          else:                              # Suffix array search                              phrase_location = node.phrase_location -                            sa_range = self.fsa.lookup(str_phrase[-1], len(str_phrase)-1, phrase_location.sa_low, phrase_location.sa_high) +                            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:  | 
