source: trunk/gsdl/src/phind/generate/symbol-names.pl@ 1562

Last change on this file since 1562 was 1562, checked in by paynter, 24 years ago

Phind phrase browser - code for generating the phrase indexes

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.5 KB
Line 
1#! /usr/bin/perl -w
2
3###########################################################################
4#
5# symbol-names.pl -- Diagnostic tool that substitutes symbols names for
6# symbol numbers in the output of the suffix program.
7#
8# Copyright (C) 2000 Gordon Paynter
9#
10# A component of the Greenstone digital library software
11# from the New Zealand Digital Library Project at the
12# University of Waikato, New Zealand.
13#
14# This program is free software; you can redistribute it and/or modify
15# it under the terms of the GNU General Public License as published by
16# the Free Software Foundation; either version 2 of the License, or
17# (at your option) any later version.
18#
19# This program is distributed in the hope that it will be useful,
20# but WITHOUT ANY WARRANTY; without even the implied warranty of
21# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22# GNU General Public License for more details.
23#
24# You should have received a copy of the GNU General Public License
25# along with this program; if not, write to the Free Software
26# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27#
28###########################################################################
29
30$collection = shift(@ARGV);;
31die "Usage: symbol-names.pl collection [file]\n" unless ($collection);
32
33$vocab = $ENV{'GSDLHOME'} . "/collect/$collection/phindex/clauses.vocab";
34die "Usage: symbol-names.pl collection [file]\n" unless (-e "$vocab");
35
36open(V, "<$vocab");
37my $n = 1;
38
39while(<V>) {
40 chomp;
41 $symbol[$n++] = $_;
42}
43
44while(<>) {
45 s/s(\d+)/$symbol[$1]/g;
46 print;
47}
48
Note: See TracBrowser for help on using the repository browser.