summaryrefslogtreecommitdiff
path: root/python/pkg
diff options
context:
space:
mode:
authorPaul Baltescu <pauldb89@gmail.com>2013-03-07 14:38:23 +0000
committerPaul Baltescu <pauldb89@gmail.com>2013-03-07 14:39:05 +0000
commitd7271db305bd1aeaf9c3d9ac1043546fec22a402 (patch)
treea2f1021577dd1846e5fa583d4859ee6ecb702299 /python/pkg
parent6b5039cd1c167be93ecdbb2fa1721e91fe8f689a (diff)
Added unit test for loose phrases.
Diffstat (limited to 'python/pkg')
-rw-r--r--python/pkg/cdec/sa/features.py4
1 files changed, 2 insertions, 2 deletions
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