9 |
use Data::Dump qw/dump/; |
use Data::Dump qw/dump/; |
10 |
use DBI; |
use DBI; |
11 |
use URI::Escape; |
use URI::Escape; |
12 |
|
use Carp qw/confess/; |
13 |
|
|
14 |
|
use lib '/home/dpavlin/stem-hr/'; |
15 |
|
use StemHR; |
16 |
|
|
17 |
use strict; |
use strict; |
18 |
use warnings; |
use warnings; |
112 |
|
|
113 |
sub slogovi { |
sub slogovi { |
114 |
my $self = shift; |
my $self = shift; |
115 |
my $text = shift; |
my $text = shift || confess "no text?"; |
116 |
|
|
117 |
my $count = 2; |
my $count = 3; |
118 |
my $out = ''; |
my $out = ''; |
119 |
|
|
120 |
foreach my $w ( split(/\W*\s+\W*/, $text ) ) { |
foreach my $w ( split(/\W*\s+\W*/, $text ) ) { |
134 |
return $out; |
return $out; |
135 |
} |
} |
136 |
|
|
137 |
|
sub stem { |
138 |
|
my $self = shift; |
139 |
|
my $text = shift || confess "no text?"; |
140 |
|
|
141 |
|
my $body = ''; |
142 |
|
foreach my $w ( split(/\W*\s+\W*/, $text ) ) { |
143 |
|
$body .= StemHR->stem( $w ) . ' '; |
144 |
|
} |
145 |
|
|
146 |
|
return $body; |
147 |
|
} |
148 |
|
|
149 |
1; |
1; |