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

NAME

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

VERSION

version 0.11.0

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>

LICENSE AND COPYRIGHT

Copyright 2010, 2011 Gea-Suan Lin.

This software is released under 3-clause BSD license. See http://www.opensource.org/licenses/bsd-license.php for more information.