source: trunk/gsdl/perllib/Kea-1.1.4/kea-tidy-key-file.pl@ 1972

Last change on this file since 1972 was 1972, checked in by jmt14, 23 years ago

* empty log message *

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.4 KB
Line 
1#!/usr/bin/perl -w
2
3# kea-tidy-key-file.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.1 First Distribution. GPL added.
28
29# kea-tidy-key-file.pl reads a list of keyphrases (one per line
30# from STDIN) and tidies them up and writes them to STDOUT.
31# Intended for use with .key and .kea files.
32
33while (<>) {
34
35 # delete apostrophy
36 s/\'//g;
37 # remove non-alphanumeric characters
38 s/[^A-Za-z0-9\. ]/ /g;
39 # squash and trim whitespace
40 s/^\s+//g;
41 s/\s+$//g;
42 s/\s+/ /g;
43 if ($_ ne "") {
44 print lc($_), "\n";
45 }
46}
Note: See TracBrowser for help on using the repository browser.