Skip to content

Commit

Permalink
Removed obsolete code, added version number, added Mac compatible whi…
Browse files Browse the repository at this point in the history
…te space trimming to lexicon file to match May 2014 changes.
  • Loading branch information
amir-zeldes committed Dec 12, 2014
1 parent 67f2675 commit 949b448
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions _enrich.pl
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
my $usage;
{
$usage = <<"_USAGE_";
This script enriches lines based on the first tab-delimited column of that line with values from a lexicon file in a new column of the output file.
_enrich.pl version 1.0
This script enriches lines based on the first tab-delimited column of that line with values from a lexicon file in a new column of the output file.
Optional arguments are currently only outputting the help message.
Usage: t_enrich.pl [optional args] -l <LEXICON> <IN_FILE>
Usage: _enrich.pl [optional args] -l <LEXICON> <IN_FILE>
Options and arguments:
Expand Down Expand Up @@ -38,11 +40,9 @@
}
if (!($lexicon = $opts{l}))
{$lexicon = "lexicon.txt";}
#if ($opts{n}) {$noword = 1;} else {$noword = 0;}

### OPTIONS END ###

#$corp_file = "YA421-428_CTS_norm_tagged.txt";

open(FLH,"$lexicon");
@array = <FLH>;
Expand All @@ -59,16 +59,12 @@
{
$entry = decode_utf8($1);
$trans = $2;
#print "AAAAA" . $trans . "CCCC" . "\n";
$lex{decode_utf8($entry)} .= $trans;

$trans =~ s/^[ \t]+//g;
$trans =~ s/[ \t]+$//g;
}

}
#while ( ($key, $value) = each %lex )
#{
# $lex{$key} = substr($lex{$key},0,length($lex{$key})-2);
#}


while($ar = <>)
Expand Down

0 comments on commit 949b448

Please sign in to comment.