Aranea::XML::RequestEntry

CONTENTS


NAME

Aranea::XML::RequestEntry - object representing an entry in the <request_list> of an Aranea XML object


SYNOPSIS


  my $request_list = $Aranea->request_list();
  my $entries = $request_list->entries();
 
  for my $request ( @$entries ) {
     # do stuff...
  }


DESCRIPTION

The RequestEntry object represents a single entry inside the candidate_list section of an Aranea XML object. Here is an example:


  <entry>
    <query>What is the volcano that destroyed the ancient city of Pompeii?</query>
    <score>1</score>
    <constraints>
      <use_backoff>true</use_backoff>
      <pages_to_search>100</pages_to_search>
    </constraints>
  </entry>

The RequestList object serves as a container for a collection of RequestEntrys.


METHODS

new($data)
Constructs a Request object given parsed XML data. Note that the preferred way of creating requests is to use the add_default_exact_query or add_default_inexact_query methods of RequestList, which creates a query with the default parameters:


  $request_list->add_default_exact_query("?x killed Lincoln");

query([$request])
Accesses or mutates the query.

score([$request])
Accesses or mutates the score.

get_constraint($constraint)
Returns a specific constraint.

write_xml($writer)
Writes the XML representation of this CandidateList; takes an XML::Writer as its only argument. Note that this method is rarely invoked manually; under typical usage patterns, the write_xml method of Aranea::XML::Aranea will call this method automatically.


COPYRIGHT

The Aranea Question Answering Project. Copyright (C) 2002 by Jimmy Lin (jimmylin@ai.mit.edu)