--- EPrints/EPrints.pm 2007/06/29 09:52:53 4 +++ EPrints/EPrints.pm 2007/06/29 14:52:31 6 @@ -41,7 +41,7 @@ my $sql = qq{ SELECT $field FROM archive_$field - WHERE eprintid = $id + WHERE eprintid = $id and lang = 'hr' }; warn "# sql: $sql\n" if $debug; my @results = map { _x( $_->{$field} ) } @{ $dbh->selectall_arrayref($sql, { Slice => {} }) }; @@ -60,16 +60,25 @@ sub slogovi { my $text = shift; - my @s; + + my $count = 2; + my $out = ''; + foreach my $w ( split(/\W*\s+\W*/, $text ) ) { - my $pos = 0; + warn "w: $w\n" if $debug; + my @s; while ( $w =~ s/^([^aeiou]*[aeiou])//i ) { - push @s, $pos++ . $1; + push @s, $1; } - push @s, $pos . $w if $w; + push @s, $w if $w; warn "slogovi = ", dump( @s ), $/ if $debug; + foreach my $p ( 0 .. ( $#s - $count + 1 ) ) { + map { $out .= $s[ $p + $_ ] } 0 .. $count - 1; + $out .= ' '; + } } - return @s; + warn "$out\n" if $debug; + return $out; } 1;