Text::BibTeX::Name

Text::BibTeX::Name is a Perl interface to BibTeX-style author names.
Download

Text::BibTeX::Name Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Greg Ward
  • Publisher web site:
  • http://search.cpan.org/~ambs/Text-BibTeX-0.37/BibTeX/Name.pm

Text::BibTeX::Name Tags


Text::BibTeX::Name Description

Text::BibTeX::Name is a Perl interface to BibTeX-style author names. Text::BibTeX::Name is a Perl interface to BibTeX-style author names.SYNOPSIS $name = new Text::BibTeX::Name; $name->split('J. Random Hacker'); # or: $name = new Text::BibTeX::Name ('J. Random Hacker'); @firstname_tokens = $name->part ('first'); $lastname = join (' ', $name->part ('last')); $format = new Text::BibTeX::NameFormat; # ...customize $format... $formatted = $name->format ($format);Text::BibTeX::Name provides an abstraction for BibTeX-style names and some basic operations on them. A name, in the BibTeX world, consists of a list of tokens which are divided amongst four parts: `first', `von', `last', and `jr'.Tokens are separated by whitespace or commas at brace-level zero. Thus the name van der Graaf, Horace Q.has five tokens, whereas the name {Foo, Bar, and Sons}consists of a single token. Skip down to "EXAMPLES" for more examples, or read on if you want to know the exact details of how names are split into tokens and parts.How tokens are divided into parts depends on the form of the name. If the name has no commas at brace-level zero (as in the second example), then it is assumed to be in either "first last" or "first von last" form. If there are no tokens that start with a lower-case letter, then "first last" form is assumed: the final token is the last name, and all other tokens form the first name. Otherwise, the earliest contiguous sequence of tokens with initial lower-case letters is taken as the `von' part; if this sequence includes the final token, then a warning is printed and the final token is forced to be the `last' part.If a name has a single comma, then it is assumed to be in "von last, first" form. A leading sequence of tokens with initial lower-case letters, if any, forms the `von' part; tokens between the `von' and the comma form the `last' part; tokens following the comma form the `first' part. Again, if there are no tokens following a leading sequence of lowercase tokens, a warning is printed and the token immediately preceding the comma is taken to be the `last' part.If a name has more than two commas, a warning is printed and the name is treated as though only the first two commas were present.Finally, if a name has two commas, it is assumed to be in "von last, jr, first" form. (This is the only way to represent a name with a `jr' part.) The parsing of the name is the same as for a one-comma name, except that tokens between the two commas are taken to be the `jr' part. Requirements: · Perl


Text::BibTeX::Name Related Software