use Search::Elasticsearch; use Search::Elasticsearch::Plugin::Langdetect; use Search::Elasticsearch(); my $es = Search::Elasticsearch->new( nodes => \@nodes, plugins => ['Langdetect'] ); my $e = Search::Elasticsearch->new(...); my $ld = $e->langdetect; my $lang = $ld->detect_language( "Hello World" ); # en
->detect_languages $content
my $languages = $ld->detect_languages( $content );
Returns an arrayref of all detected languages together with their propabilities.
->detect_language $content
my $language = $ld->detect_language( $content );
Returns the ISO-two-letter code for the detected language. This method is mostly a shorthand for retrieving the most likely language from ->detect_languages.
->detect_languages
-=cut
To install Dancer::SearchApp, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dancer::SearchApp
CPAN shell
perl -MCPAN -e shell install Dancer::SearchApp
For more information on module installation, please visit the detailed CPAN module installation guide.