summaryrefslogtreecommitdiff
path: root/gi/pyp-topics
diff options
context:
space:
mode:
authorphilblunsom@gmail.com <philblunsom@gmail.com@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-06-29 19:58:03 +0000
committerphilblunsom@gmail.com <philblunsom@gmail.com@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-06-29 19:58:03 +0000
commit6dc4c9ee176b565280b6e6c51a909fea5d1d5ca6 (patch)
tree94345920d11b481292eb457fd3f3e283f0b94608 /gi/pyp-topics
parentdbcfd26ea57561091681f9b048cf1cda2f3a6d12 (diff)
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@68 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'gi/pyp-topics')
-rwxr-xr-xgi/pyp-topics/scripts/spans2labels.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/gi/pyp-topics/scripts/spans2labels.py b/gi/pyp-topics/scripts/spans2labels.py
index 7cbc521c..402bcd63 100755
--- a/gi/pyp-topics/scripts/spans2labels.py
+++ b/gi/pyp-topics/scripts/spans2labels.py
@@ -40,6 +40,6 @@ for line in sys.stdin:
right_context = reduce(lambda x, y: x+y+" ", target[t2:t2+order], "").strip()
context = "%s<PHRASE> %s" % (left_context, right_context)
- label = phrase_context_index[(phrase,context)]
+ label = phrase_context_index.get((phrase,context, "<UNK>")
print "%s-%s:X%s" % (t1-order,t2-order,label),
print