[LON-CAPA-cvs] cvs: loncom /localize/localize checksimilar_2files.pl
bisitz
bisitz at source.lon-capa.org
Mon Jan 7 10:13:26 EST 2013
bisitz Mon Jan 7 15:13:26 2013 EDT
Modified files:
/loncom/localize/localize checksimilar_2files.pl
Log:
- Corrected counter
- Default output to STDOUT instead of file as done in other check and sync scripts
- Added message at begin of check
- Improved indentation of old key to allow better manual phrase comparison
Index: loncom/localize/localize/checksimilar_2files.pl
diff -u loncom/localize/localize/checksimilar_2files.pl:1.2 loncom/localize/localize/checksimilar_2files.pl:1.3
--- loncom/localize/localize/checksimilar_2files.pl:1.2 Tue Aug 3 13:00:21 2010
+++ loncom/localize/localize/checksimilar_2files.pl Mon Jan 7 15:13:26 2013
@@ -1,6 +1,6 @@
#!/usr/bin/perl
# The LearningOnline Network with CAPA
-# $Id: checksimilar_2files.pl,v 1.2 2010/08/03 13:00:21 bisitz Exp $
+# $Id: checksimilar_2files.pl,v 1.3 2013/01/07 15:13:26 bisitz Exp $
use strict;
use warnings;
@@ -70,12 +70,13 @@
my $file1 = $ARGV[0]; # Old language.pm
my $file2 = $ARGV[1]; # New Phrases
+
+print("Checking for similar expressions in phrases in $file1 and $file2...\n");
+
my %langOLD = &read($file1); #Hash with old phrases
my %langNEW = &read($file2); #Hash with new phrases
my $dlm;
-my $count = 1; #Counter
-
-open(OUT,'>similarities.txt') or die;
+my $count = 0;
# For each new phrase, check if there is already a similar one
while( my ($kNEW, $vNEW) = each %langNEW ) {
@@ -98,8 +99,8 @@
} else {
$dlm = "'";
}
- print OUT (<<ENDNEW);
-#Old key: $kOLD
+ print (<<ENDNEW);
+# $kOLD #(Old key)
$dlm$kNEW$dlm
=> $dlm$vOLD$dlm,
More information about the LON-CAPA-cvs
mailing list