Lingua::FreeLing3::Utils - text processing utilities using FreeLing3 Perl inferface
Version 0.02_1
Calculate n-grams for a given text.
use Lingua::FreeLing3::Utils qw/ngrams ngrams_pp/; # calculate bigrams my $ngrams = ngrams({ n => 2 }, $text); # pretty print bigrams ngrams_pp($ngrams);
Calculate word analysis (all possible for each word)
use Lingua::FreeLing3::Utils qw/word_analysis/; # calculate analysis my $analysis = word_analysis($word); # in fact, you can get for a list of words my @analysis = word_analysis(@words); # or for a text, and we'll calculate the list for you my @analysis = word_analysis($text);
The following functions can be exported:
Compute all possible analysis for a specific word, list of words, or words from a text. You can pass an optional first argument (hash reference) with extra configuration.
@analysis = word_analysis( { l=>'pt' }, @words );
Compute n-grams for a given input. The argument to this function is a filname to process. You can optionally add a hash reference of options.
ngrams({n => 2, l => 'en'}, $filename);
The following options are availaboe:
-n
Set n (default: bigrams n=2).
-l
Select language (default: en).
-i 1|0
Case insensitive (default: off).
-t 1|0
Use <s> and </s> around sentences (default: on).
<s
</s
Pretty print n-grams data in plain text.
Nuno Carvalho, <smash at cpan.org>
<smash at cpan.org>
Please report any bugs or feature requests to bug-lingua-freeling3-utils at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Lingua-FreeLing3-Utils. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-lingua-freeling3-utils at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Lingua::FreeLing3::Utils
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Lingua-FreeLing3-Utils
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Lingua-FreeLing3-Utils
CPAN Ratings
http://cpanratings.perl.org/d/Lingua-FreeLing3-Utils
Search CPAN
http://search.cpan.org/dist/Lingua-FreeLing3-Utils/
Copyright 2012 Nuno Carvalho.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Lingua::FreeLing3::Utils, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Lingua::FreeLing3::Utils
CPAN shell
perl -MCPAN -e shell install Lingua::FreeLing3::Utils
For more information on module installation, please visit the detailed CPAN module installation guide.