summaryrefslogtreecommitdiff
path: root/sa-extract/sa2cdec.py
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2012-07-27 17:31:00 -0400
committerChris Dyer <cdyer@cs.cmu.edu>2012-07-27 17:31:00 -0400
commitb317e0efd2398d75d70e027bb1e2cf442e683981 (patch)
treeec34aff0ce4e8fb9704d1cd2b7abf00cb9a25b9a /sa-extract/sa2cdec.py
parentb2a8bccb2bd713d9ec081cf3dad0162c2cb492d8 (diff)
remove old suffix array extractor (use the one in python/ instead)
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) )