module[source], separators)[source]

Remove name duplicates in a list of words[source][source][source]

Returns true when the given pair of first names is compatible.

>>> match_first_names(('A','Amanda'))
>>> match_first_names(('Amanda','Amanda'))
>>> match_first_names(('Alfred','Amanda'))
>>> match_first_names(('patrick','P'))
>>> match_first_names((None,'Iryna'))
>>> match_first_names(('Clément','Clement'))
True, b)[source]

Returns a boolean: are these two names compatible? Examples: > (‘Robin’, ‘Ryder’),(‘R.’, ‘Ryder’): True > (‘Robin J.’, ‘Ryder’),(‘R.’, ‘Ryder’): True > (‘R. J.’, ‘Ryder’),(‘J.’, ‘Ryder’): True > (‘R. K.’, ‘Ryder’),(‘K.’, ‘Ryder’): False > (‘Claire’, ‘Mathieu’),(‘Claire’, ‘Kenyon-Mathieu’): False, authors)[source]

Given a name, compute the index of the most similar name in the authors list, if there is any compatible name. (None otherwise)[source], last)[source], b)[source]

Returns a float: how similar are these two names? Examples:

>>> int(10*name_similarity(('Robin', 'Ryder'),('Robin', 'Ryder')))
>>> int(10*name_similarity(('Robin', 'Ryder'),('R.', 'Ryder')))
>>> int(10*name_similarity(('R.', 'Ryder'),('R.', 'Ryder')))
>>> int(10*name_similarity(('Robin J.', 'Ryder'),('R.', 'Ryder')))
>>> int(10*name_similarity(('Robin J.', 'Ryder'),('R. J.', 'Ryder')))
>>> int(10*name_similarity(('R. J.', 'Ryder'),('J.', 'Ryder')))
>>> int(10*name_similarity(('Robin', 'Ryder'),('Robin J.', 'Ryder')))
>>> int(10*name_similarity(('W. Timothy','Gowers'), ('Timothy','Gowers')))
>>> int(10*name_similarity(('Robin K.','Ryder'), ('Robin J.', 'Ryder')))
>>> int(10*name_similarity(('Claire', 'Mathieu'),('Claire', 'Kenyon-Mathieu')))
>>> int(10*name_similarity(('Amanda P.','Brown'),('Patrick','Brown')))
0, b)[source]

Returns the unified name of two matching names

  • a – the first name pair (pair of unicode strings)
  • b – the second name pair (idem)

a unified name pair.[source]

Removes diacritics and hyphens from last names for comparison[source]

If it is an initial, ensure it is of the form “T.”, and recapitalize fully capitalized words. Also convert things like “Jp.” to “J.-P.” This function is to be called on first or last names only.[source]

Number of capitalized letters[source]

Parse a name of the form “Last name, First name” to (first name, last name) Try to do something reasonable if there is no comma., words)[source], words)[source], separators)[source]

Reconstructs a name string out of words and separators, as returned by split_name_words. len(name_words) = len(separators) + 1 is assumed.

  • name_words – The list of name words (without periods)
  • separators – The list of separators (‘’ or ‘-‘)., force=False)[source]

Turns every fully capitalized word into an uncapitalized word (except for the first character). By default, only do it if the word is fully capitalized.[source]

Remove all commas following words, b)[source]

Same as name_similarity, but accepts differences in the last names. This heuristics is more costly but is only used to attribute an ORCID affiliation to the right author in papers fetched from ORCID. (in the next function)[source][source]
Returns:A pair of lists. The first one is the list of words, the second is the list of separators (either ‘’ or ‘-‘)[source]

Converts a Name instance to a pair of (firstname,lastname), b)[source]

Unify two name lists, by matching compatible names and unifying them, and inserting the other names as they are. The names are sorted by average rank in the two lists.

Returns:the unified list of pairs: the first component is the unified name (a pair itself), the second is the pair of indices from the original lists this name was created from (None when there is no corresponding name in one of the lists).[source][source], lstB)[source]

Just as zip(), but pads with None the shortest list so that the list lengths match