Text::Corpus::Inspec::Document - Parse Inspec abstract for research.
use Text::Corpus::Inspec; use Text::Corpus::Inspec::Document; use Data::Dump qw(dump); my $corpus = Text::Corpus::Inspec->new (corpusDirectory => $corpusDirectory); my $document = $corpus->getDocument (index => 0); dump $document->getBody; dump $document->getCategories; dump $document->getContent; dump $document->getTitle; dump $document->getUri;
Text::Corpus::Inspec::Document provides methods for accessing specific portions of Inspec abstracts for researching and testing of information processing methods.
new creates an instance of the
Text::Corpus::Inspec class with the following parameters:
filename => '...' or uri => '...'
uri must be the path name to the corpus document to be parsed. If the file does not exist,
undef is returned. The path provided is returned by getUri.
getBody returns an array reference of strings of sentences that are the body of the article.
getCategories (type => 'all')
getCategories returns an array reference of strings that are the categories assigned to the document. The
type must be either
'uncontrolled', which specify the set of categories to be returned.
'uncontrolled' categories are those assigned to the document by an editor without machine assistance; whereas
'controlled' categories were assigned with machine assistance. The option
'all' returns the union of the categories under
'uncontrolled'. The default is
getContent returns an array reference of strings of sentences that form the content of the article, the title and body of the article.
getTitle returns an array reference of strings, usually one, of the title of the article.
getUri returns the URI of the document.
For installation instructions see Text::Corpus::Inspec.
Copyright (c) 2009 Jeff Kubina. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
inspec, english corpus, information processing