Lingua::ZH::Keywords - Extract keywords from Chinese text
# Exports keywords() by default use Lingua::ZH::Keywords; print join(",", keywords($text)); # Prints five keywords print join(",", keywords($text, 10)); # Prints ten keywords
This is a very simple algorithm which removes stopwords from the text, and then counts up what it considers to be the most important keywords. The keywords subroutine returns a list of keywords in order of relevance.
keywords
The stopwords list is accessible as @Lingua::ZH::Keywords::StopWords.
@Lingua::ZH::Keywords::StopWords
If the input $text is an Unicode string, the returned keywords will also be Unicode strings; otherwise they are assumed to be Big5-encoded bytestrings.
$text
Lingua::ZH::TaBE, Lingua::EN::Keywords
Algorithm adapted from the Lingua::EN::Keywords module by Simon Cozens, <simon@simon-cozens.org<gt>.
Autrijus Tang <autrijus@autrijus.org>
Copyright 2003 by Autrijus Tang <autrijus@autrijus.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
To install Lingua::ZH::Keywords, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Lingua::ZH::Keywords
CPAN shell
perl -MCPAN -e shell install Lingua::ZH::Keywords
For more information on module installation, please visit the detailed CPAN module installation guide.