/[webpac-proto]/common.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /common.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by dpavlin, Sun Jun 16 15:26:13 2002 UTC revision 1.6 by dpavlin, Mon Jun 24 15:36:40 2002 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl -w  #!/usr/bin/perl
2    
3  #package common;  #package common;
4    
# Line 13  $common::mps_header="V 5 3 Line 13  $common::mps_header="V 5 3
13  L hr-HR  L hr-HR
14  F 700+ 1 Autor  F 700+ 1 Autor
15  F 200+ 2 Naslov  F 200+ 2 Naslov
16  F 210 3 Izdavanje  F 210+ 3 Izdavanje
17  F 225 4 Nakladnička cjelina  F 225 4 Nakladnička cjelina
18  F 300+ 5 Napomene  F 300+ 5 Napomene
19  F 330 6 Sadržaj  F 330 6 Sadržaj
# Line 23  F 675 9 UDK Line 23  F 675 9 UDK
23  F 686 10 CC  F 686 10 CC
24  F 990 11 Signatura  F 990 11 Signatura
25  F 991 12 Inventarni broj  F 991 12 Inventarni broj
26  F 10 13 ISBN  F ISBN 13 ISBN
27    F MFN 14 MFN
28    F 215+ 15 Materijalni opis
29  ";  ";
30    
31    $common::database_cf="/local/search/databases.cf";
32    
33  #--------------------------------------------------------------------  #--------------------------------------------------------------------
34  #  #
# Line 37  sub mps_expand { Line 40  sub mps_expand {
40          my $out = "";          my $out = "";
41          while (my $fld = shift @_) {          while (my $fld = shift @_) {
42                  if ($fld =~ s/\s*[,;\.!?'"<>\[\]]*\s+/ /g) {                  if ($fld =~ s/\s*[,;\.!?'"<>\[\]]*\s+/ /g) {
43                            $fld =~ s/></ /g;
44                          foreach my $w (split(/\s+/,$fld)) {                          foreach my $w (split(/\s+/,$fld)) {
45                                  # FIX: this should be replaced by stemmer!                                  # FIX: this should be replaced by stemmer!
46                                  $out .= "W $w $nr\n";                                  # remove chars from beginning of word
47                                    $w =~ s/^['"<(\[]//g;
48                                    # remove chars from end of word
49                                    $w =~ s/[,;\.!?'">)\]]$//g;
50                                    # preglasi öÖäÄüÜ -> ”™„Žš
51                                    if ($w =~ m/[”™„Žš]/) {
52                                            $out .= "W $w $nr\n";
53                                            $w =~ s/[”™]/oe/g;
54                                            $w =~ s/[„Ž]/ae/g;
55                                            $w =~ s/[š]/ue/g;
56                                            $out .= "W $w $nr\n";
57                                    } else {
58                                            $out .= "W $w $nr\n";
59                                    }
60                          }                          }
61                  } else {                  } else {
62                          $out .= "W $fld $nr\n";                          $out .= "W $fld $nr\n";

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.26