34 |
my @spellings; |
my @spellings; |
35 |
# FIX: doesn't work very well |
# FIX: doesn't work very well |
36 |
if ($config->{findaffix}) { |
if ($config->{findaffix}) { |
37 |
my $spelling_alt = new Lingua::Spelling::Alternative; |
foreach my $findaffix (split(/[, ]+/,x($config->{findaffix}))) { |
38 |
$spelling_alt->load_findaffix(x($config->{findaffix})); |
my $spelling_alt = new Lingua::Spelling::Alternative; |
39 |
push @spellings,$spelling_alt; |
$spelling_alt->load_findaffix($findaffix); |
40 |
|
push @spellings,$spelling_alt; |
41 |
|
} |
42 |
} |
} |
43 |
if ($config->{affix}) { |
if ($config->{affix}) { |
44 |
my $spelling_alt = new Lingua::Spelling::Alternative; |
foreach my $affix (split(/[, ]+/,x($config->{affix}))) { |
45 |
$spelling_alt->load_affix(x($config->{affix})); |
my $spelling_alt = new Lingua::Spelling::Alternative; |
46 |
push @spellings,$spelling_alt; |
$spelling_alt->load_affix($affix); |
47 |
|
push @spellings,$spelling_alt; |
48 |
|
} |
49 |
} |
} |
50 |
|
|
51 |
my $hits=0; |
my $hits=0; |
100 |
$search =~ s/^\s+//; |
$search =~ s/^\s+//; |
101 |
$search =~ s/\s+$//; |
$search =~ s/\s+$//; |
102 |
|
|
103 |
|
my %words; |
104 |
|
|
105 |
foreach (split(/\s+/,$search)) { |
foreach (split(/\s+/,$search)) { |
106 |
if (m/^([+-])(\S+)/) { |
if (m/^([+-])(\S+)/) { |
107 |
$s.= ($s) ? "and " : ""; |
$s.= ($s) ? "and " : ""; |
152 |
$hit_fmt = x($config->{hit}) if (x($config->{hit})); |
$hit_fmt = x($config->{hit}) if (x($config->{hit})); |
153 |
} |
} |
154 |
|
|
155 |
|
sub kill_html { |
156 |
|
my @out; |
157 |
|
foreach (@_) { |
158 |
|
s/<[^>]+>//g; |
159 |
|
push @out,$_; |
160 |
|
} |
161 |
|
return @out; |
162 |
|
} |
163 |
|
|
164 |
my $sh = SWISH->connect('Fork', |
my $sh = SWISH->connect('Fork', |
165 |
prog => x($config->{prog}), |
prog => x($config->{prog}), |
166 |
indexes => x($config->{index}), |
indexes => x($config->{index}), |