Person

Person

A person or some other person-like entity.

julia> import BibTeXFormat.Person;

julia> knuth = Person("Donald E. Knuth");

julia> knuth.first_names
1-element Array{String,1}:
 "Donald"

julia> knuth.middle_names
1-element Array{String,1}:
 "E."

julia> knuth.last_names
1-element Array{String,1}:
 "Knuth"
source

Construct a Person from a full name string . It will be parsed and split into separate first, last, middle, pre-last and lineage name parst.

Supported name formats are:

  • von Last, First
  • von Last, Jr, First
  • First von Last

(see BibTeX manual for explanation)

source
Base.convertMethod.

von Last, Jr, First

source

Extract various parts of the name from a string.

julia> import BibTeXFormat: Person

julia> p = Person("Avinash K. Dixit");

julia> p.first_names
1-element Array{String,1}:
 "Avinash"

julia> p.middle_names
1-element Array{String,1}:
 "K."

julia> p.prelast_names
0-element Array{String,1}

julia> p.last_names
1-element Array{String,1}:
 "Dixit"

julia> p.lineage_names
0-element Array{String,1}

julia> convert(String,p)
"Dixit, Avinash K."

julia> p == Person(convert(String,p))
true

julia> p = Person("Dixit, Jr, Avinash K. ");

julia> p.first_names
1-element Array{String,1}:
 "Avinash"

julia> p.middle_names
1-element Array{String,1}:
 "K."

julia> print(p.prelast_names)
String[]
julia> print(p.last_names)
["Dixit"]
julia> print(p.lineage_names)
["Jr"]
julia> print(convert(String,p))
Dixit, Jr, Avinash K.
julia> p == Person(convert(String,p))
true

julia> p = Person("abc");

julia> print(p.first_names, p.middle_names, p.prelast_names, p.last_names, p.lineage_names)
String[]String[]String[]["abc"]String[]
julia> p = Person("Viktorov, Michail~Markovitch");

julia> print(p.first_names, p.middle_names, p.prelast_names, p.last_names, p.lineage_names)
["Michail"]["Markovitch"]String[]["Viktorov"]String[]
source

A list of first and middle names together. (BibTeX treats all middle names as first.)

julia> import BibTeXFormat: Person, bibtex_first_names

julia> knuth = Person("Donald E. Knuth");

julia> bibtex_first_names(knuth)
2-element Array{String,1}:
 "Donald"
 "E."
source
BibTeXFormat.get_partFunction.

Get a list of name parts by type.

julia> import BibTeXFormat: Person, get_part;

julia> knuth = Person("Donald E. Knuth");

julia> get_part(knuth,"first")
1-element Array{String,1}:
 "Donald"

julia> get_part(knuth,"last")
1-element Array{String,1}:
 "Knuth"
source

A list of first names converted to :ref:rich text <rich-text>.

source

A list of last names converted to :ref:rich text <rich-text>.

source

A list of lineage (aka Jr) name parts converted to :ref:rich text <rich-text>.

source

A list of middle names converted to :ref:rich text <rich-text>.

source

A list of pre-last (aka von) name parts converted to :ref:rich text <rich-text>.

source