|
B |
Biblio::Citation::Parser::Standard - citation parsing functionality
use Biblio::Citation::Parser::Standard;
# Parse a simple reference
$parser = new Biblio::Citation::Parser::Standard;
$metadata = $parser->parse("M. Jewell (2004) Citation Parsing for Beginners. Journal of Madeup References 4(3).");
print "The title of this article is ".$metadata->{atitle}."\n";
Biblio::Citation::Parser::Standard uses a relatively simple template matching technique to extract metadata from citations.
The Templates.pm module currently provides almost 400 templates, with more being added regularly, and the parser returns the metadata in a form that is easily massaged into OpenURLs (see the Biblio::OpenURL module for an even easier way).
new()new() method creates a new parser.
The method takes a template as a parameter, but you shouldn't really need to use this method much.
get_reliability() method, get_concreteness() takes
a template as a parameter, and returns a numeric indicator. In
this case, it is the number of non-field characters in the template.
The more 'concrete' a template, the higher the probability that
it will match well. For example, '_PUBLICATION_ Vol. _VOLUME_' is
a better match than '_PUBLICATION_ _VOLUME_', as _PUBLICATION_ is
likely to subsume 'Vol.' in the second case.
The method takes an author string as a parameter, and returns an array of extracted information in the format '{family => $family, given => $given}'.
xtract_metadata($reference)A regular expression map is present in this method to transform '_AUFIRST_', '_ISSN_', etc, into expressions that should match them. The method then finds the template which best matches the reference, picking the result that has the highest concreteness and reliability (see above), and returns the fields in the hashtable. It also creates the marked-up version, that is useful for further formatting.
The parser provided should not be seen as exhaustive. As new techniques are implemented, further modules will be released.
Mike Jewell <moj@ecs.soton.ac.uk>
|
B |