NAME

Lingua::Jspell - Perl interface to the Jspell morphological analyser.

SYNOPSIS

use Lingua::Jspell;

my $dict = Lingua::Jspell->new( "dict_name");
my $dict = Lingua::Jspell->new( "dict_name" , "personal_dict_name");

$dict->rad("gatinho");      # list of radicals (gato)

$dict->fea("gatinho");      # list of possible analysis

$dict->der("gato");         # list of derivated words

$dict->flags("gato");       # list of roots and flags

FUNCTIONS

new

Use to open a dictionary. Pass it the dictionary name and optionally a personal dictionary name. A new jspell dictionary object will be returned.

setmode

$dict->setmode({flags => 0, nm => "off" });
af

Enable near misses, don't use rules where they are not applied, do not give suggestions by swapping adjacent letters on the original word.

full

Enable near misses, try to use rules where they are not applied, try to give suggestions by swapping adjacent letters on the original word.

cc

Enable near misses, don't use rules where they are not applied, try to give suggestions by swapping adjacent letters on the original word.

off

Disable near misses at all.

fea

Returns a list of analisys of a word. Each analisys is a list of attribute value pairs. Attributes available: CAT, T, G, N, P, ....

@l = $dic->fea($word)

flags

returns the set of morphological flag associated with the word. Each flag is related with a set of morphological rules.

@f = flags("gato")

rad

Returns the list of all possible radicals/lemmas for the supplied word.

@l = $dic->rad($word)

der

Returns the list of all possible words using the word as radical.

@l = $dic->der($word);

onethat

Returns the first Feature Structure from the supplied list that verifies the Feature Structure Pattern used.

$analysis = onethat( { CAT=>'adj' }, @features);

$analysis = onethat( { CAT=>'adj' }, $pt->fea("espanhol"));

verif

Retuurns a true value if the second Feature Structure verifies the first Feature Structure Pattern.

if (verif( $pattern, $feature) )  { ... }

nlgrep

@line = $d->nlgrep( word , files);
@line = $d->nlgrep( [word1, wordn] , files);

or with options to set a max number of entries, rec. separator, or tu use radtxt files format.

@line = $d->nlgrep( {max=>100, sep => "\n", radtxt=>0} , pattern , files);

setstopwords

cat2small

Note: This function is specific for the Portuguese jspell dictionary

featags

Given a word, returns a set of analysis. Each analysis is a morphosintatic tag

@l= $pt->featags("lindas") 
  JFS , ...

featagsrad

Given a word, returns a set of analysis. Each analysis is a morphosintatic tag and the lemma information

@l= $pt->featagsrad("lindas") 
  JFS:lindo , ...

ok

# ok: cond:fs x ele:fs-set -> bool
# exist x in ele : verif(cond , x)

if(ok({CAT=>"adj"},$pt->fea("linda"))) { ... }

mkradtxt

any2str

Lingua::Jspell::any2str($ref)
Lingua::Jspell::any2str($ref,$indentation)
Lingua::Jspell::any2str($ref,"compact")

hash2str

AUTHOR

Jose Joao Almeida, <jj@di.uminho.pt> Alberto Simões, <ambs@di.uminho.pt>

BUGS

Please report any bugs or feature requests to bug-lingua-jspell@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Lingua-Jspell. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

COPYRIGHT & LICENSE

Copyright 2007-2008 Projecto Natura

This program is free software; licensed undef GPL.