NAME

Alvis::Treetagger - Perl module providing FIFO interface to Treetagger

SYNOPSIS

$tagginglines = &Alvis::Treetagger::tag($linetotag);

DESCRIPTION

Interface to TreeTagger so it can be run efficiently via FIFOs. Thus the Treetagger executable is already started up and loaded so the &Alvis::Treetagger::tag() function can operate with a minimum of effort. TreeTagger needs to have already been installed separately. Note all input and output is assumed to be UTF-8, so character set conversion required if something else is in use.

METHODS

$commandLine

Command line arguments for TreeTagger. Defaults to "-token -lemma -sgml".

$errorFile

Where to place Treetaggers STDERR. Goes to STDERR by default, but otherwise set to a filename prior to opening.

$FIFO

Stem for the read/write FIFOs running Treetagger. Defaults to "/tmp".

$parFile

Name of parameter file to use in the Treetagger "lib/" directory. Defaults to English, "english.par".

$taggerRoot

Location of Treetagger directory with executables ("bin/"), libraries ("lib/"), configure files, etc. Should be set during installation.

$verbose

Set for more reports to STDERR during operation.

reopen()

&Alvis::Treetagger::reopen();

Open the FIFO's and start and warm up the Treetagger process.

shut()

&Alvis::Treetagger::shut();

Shutdown the FIFO's and the Treetagger process.

tag()

$tagginglines = &Alvis::Treetagger::tag($linetotag);

Input text should have been tokenised, and is assumed space delimited. So "End." is one token with a "." being the fourth character. Output text is one token per line, with its parts tab delimited giving the original token, its part of speech, and then its lemmatised form. Shuts down treetagger and returns undef if an error occurs.

AUTHOR

Wray Buntine

COPYRIGHT AND LICENSE

Copyright (C) 2006 Wray Buntine

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.