summaryrefslogtreecommitdiff
path: root/sa-extract/sa2cdec.py
diff options
context:
space:
mode:
authorPatrick Simianer <simianer@cl.uni-heidelberg.de>2012-08-01 17:32:37 +0200
committerPatrick Simianer <simianer@cl.uni-heidelberg.de>2012-08-01 17:32:37 +0200
commiteb3ea4fd5dff1c94b237af792c9f7bf421d79d96 (patch)
tree2acd7674f36e6dc6e815c5856519fdea1a2d6bf8 /sa-extract/sa2cdec.py
parente816274e337a066df1b1e86ef00136a021a17caf (diff)
parent193d137056c3c4f73d66f8db84691d63307de894 (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'sa-extract/sa2cdec.py')
-rwxr-xr-xsa-extract/sa2cdec.py19
1 files changed, 0 insertions, 19 deletions
diff --git a/sa-extract/sa2cdec.py b/sa-extract/sa2cdec.py
deleted file mode 100755
index 55fb19f3..00000000
--- a/sa-extract/sa2cdec.py
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env python
-import sys
-
-featNames = [ line.strip() for line in open(sys.argv[1]) if not line.startswith('#') ]
-
-for line in sys.stdin:
- try:
- (lhs, src, tgt, feats, align) = line.strip("\n").split(' ||| ')
- except:
- print >>sys.stderr, 'WARNING: No alignments:', line
- try:
- (lhs, src, tgt, feats) = line.strip().split(' ||| ')
- align = ''
- except:
- print >>sys.stderr, "ERROR: Malformed line:", line
- raise
- featValues = feats.split(' ')
- namedFeats = ' '.join( name+"="+value for (name, value) in zip(featNames, featValues) )
- print " ||| ".join( (lhs, src, tgt, namedFeats, align) )