From d7271db305bd1aeaf9c3d9ac1043546fec22a402 Mon Sep 17 00:00:00 2001 From: Paul Baltescu Date: Thu, 7 Mar 2013 14:38:23 +0000 Subject: Added unit test for loose phrases. --- python/pkg/cdec/sa/features.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'python/pkg/cdec/sa') diff --git a/python/pkg/cdec/sa/features.py b/python/pkg/cdec/sa/features.py index 46412cd5..c8fc1cca 100644 --- a/python/pkg/cdec/sa/features.py +++ b/python/pkg/cdec/sa/features.py @@ -105,7 +105,7 @@ def IsSingletonF(ctx): count = ctx.fcount else: count = ctx.fcount + ctx.online.fcount - return (count == 1) + return math.fabs(count - 1) < 1e-6 def IsSingletonFE(ctx): if not ctx.online: @@ -139,4 +139,4 @@ def IsSupportedOnline(ctx): # Occurs in online data? if ctx.online: return (ctx.online.paircount > 0.01) else: - return False \ No newline at end of file + return False -- cgit v1.2.3