Aranea::XML::Query
CONTENTS
Aranea::XML::Query
- object representing the <query>
in an Aranea XML object
use Aranea::XML::Aranea;
use Aranea::XML::Query;
my $stdin = new_from_fd IO::Handle(STDIN, "r");
my $Aranea = Aranea::XML::Aranea->new($stdin);
my $query = $Aranea->query();
my $text = $query->text(); # text of the question
my $id = $query->id(); # the question id (number) |
|
The PageList
object represents the page_list
section of an
Aranea XML object. Here is an example:
<query>
<text>What is the volcano that destroyed the ancient city of Pompeii?</text>
<id>1396</id>
<original>What is the name of the volcano that destroyed the ancient city of Pompeii?</original>
<tagged>What/WP is/VBZ the/DT volcano/NN that/WDT destroyed/VBD the/DT ancient/JJ city/NN of/IN Pompeii/NNP ?/. </tagged>
</query> |
|
Under normal circumstances, the creation of a Query
object should
be handled automatically by the
Aranea::XML::Aranea
object.
new($data)
-
Constructs a
Query
object given parsed XML data. Note that this
method is rarely invoked manually; under typical usage patterns, the
constructor of Aranea::XML::Aranea
will call
this method automatically.
text([$str])
-
Accesses or mutates the text of the query.
id([$str])
-
Accesses or mutates the question number or id.
tagged([$str])
-
Accesses or mutates the part-of-speech tagged question.
original([$str])
-
Accesses or mutates the original (unmodified) text of the question.
qfocus([$str])
-
Accesses or mutates the question focus.
write_xml($writer)
-
Writes the XML representation of this
PageList
; 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.