summaryrefslogtreecommitdiff
path: root/python/cdec/sa/rulefactory.pxi
diff options
context:
space:
mode:
authorMichael Denkowski <mdenkows@cs.cmu.edu>2013-09-24 13:46:01 -0700
committerMichael Denkowski <mdenkows@cs.cmu.edu>2013-09-24 13:46:01 -0700
commit5684942eadd5b4c3fd54f4871d13975793a1f067 (patch)
treeb26b0838372b11b9d4a1d73a70021520db6e00b6 /python/cdec/sa/rulefactory.pxi
parentf8a0d65a4cebd45bd48ccf9b4df0cfbab4ab643e (diff)
Support clearning context
Diffstat (limited to 'python/cdec/sa/rulefactory.pxi')
-rw-r--r--python/cdec/sa/rulefactory.pxi4
1 files changed, 4 insertions, 0 deletions
diff --git a/python/cdec/sa/rulefactory.pxi b/python/cdec/sa/rulefactory.pxi
index a96b01e7..2be5cad6 100644
--- a/python/cdec/sa/rulefactory.pxi
+++ b/python/cdec/sa/rulefactory.pxi
@@ -2181,6 +2181,10 @@ cdef class HieroCachingRuleFactory:
extract(f_i, f_i, f_len, -1, 0, 0, [])
return phrases
+
+ # Drop online stats for a context
+ def drop_ctx(self, ctx_name=None):
+ self.online_stats.pop(ctx_name, None)
# Spans are _inclusive_ on both ends [i, j]
def span_check(vec, i, j):