summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel M German <dmg@uvic.ca>2015-01-10 02:27:55 -0800
committerDaniel M German <dmg@uvic.ca>2015-01-10 02:27:55 -0800
commit9262f0100f567548a67e2c5fbdb36ef5c59002ba (patch)
tree0cc86fb3a16b7bfb3a2ff0f11b71dc38421ad8eb
parentf548eaf81b402994622ac6488a5868f2727bc065 (diff)
downloadninka-9262f0100f567548a67e2c5fbdb36ef5c59002ba.tar.gz
added support for excel and sqlite. bumped version to 1.3 RC1
-rw-r--r--ChangeLog10
-rw-r--r--README.TXT27
-rwxr-xr-x[-rw-r--r--]ninka-excel.pl6
-rwxr-xr-x[-rw-r--r--]ninka-sqlite.pl22
-rwxr-xr-xninka.pl20
5 files changed, 61 insertions, 24 deletions
diff --git a/ChangeLog b/ChangeLog
index 67b9191..f04ac65 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2015-01-10 dmg <dmg@uvic.ca>
+
+ * Bumped to version 1.3 RC 1
+
+ * ninka-sqlite.pl, ninka-excel.pl: prepared them for release
+
+ * ninka.pl: fixed bug in finding the path of where ninka was being executed from (reported by Ryan Biesemeyer)
+
+ * Fixed quotes in perl (René bScheibe)
+
2015-01-05 dmg <dmg@uvic.ca>
* filter/criticalword.dict: MIT+no-false-attribs license missing one sentence
diff --git a/README.TXT b/README.TXT
index 565465c..6dc14d9 100644
--- a/README.TXT
+++ b/README.TXT
@@ -1,4 +1,6 @@
-* Contact information.
+-*-org-*-
+
+* Contact information.
Any feedback will be appreciated. You can email us at Daniel M. German
<dmg@uvic.ca> and Yuki Manabe <y-manabe@ist.osaka-u.ac.jp>
@@ -25,11 +27,16 @@ http://turingmachine.org/~dmg/papers/dmg2010ninka.pdf
If you use Ninka for research purposes, we would appreciate you cite
the above paper.
+* Contributors
+
+- Anthony Kohan for writing the excel and sqlite backends.
+- Armijn Hemel from Tjaldur Software Governance Solutions for multiple bug reports and suggestions
+
* License
-
+
Except for the directories comments and splitter, Ninka is licensed
under the GPLv2+
-
+
Copyright (C) 2009-2010 Yuki Manabe and Daniel M. German
This program is free software: you can redistribute it and/or modify
@@ -69,7 +76,7 @@ Perl version 5
Ninka uses a pipe model (see below). Each step of the "pipe" creates a
file, but
-ninka.pl [options] [filename]
+ninka.pl [options] [filename]
Available options
-v verbose
@@ -107,26 +114,26 @@ It will create five files:
- Licenses
- Unmatched sentences in *.senttok that were not matched
-
+
* Ninka model
Ninka uses a pipe-model. Each stage of the pipe does something very specific:
- 1. Comment extractor.
+ 1. Comment extractor.
- directory: extComments
- command: extComments.pl, might use comments (included in distribution)
-
+
- Purpose: Extracts top comments of source code. If no
comment extractor is known for the language, then extracts top lines from source (currently 700)
- Creates <filename>.comments file
2. Split sentences in comments
-
+
- directory: splitter
- command: splitter.pl
@@ -151,7 +158,7 @@ Ninka uses a pipe-model. Each stage of the pipe does something very specific:
4. Tokenizes sentences
- Directory senttok
-
+
- command: senttok.pl
- Purpose: It creates a file that corresponds to the recognized
@@ -168,7 +175,7 @@ Ninka uses a pipe-model. Each stage of the pipe does something very specific:
- Purpose: looks at the sequence of sentence tokens and outputs the licenses found
- Output: <filename>.license
-
+
The script ninka.pl takes care of all these steps, and optionally removes
intermediary files, and writes to the stdout the licenses found.
diff --git a/ninka-excel.pl b/ninka-excel.pl
index c06c830..71adddf 100644..100755
--- a/ninka-excel.pl
+++ b/ninka-excel.pl
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#
-# Copyright (C) 2014 Anthony Kohan and Daniel M. German
+# Copyright (C) 2014,2015 Anthony Kohan and Daniel M. German
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -27,8 +27,10 @@ use Spreadsheet::WriteExcel;
if(scalar(@ARGV) != 2){
+ print STDERR "Ninka 1.3. sqlite wrapper\n";
+ print STDERR "Processes package file (.tar.gz, zip, jar. etc) and outputs to excel file\n";
print STDERR "Incorrect number of arguments\n";
- print STDERR "Correct usage is: perl ninka-wrapper <path to package file> <database name>\n";
+ print STDERR "Correct usage is: $0 <path to package file> <excel-file>\n";
exit 1;
}
diff --git a/ninka-sqlite.pl b/ninka-sqlite.pl
index 49b7576..65d746a 100644..100755
--- a/ninka-sqlite.pl
+++ b/ninka-sqlite.pl
@@ -1,4 +1,20 @@
#!/usr/bin/perl
+#
+# Copyright (C) 2014,2015 Anthony Kohan and Daniel M. German
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
use strict;
use Switch;
@@ -8,9 +24,13 @@ use File::Find;
use File::Basename;
use Scalar::Util qw(looks_like_number);
+
+
if(scalar(@ARGV) != 2){
+ print STDERR "Ninka 1.3. sqlite wrapper\n";
+ print STDERR "Processes package file (.tar.gz, zip, jar. etc) and outputs to sqlite file\n";
print STDERR "Incorrect number of arguments\n";
- print STDERR "Correct usage is: perl ninka-wrapper <path to package file> <database name>\n";
+ print STDERR "Correct usage is: $0 <path to package file> <database name>\n";
exit 1;
}
diff --git a/ninka.pl b/ninka.pl
index b2fcd9a..3987a41 100755
--- a/ninka.pl
+++ b/ninka.pl
@@ -18,10 +18,11 @@
use strict;
use Getopt::Std;
+use File::Basename;
my %opts = ();
if (!getopts ("vfCcSsGgTtLd",\%opts) or scalar(@ARGV) == 0) {
-print STDERR "Ninka version 1.2
+print STDERR "Ninka version 1.3
Usage $0 -fCtTvcgsGd <filename>
@@ -42,7 +43,7 @@ Usage $0 -fCtTvcgsGd <filename>
-L force creation of matching
- -d delete intermediate files
+ -d delete intermediate files
\n";
@@ -55,14 +56,12 @@ my $verbose = exists $opts{v};
my $delete = exists $opts{d};
#$delete = 1;
-my $path = $0;
+my $path = dirname($0);
-$path =~ s/\/+[^\/]+$//;
if ($path eq "") {
$path = "./";
}
-
my $force = exists $opts{f};
my $forceGood = exists $opts{G};
my $forceSentences = exists $opts{S};
@@ -97,23 +96,23 @@ if (not (-f $original)) {
}
-Do_File_Process($original, $commentsFile, ($force or $forceComments),
+Do_File_Process($original, $commentsFile, ($force or $forceComments),
"$path/extComments/extComments.pl -c1 ${f}",
"Creating comments file",
exists $opts{c});
-Do_File_Process($commentsFile, $sentencesFile, ($force or $forceSentences),
+Do_File_Process($commentsFile, $sentencesFile, ($force or $forceSentences),
"$path/splitter/splitter.pl ${commentsFile}",
"Splitting sentences", exists $opts{s}
);
-Do_File_Process( $sentencesFile, $goodsentFile, ($force or $forceGood),
+Do_File_Process( $sentencesFile, $goodsentFile, ($force or $forceGood),
"$path/filter/filter.pl ${sentencesFile}",
"Filtering good sentences", exists $opts{s}
);
-Do_File_Process($goodsentFile, $sentokFile, ($force or $forceSentok),
+Do_File_Process($goodsentFile, $sentokFile, ($force or $forceSentok),
"$path/senttok/senttok.pl ${goodsentFile} > ${sentokFile}",
"Matching sentences against rules", exists $opts{t}
);
@@ -147,7 +146,7 @@ sub Do_File_Process
print "Running ${cmd}:" if ($verbose);
execute($cmd);
} else {
- print "File [$output] newer than input [$input], not creating:" if ($verbose);
+ print "File [$output] newer than input [$input], not creating:" if ($verbose);
}
if ($end) {
print "Existing after $message" if $verbose;
@@ -180,4 +179,3 @@ sub newer
return 1;
}
}
-