summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordmg <dmg@uvic.ca>2013-07-02 08:58:57 -0400
committerdmg <dmg@uvic.ca>2013-07-02 08:58:57 -0400
commit626587a3a0d1cbe9c23ab33cbdcd635a86444bb2 (patch)
tree7316e18b1543b2e46091a2865819ef870dc8f1bc
parentfd9bd05d191b3baa16c074197913c9ef0a9478b8 (diff)
downloadninka-626587a3a0d1cbe9c23ab33cbdcd635a86444bb2.tar.gz
* matcher/matcher.pl: Added GPL2orOpenIB to the rules. Allowed
spaces in the defintion of the rules
-rw-r--r--ChangeLog5
-rwxr-xr-xmatcher/matcher.pl8
-rw-r--r--matcher/rules.dict3
3 files changed, 13 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 6b2c2f5..a783a0b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-07-02 dmg <dmg@uvic.ca>
+
+ * matcher/matcher.pl: Added GPL2orOpenIB to the rules. Allowed
+ spaces in the defintion of the rules
+
2013-07-01 dmg <dmg@uvic.ca>
* filter/criticalword.dict: tighten some definitions to avoid
diff --git a/matcher/matcher.pl b/matcher/matcher.pl
index 7168c11..ca99274 100755
--- a/matcher/matcher.pl
+++ b/matcher/matcher.pl
@@ -102,7 +102,7 @@ if ($path eq "") {
my $rules= $path . "rules.dict";
my $interrules= $path . "interrules.dict";
-die "Usage $0 <filename>.sentences" unless $ARGV[0] =~ /\.senttok$/;
+die "Usage $0 <filename>.senttok" unless $ARGV[0] =~ /\.senttok$/;
# read rules
@@ -222,6 +222,11 @@ sub Read_Rules
my @rules = ();
while ($sentence=<RULES>){
chomp $sentence;
+ # clean up spaces
+ $sentence=~ s/^\s+//;
+ $sentence=~ s/\s+$//;
+ $sentence=~ s/\s*,\s*/,/g;
+ $sentence=~ s/\s*:\s*/:/g;
#check format
if ($sentence =~ /^#/ || $sentence !~ /(.*):(.*,)*(.*)/){
next;
@@ -291,6 +296,7 @@ sub Match_License
my $rulename=$rulelist[$j][0];
my $lenRule = scalar(split(',', $rule));
# replace rule with the length of the rule
+ print "To try [$rulename][$rule] on [$senttok]\n" if $debug;
while ($senttok =~ s/,${rule},/,$lenRule,/){
$countMatches ++;
push (@result,$rulename);
diff --git a/matcher/rules.dict b/matcher/rules.dict
index 5559cc5..838d71b 100644
--- a/matcher/rules.dict
+++ b/matcher/rules.dict
@@ -73,8 +73,7 @@ LGPLv2MISTAKE:LGPLv2MISTAKE
GPLv1orArtistic:GPLv1orArtistic
-
-
+GPL2orOpenIB: GPLorOpenBSDTypeVer2,BSDpre,BSDcondSource,BSDcondBinary,X11asIs,X11asLiable
CDDLv1orGPLv2:CDDLorGPLv2,CDDLorGPLv2compliance,CDDLorGPLv2where,ApachesPermLim,CDDLorGPLv2include