Lemur - class to query a Lemur server, and parse the results


Version 1.00


 use Search::Lemur;

 my $lem = Search::Lemur->new("http://url/to/lemur.cgi");

 # run some queries, and get back an array of results
 # a query with a single term:
 my @results1 = $lem->query("encryption");
 # a query with two terms:
 my @results2 = $lem->query("encryption MD5");

 # get corpus term frequency of 'MD5':
 my $md5ctf = $results2[1]->ctf();


This module will make it easy to interact with a Lemur Toolkit for Language Modeling and Information Retrieval server for information retreival exercises. For more information on Lemur, see

This module takes care of all parsing of responses from the server. You can just pass a query as a space-separated list of terms, and the module will give you back an array of result objects.

Main Methods


Create a new Lemur object, connecting to the given Lemur server. The $url should be a full URL, ending in something like 'lemur.cgi'.


Return the URL of the Lemur server


Get some information about the databases available

Returns an array of Lemur::Database objects.


Set the database number to query. This will specify the database number instead of just using the default databse 0.

If the num is not specified, the the current database is returned.


Make a query to the Lemur server. The query should be a space-delimited list of query terms. If the URL is has not been specified, this will die.

Be sure there is only one space between words, or something unexpected may happen.

Returns an array of results (See Lemur::result). There will be a result for each query term.


Returns the lexicalized (stopped & stemmed) version of the given word. This is affected by weather or not the current database is stemmed and/or stopworded. Basically, this is the real word you will end up searching for.

Returns a string.


Patrick Kaeding, <pkaeding at>


Please report any bugs or feature requests to bug-search-lemur at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

    perldoc Search::Lemur

You can also look for information at:



Copyright 2007 Patrick Kaeding, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.