diff options
author | Patrick Simianer <p@simianer.de> | 2014-01-29 19:14:08 +0100 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2014-01-29 19:14:08 +0100 |
commit | 68acbb9a0c7967cb90a7e3756fc94fdd8a73d154 (patch) | |
tree | 3b445131dcb203e94473ae1d8aa82a1798585276 /rule_shapes | |
parent | 49158e721bfaf6423dca9fc633873218f691c83a (diff) |
make use of nlp_ruby, LICENSE
Diffstat (limited to 'rule_shapes')
-rwxr-xr-x | rule_shapes | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/rule_shapes b/rule_shapes index 039b0dc..fd42249 100755 --- a/rule_shapes +++ b/rule_shapes @@ -3,11 +3,12 @@ STDIN.set_encoding 'utf-8' STDOUT.set_encoding 'utf-8' + def shape s res = [] in_t = false s.split.each { |i| - if i.match /\A\[X,\d\]\z/ + if i.match(/\A\[X,\d\]\z/) if in_t in_t = false end @@ -22,7 +23,7 @@ def shape s end while line = STDIN.gets - f,e = line.split "\t" + f, e = line.split(/\t/) f.strip!; e.strip! puts shape(f).join('_')+"-"+shape(e).join('_') end |