NAME

Lingua::Gram - N-Gram Alrogithm for Unicode String

VERSION

Version 0.01

DESCRIPTION

This module will use Perl's regular unicode expression to cut string, and calculate the N-Gram algorithm.

SYNOPSIS

use Lingua::Gram;

my $g = Lingua::Gram->new($string);

my @unigramWords = $g->gram(1)
# OR
my @unigramWords = $g->unigram;

my @bigramWords = $g->gram(2);
# OR
my @bigramWords = $g->bigram;

SUBROUTINES/METHODS

new

my $g = Lingua::Gram->new($string);

Create an object that contains $string as paring string.

bigram

$g->bigram;

Return a list which is generated by bigram algorithm. (Faster)

gram

$g->gram($num);

Return a list which is generated by $num-gram algorithm.

unigram

$g->unigram;

Return a list which is generated by unigram algorithm. (Faster)

AUTHOR

Gea-Suan Lin, <gslin at gslin.org>

BUGS

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

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Lingua::Gram

You can also look for information at:

LICENSE AND COPYRIGHT

Copyright 2010 Gea-Suan Lin.

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.