The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Alternative.pm - alternative spelling of a given word in a given language

SYNOPSIS

  use Lingua::Spelling:Alternative;

  my $en = new Alternative;
  $en->load_affix('/usr/lib/ispell/english.aff') or die $!;
  print $en->alternatives("cars");

DESCRIPTION

This module is designed to return all valid forms of a given word (for example when you want to see all possible forms of some word entered in search engine)

PUBLIC METHODS

new

The new() constructor (without parameters) create container for new language. Only parametar it supports is DEBUG which turns on (some) debugging output.

load_affix

Function load_affix() loads ispell's affix file for later usage.

load_findaffix

This function loads output of findaffix program from ispell package. This is better idea (if you are creating affix file for particular language yourself or you can get your hands on one) because affix file from ispel is limited to 26 entries (because each entry is denoted by single character).

alternatives

Function alternatives return all alternative spellings of particular word(s). It will also return spelling which are not correct if there is rule like that in affix file.

minimal

This function returns minimal of all alternatives of a given word(s). It's a poor man's version of normalize (because we don't know gramatic of particular language, just some spelling rules).

PRIVATE METHODS

Documented as being not documented.

EXAMPLES

Please see the test.pl program in distribution which exercises some aspects of Alternative.pm.

BUGS

There are no known bugs.

CONTACT AND COPYRIGHT

Copyright 2002 Dobrica Pavlinusic (dpavlin@rot13.org). All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 226:

You forgot a '=back' before '=head1'