.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Hunspell 3pm" .TH Hunspell 3pm "2012-06-07" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Text::Hunspell \- Perl interface to the GNU Hunspell library .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& # For this example to work, you have to have \& # the US english dictionary installed! \& \& use strict; \& use warnings; \& \& use Data::Dumper (); \& use Text::Hunspell; \& \& # You can use relative or absolute paths. \& my $speller = Text::Hunspell\->new( \& "/usr/share/hunspell/en_US.aff", # Hunspell affix file \& "/usr/share/hunspell/en_US.dic" # Hunspell dictionary file \& ); \& \& die unless $speller; \& \& # Check a word against the dictionary \& my $word = \*(Aqopera\*(Aq; \& print $speller\->check($word) \& ? "\*(Aq$word\*(Aq found in the dictionary\en" \& : "\*(Aq$word\*(Aq not found in the dictionary!\en"; \& \& # Spell check suggestions \& my $misspelled = \*(Aqprogrammng\*(Aq; \& my @suggestions = $speller\->suggest($misspelled); \& print "\en", "You typed \*(Aq$misspelled\*(Aq. Did you mean?\en"; \& for (@suggestions) { \& print " \- $_\en"; \& } \& \& # Analysis of a word \& $word = \*(Aqautomatic\*(Aq; \& my $analysis = $speller\->analyze($word); \& print "\en", "Analysis of \*(Aq$word\*(Aq returns \*(Aq$analysis\*(Aq\en"; \& \& # Word stemming \& $word = \*(Aqdevelopment\*(Aq; \& my @stemming = $speller\->stem($word); \& print "\en", "Stemming of \*(Aq$word\*(Aq returns:\en"; \& for (@stemming) { \& print " \- $_\en"; \& } \& \& #\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \& # ADVANCED STUFF FROM HERE \& # NOT SURE HOW IT SHOULD WORK \& #\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \& \& # \& # Test here generator for morphological modification (NOM\->ACC) \& # \& $word = \*(Aqdeveloper\*(Aq; \& my $stem = \*(Aqcomputer\*(Aq; \& @suggestions = $speller\->analyze($stem); \& # Modify analyze output for required class (ACC) \& for (@suggestions) { \& s/NOM/ACC/g; \& } \& # Generate ACC class of stem \& @suggestions = $speller\->generate2($stem, \e@suggestions); \& print "Morphological modification generator...\en"; \& print Data::Dumper::Dumper(\e@suggestions); \& \& \& # \& # Test generator for morphological modification, \& # modify $stem like $word \& # \& @suggestions = $speller\->generate($stem, $word); \& print "Morphological modification generator...\en"; \& print Data::Dumper::Dumper(\e@suggestions); \& \& # Deletes the underlying Hunspell C/C++ object \& $speller\->delete($speller); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module provides a Perl interface to the \s-1OO\s0 \fBHunspell\fR library. This module is to meet the need of looking up many words, one at a time, in a single session, such as spell-checking a document in memory. .PP The example code describes the interface on http://hunspell.sf.net .SH "DEPENDENCIES" .IX Header "DEPENDENCIES" \&\fBYou \s-1MUST\s0 have installed \s-1GNU\s0 Hunspell library version 1.0 or higher\fR on your system before installing this \f(CW\*(C`Text::Hunspell\*(C'\fR Perl module. .PP Hunspell location is: .PP .Vb 1 \& http://hunspell.sf.net .Ve .PP There have been a number of bug reports because people failed to install hunspell before installing this module. .PP This is an interface to the hunspell library installed on your system, not a replacement for hunspell. .PP You must also have one hunspell dictionary installed when running the module's test suite. .PP Also, please see the \s-1README\s0 and Changes files. \s-1README\s0 may have specific information about your platform. .SH "METHODS" .IX Header "METHODS" The following methods are available: .ie n .SS """Text::Hunspell\-""new($full_path_to_affix, $full_path_to_dic)>" .el .SS "\f(CWText::Hunspell\-\fPnew($full_path_to_affix, \f(CW$full_path_to_dic\fP)>" .IX Subsection "Text::Hunspell-new($full_path_to_affix, $full_path_to_dic)>" Creates a new speller object. Parameters are: .IP "full path of affix file" 4 .IX Item "full path of affix file" .PD 0 .IP "full path of dictionary (dic) file" 4 .IX Item "full path of dictionary (dic) file" .PD .PP Returns \f(CW\*(C`undef\*(C'\fR if the object could not be created, which is unlikely. .ie n .SS """check($word)""" .el .SS "\f(CWcheck($word)\fP" .IX Subsection "check($word)" Check the word. Returns 1 if the word is found, 0 otherwise. .ie n .SS """suggest($misspelled_word)""" .el .SS "\f(CWsuggest($misspelled_word)\fP" .IX Subsection "suggest($misspelled_word)" Returns the list of suggestions for the misspelled word. .ie n .SS """analyze($word)""" .el .SS "\f(CWanalyze($word)\fP" .IX Subsection "analyze($word)" Returns the analysis list for the word. \&\s-1TODO\s0 \s-1HOW\s0? What does it return?? .PP See the examples in the examples/ folder for now. .ie n .SS """stem($word)""" .el .SS "\f(CWstem($word)\fP" .IX Subsection "stem($word)" Returns the stem list for the word. .ie n .SS """generate2($stem, \e@suggestions)""" .el .SS "\f(CWgenerate2($stem, \e@suggestions)\fP" .IX Subsection "generate2($stem, @suggestions)" Returns a morphologically modified stem as defined in \&\f(CW@suggestions\fR (got by analysis). .PP \&\s-1TODO\s0 Explain ... .ie n .SS """generate($stem, $word)""" .el .SS "\f(CWgenerate($stem, $word)\fP" .IX Subsection "generate($stem, $word)" Returns morphologically modified stem like \f(CW$word\fR. .PP \&\s-1TODO\s0 \s-1WHY\s0 \s-1IS\s0 \s-1THIS\s0 \s-1DIFFERENT\s0 \s-1FROM\s0 \fIgenerate2()\fR ??? \&\s-1EXPLAIN\s0. .ie n .SS """$speller\-""delete($speller)>" .el .SS "\f(CW$speller\-\fPdelete($speller)>" .IX Subsection "$speller-delete($speller)>" Deletes the speller class. .PP \&\s-1TODO\s0 \s-1WHY\s0 \s-1IS\s0 \s-1THIS\s0 \s-1NEEDED\s0?? Called on \f(CW$speller\fR and needs \f(CW$speller\fR ??? .SH "BUGS" .IX Header "BUGS" Probably. Yes, definitely. .SH "COPYRIGHT" .IX Header "COPYRIGHT" This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "AUTHORS" .IX Header "AUTHORS" .Vb 1 \& Eleonora, Eeleonora46_at_gmx_dot_netE .Ve .PP Current maintainer is: .PP .Vb 1 \& Cosimo Streppone, Ecosimo@cpan.orgE .Ve .PP This module is based on a Text::Aspell written by Bill Moseley moseley at hank dot org. .PP Hunspell is written as myspell by Kevin B. Hendricks. .PP Hunspell is maintained by Ne\*'meth La\*'szlo\*'. .PP Please see: .PP .Vb 1 \& http://hunspell.sf.net .Ve .PP For the dictionaries: .PP .Vb 2 \& http://lingucomponent.openoffice.org/spell_dic.html \& http://magyarispell.sf.net for Hungarian dictionary .Ve