$line_end = "(Spanish)\" EXACT Spanish [POC:Maria_Alejandra_Gandolfo]";
}elsif($lang eq "JP") {
$line_end = "(Japanese)\" EXACT Japanese [NIG:Yukiko_Yamazaki]";
+}else{
+ print "Please choose either SP (for Spanish) or JP (for Japanese)";
+ exit;
}
my %lang_hash;
while(<language_File>) {
my $line = $_;
chomp $line;
- my ($term, $name, $translation, $defn) = split("\t", $line);
+ my ($term, $name, $translation, $defn) = split(/\t/, $line);
+ if ($translation eq "") {
+ next;
+ }
$translation =~ s/\"//g;
if(defined($lang_hash{$term})) {
$lang_hash{$term} = "$lang_hash{$term}\t$translation";
# put in section to deal with Japanese chars.
# Japanese characters are utf-8, and should come after the ascii chars of spanish
- if ($line_prev =~ m/^synonym:/ && $count_after) {
+ if ($line_prev =~ m/^synonym:/ && $count_after && $lang eq "JP") {
if(defined($lang_hash{$po_id})) {
foreach my $new_synonym(split("\t",$lang_hash{$po_id})) {
my $new_synonym_line = "synonym: \"$new_synonym $line_end";
- print output_File "$new_synonym_line\n";
+ print output_File "$new_synonym_line\n";
}
}
}