Hello!

To see the file structure, click on "tree".

Note that updates take place every 10 minutes, commits may not be seen immediately.
Fix split on tab
authorelserj <elserj@localhost>
Tue, 16 Dec 2014 23:34:40 +0000 (23:34 +0000)
committerelserj <elserj@localhost>
Tue, 16 Dec 2014 23:34:40 +0000 (23:34 +0000)
svn path=/; revision=594

interactome_scripts/po_insert_translations.pl

index 4c542e4ffa02306fa63593614d18145eb37446e3..818e4d5cfdd8a413c8dbf9051d8b2923c3220e98 100755 (executable)
@@ -20,6 +20,9 @@ if($lang eq "SP") {
        $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;
@@ -28,7 +31,10 @@ open(language_File,"$trans_file");
 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";
@@ -128,11 +134,11 @@ while(<in_File>) {
 
        # 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";
                        }
                }
        }