[Chicago-talk] Parsing APA-format citations

Alan Mead amead at alanmead.org
Sun May 6 21:21:44 PDT 2018


Mike,

Thanks! This is extremely interesting. I didn't know about this. But
this is the second half of the issue (parsing the reference list). It
would greatly enhance my hypothetical script to add this capability and
check the in-text citations match one (and only one) of the references.
And, I agree, using this mechanism, I could generate a list of "targets"
that would make it easier to find those citations.

But I was hoping to be able to parse text where the reference list
hadn't been created to facilitate the creation of the reference list.

-Alan

On 5/6/2018 9:28 PM, Mike Fragassi wrote:
> Biblio::Citation::Parser may help you.  First, seems like it should be
> able to parse the references listed in an article's bibliography:
>
> use Biblio::Citation::Parser::Standard;
> my $ref = 'Gleditsch, N. P., Pinker, S., Thayer, B. A., Levy, J. S., &
> Thompson, W. R. (2013). The forum: The decline of war. International
> Studies Review, 15(3), 396-419.'; 
> # example from http://www.citationmachine.net/apa/cite-a-book
> my $cit_parser = new Biblio::Citation::Parser::Standard;
> my $metadata = $cit_parser->parse($ref);
> print Dumper($metadata);
>
> The $metadata is a hashref of valid values parsed from the string,
> including the rule that the parser used to identify the parts, that
> looks like this:
>
>    'match' => '_AUTHORS_ (_YEAR_). _TITLE_. _PUBLICATION_,
> _VOLUME_(_ISSUE_), _PAGES_',
>
> The 'match' seem to come from Biblio::Citation::Parser::Templates, and
> you should be able to modify this to look for things like '(_AUTHORS_,
> _YEAR_)' etc.  (Note: I've never used this module myself before now.) 
>


-- 

Alan D. Mead, Ph.D.
President, Talent Algorithms Inc.

science + technology = better workers

http://www.alanmead.org

I've... seen things you people wouldn't believe...
functions on fire in a copy of Orion.
I watched C-Sharp glitter in the dark near a programmable gate.
All those moments will be lost in time, like Ruby... on... Rails... Time for Pi.

          --"The Register" user Alister, applying the famous 
            "Blade Runner" speech to software development


More information about the Chicago-talk mailing list