Using the sample main program to process corpora

The simplest way to use the FreeLing libraries is via the provided analyzer sample main program, which allows the user to process an input text to obtain several linguistic processings.

Since it is impossible to write a program that fits everyone's needs, the analyzer program offers you almost all functionalities included in FreeLing, but if you want it to output more information, or do so in a specific format, or combine the modules in a different way, the right path to follow is building your own main program or adapting one of the existing, as described in section 4.2

FreeLing also provides a couple of programs analyzer_server and analyzer_client that perform the same task, but the server remains loaded after analyzing each client's request, thus reducing the starting-up overhead if many small files have to be processed. Server-client pairs communicate via sockets.

Both analyzer and analyzer_server are usually called with an option -f config-file (if ommitted, they will search for a file named analyzer.cfg in the current directory). The given config-file must be an absolute file name, or a relative path to the current directory.

You can use the default configuration files (located at /usr/local/share/FreeLing/config if you installed from tarball, or at /usr/share/FreeLing/config if you used a .deb package), or either a config file that suits your needs. Note that the default configuration files require the environment variable FREELINGSHARE to be defined and to point to a directory with valid FreeLing data files (e.g. /usr/local/share/FreeLing).

The analyze script described below handles all these default paths and variables and makes everything easier if you want to use the defaults



Subsections
Lluís Padró 2010-09-02