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

NAME

Text::Unmunch find all endings of a word for hunspell

SYNOPSIS

  use Text::Unmunch;
 
  my $unmunch = Text::Unmunch->new{
                       aff => "en_US.aff",
                       wf => "iren.dic", 
                       sfx => "-s",
                       pfx => "-p",
                       debug    => "-d=2"
                     });
  $unmunch->get_endings();

DESCRIPTION

Lists all endings of a word, that hunspell will generate. The listed words here will be accepted as good words by hunspell. The arguments for Text::Unmunch are:

aff file, this must be an UTF-8 coded affix file. You can use recode for this, like this: cat hu_HU.aff | recode l2..u8 > output.aff or: cat en_US.aff | recode l1..u8 >output.aff
word file, this is also an utf-8 coded file, containing the words to be checked, with all flags, as it appears in the .dic file for hunspell.
Example word file:
sfx, if it exists, its form is -s. It means, that you wish to see the suffixes in the result (not only the prefix results)
pfx, if it exists, its form is -p. It means, that you wish to see the prefixes in the result (not only the suffix results)

If both sfx and pfx are missing, both will be displayed.

debug, if exists, its form is -d=n, where n is a number between 0 and 9. The higher the value, the more debug lines will be displayed.

Only the aff file and the word file are required parameters.

METHODS

Constructor

my obj = Text::Unmunch->new( ARGS)

Method

$obj->get_endings()

This function reads the aff and the word file, finds the possible word endings for the words in the word file, and prints the result onto the screen.

DETAILS

BUGS

Text::Unmunch does not handle two level affixing. If a result word has switches, these will not automatically be searched and shown. If you are interested, what they do, you must edit a word file for that and let you show in a second step, what hunspell generates. Two level affixing is included as far as I know, only in the Hungarian affix file.

SEE ALSO

This module is useful, when you work with hunspell, and want an easy way to find, what endings do switches generate. There are some programs in the hunspell distribution to find the endings, unfortunately none of them works properly. Therefore this program.

External references

Hunspell source code: https://sourceforge.net/projects/hunspell/files/Hunspell/1.3.3/hunspell-1.3.3.tar.gz/download?use_mirror=kumisystems
Hunspell issues: https://github.com/hunspell/hunspell/issues
Magyarispell issues: https://github.com/laszlonemeth/magyarispell/

AUTHORS

Developer: Eleonora, email <eleonora46@gmx.net>

LICENSE

Copyrights 2020 Eleonora, email <eleonora46@gmx.net>

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html