1 | #!/usr/bin/perl -w
|
---|
2 |
|
---|
3 | # prepare-clauses-all-text-files.pl
|
---|
4 | # Version 1.1
|
---|
5 |
|
---|
6 | # Kea -- Automatic Keyphrase Extraction
|
---|
7 | # Copyright 1998-1999 by Gordon Paynter and Eibe Frank
|
---|
8 | # Contact [email protected] or [email protected]
|
---|
9 | #
|
---|
10 | # This program is free software; you can redistribute it and/or modify
|
---|
11 | # it under the terms of the GNU General Public License as published by
|
---|
12 | # the Free Software Foundation; either version 2 of the License, or
|
---|
13 | # (at your option) any later version.
|
---|
14 | #
|
---|
15 | # This program is distributed in the hope that it will be useful,
|
---|
16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
18 | # GNU General Public License for more details.
|
---|
19 | #
|
---|
20 | # You should have received a copy of the GNU General Public License
|
---|
21 | # along with this program; if not, write to the Free Software
|
---|
22 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
23 |
|
---|
24 | # Version history
|
---|
25 | #
|
---|
26 | # 1.0 Witten et.al.
|
---|
27 | # 1.0.1 Check parameters
|
---|
28 | # 1.0.2 Use "perl -w' to run prepare-clauses.pl
|
---|
29 | # 1.1 First Distribution. GPL added.
|
---|
30 |
|
---|
31 | if (!$ARGV[0]) {
|
---|
32 | die "Usage: prepare-clauses-all-text-files.pl <directory>\n";
|
---|
33 | }
|
---|
34 |
|
---|
35 | $directory = $ARGV[0];
|
---|
36 | $directory =~ s/\/$//;
|
---|
37 |
|
---|
38 | $documents = `find $directory/ -name "*.txt"`;
|
---|
39 | @documents = split(/\s+/, $documents);
|
---|
40 |
|
---|
41 | foreach $in (@documents) {
|
---|
42 | ($out) = $in =~ /(.+).txt/;
|
---|
43 | $out .= ".clauses";
|
---|
44 |
|
---|
45 | `perl -w prepare-clauses.pl $in $out`;
|
---|
46 | }
|
---|
47 |
|
---|