/[Semantic-Engine]/EPrints/EPrints.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 /EPrints/EPrints.pm

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

revision 4 by dpavlin, Fri Jun 29 09:52:53 2007 UTC revision 6 by dpavlin, Fri Jun 29 14:52:31 2007 UTC
# Line 41  sub lookup { Line 41  sub lookup {
41          my $sql = qq{          my $sql = qq{
42          SELECT $field          SELECT $field
43          FROM archive_$field          FROM archive_$field
44          WHERE eprintid = $id          WHERE eprintid = $id and lang = 'hr'
45          };          };
46          warn "# sql: $sql\n" if $debug;          warn "# sql: $sql\n" if $debug;
47          my @results = map { _x( $_->{$field} ) } @{ $dbh->selectall_arrayref($sql, { Slice => {} }) };          my @results = map { _x( $_->{$field} ) } @{ $dbh->selectall_arrayref($sql, { Slice => {} }) };
# Line 60  sub _x { Line 60  sub _x {
60    
61  sub slogovi {  sub slogovi {
62          my $text = shift;          my $text = shift;
63          my @s;  
64            my $count = 2;
65            my $out = '';
66    
67          foreach my $w ( split(/\W*\s+\W*/, $text ) ) {          foreach my $w ( split(/\W*\s+\W*/, $text ) ) {
68                  my $pos = 0;                  warn "w: $w\n" if $debug;
69                    my @s;
70                  while ( $w =~ s/^([^aeiou]*[aeiou])//i ) {                  while ( $w =~ s/^([^aeiou]*[aeiou])//i ) {
71                          push @s, $pos++ . $1;                          push @s, $1;
72                  }                  }
73                  push @s, $pos . $w if $w;                  push @s, $w if $w;
74                  warn "slogovi = ", dump( @s ), $/ if $debug;                  warn "slogovi = ", dump( @s ), $/ if $debug;
75                    foreach my $p ( 0 .. ( $#s - $count + 1 )  ) {
76                            map { $out .= $s[ $p + $_ ] } 0 .. $count - 1;
77                            $out .= ' ';
78                    }
79          }          }
80          return @s;          warn "$out\n" if $debug;
81            return $out;
82  }  }
83    
84  1;  1;

Legend:
Removed from v.4  
changed lines
  Added in v.6

  ViewVC Help
Powered by ViewVC 1.1.26