f98ad549cc
is simple: Using "Text::ExtractWords" and "Lingua::StopWords" from CPAN, it determines how many of the known stopwords the document contains for each language supported by "Lingua::StopWords". Each word in the document recognized as stopword of a particular language scores one point for this language. The "language_guess()" function takes a document as a parameter and returns the abbreviation of the language that it is most likely written in. Author: Mike Schilli <cpan@perlmeister.com> WWW: http://search.cpan.org/~mschilli/Text-Language-Guess-0.02/ PR: ports/103571 Submitted by: Masahiro Teramoto <markun@onohara.to>
34 lines
912 B
Makefile
34 lines
912 B
Makefile
# New ports collection makefile for: textproc/p5-Text-Language-Guess
|
|
# Date created: 2006-09-25
|
|
# Whom: Masahiro Teramoto <markun@onohara.to>
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
PORTNAME= Text-Language-Guess
|
|
PORTVERSION= 0.02
|
|
CATEGORIES= textproc perl5
|
|
MASTER_SITES= ${MASTER_SITE_PERL_CPAN}
|
|
MASTER_SITE_SUBDIR= ../../authors/id/M/MS/MSCHILLI
|
|
PKGNAMEPREFIX= p5-
|
|
|
|
MAINTAINER= markun@onohara.to
|
|
COMMENT= Trained module to guess a document's language
|
|
|
|
BUILD_DEPENDS= p5-Log-Log4perl>=1.0:${PORTSDIR}/devel/p5-Log-Log4perl \
|
|
p5-Text-ExtractWords>=0:${PORTSDIR}/textproc/p5-Text-ExtractWords \
|
|
p5-Lingua-StopWords>=0:${PORTSDIR}/textproc/p5-Lingua-StopWords
|
|
RUN_DEPENDS= ${BUILD_DEPENDS}
|
|
|
|
PERL_CONFIGURE= yes
|
|
|
|
MAN1= language-guess.1
|
|
MAN3= Text::Language::Guess.3
|
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
.if ${PERL_LEVEL} < 500600
|
|
IGNORE= requires perl 5.6.x or later. Install lang/perl5 then try again
|
|
.endif
|
|
|
|
.include <bsd.port.post.mk>
|