/[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 3 by dpavlin, Fri Jun 29 09:21:11 2007 UTC revision 4 by dpavlin, Fri Jun 29 09:52:53 2007 UTC
# Line 3  Line 3 
3  package EPrints;  package EPrints;
4    
5  use Exporter 'import';  use Exporter 'import';
6  @EXPORT_OK = qw(_x);  @EXPORT_OK = qw(_x slogovi);
7    
8  use Encode qw/from_to decode_utf8 decode/;  use Encode qw/from_to decode_utf8 decode/;
9  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
# Line 58  sub _x { Line 58  sub _x {
58          return "$v ";          return "$v ";
59  }  }
60    
61    sub slogovi {
62            my $text = shift;
63            my @s;
64            foreach my $w ( split(/\W*\s+\W*/, $text ) ) {
65                    my $pos = 0;
66                    while ( $w =~ s/^([^aeiou]*[aeiou])//i ) {
67                            push @s, $pos++ . $1;
68                    }
69                    push @s, $pos . $w if $w;
70                    warn "slogovi = ", dump( @s ), $/ if $debug;
71            }
72            return @s;
73    }
74    
75  1;  1;

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

  ViewVC Help
Powered by ViewVC 1.1.26