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
commit17497f2e77e63e6aa549eedc279cac46cfd25e2b (patch)
tree7af2be235d5b475c5d0a6a95638d5fa6ef270659 /python/cdec/sa/rulefactory.pxi
parente5a044b73f263d4be31b3ff87c8f14005f2e8562 (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):