abydos.fingerprint package¶
abydos.fingerprint.
The fingerprint package implements string fingerprints such as:
Basic fingerprinters originating in OpenRefine <http://openrefine.org>:
Fingerprints developed by Pollock & Zomora:
Skeleton key (
SkeletonKey
)Omission key (
OmissionKey
)Fingerprints developed by Cisłak & Grabowski:
Occurrence (
Occurrence
)Occurrence halved (
OccurrenceHalved
)Count (
Count
)Position (
Position
)The Synoname toolcode (
SynonameToolcode
)
Each fingerprint class has a fingerprint
method that takes a string and
returns the string's fingerprint:
>>> sk = SkeletonKey()
>>> sk.fingerprint('orange')
'ORNGAE'
>>> sk.fingerprint('strange')
'STRNGAE'
-
class
abydos.fingerprint.
_Fingerprint
[source]¶ Bases:
object
Abstract _Fingerprint class.
New in version 0.3.6.
-
class
abydos.fingerprint.
String
(joiner=' ')[source]¶ Bases:
abydos.fingerprint._fingerprint._Fingerprint
String Fingerprint.
The fingerprint of a string is a string consisting of all of the unique words in a string, alphabetized & concatenated with intervening joiners. This fingerprint is described at [Ope12].
New in version 0.3.6.
Initialize String instance.
- Parameters
joiner (str) -- The string that will be placed between each word
New in version 0.4.0.
-
fingerprint
(phrase)[source]¶ Return string fingerprint.
- Parameters
phrase (str) -- The string from which to calculate the fingerprint
- Returns
The fingerprint of the phrase
- Return type
str
Example
>>> sf = String() >>> sf.fingerprint('The quick brown fox jumped over the lazy dog.') 'brown dog fox jumped lazy over quick the'
New in version 0.1.0.
Changed in version 0.3.6: Encapsulated in class
-
abydos.fingerprint.
str_fingerprint
(phrase, joiner=' ')[source]¶ Return string fingerprint.
This is a wrapper for
String.fingerprint()
.- Parameters
phrase (str) -- The string from which to calculate the fingerprint
joiner (str) -- The string that will be placed between each word
- Returns
The fingerprint of the phrase
- Return type
str
Example
>>> str_fingerprint('The quick brown fox jumped over the lazy dog.') 'brown dog fox jumped lazy over quick the'
New in version 0.1.0.
Deprecated since version 0.4.0: This will be removed in 0.6.0. Use the String.fingerprint method instead.
-
class
abydos.fingerprint.
QGram
(qval=2, start_stop='', joiner='', skip=0)[source]¶ Bases:
abydos.fingerprint._fingerprint._Fingerprint
Q-Gram Fingerprint.
A q-gram fingerprint is a string consisting of all of the unique q-grams in a string, alphabetized & concatenated. This fingerprint is described at [Ope12].
New in version 0.3.6.
Initialize Q-Gram fingerprinter.
- qvalint
The length of each q-gram (by default 2)
- start_stopstr
The start & stop symbol(s) to concatenate on either end of the phrase, as defined in
tokenizer.QGrams
- joinerstr
The string that will be placed between each word
- skipint or Iterable
The number of characters to skip, can be an integer, range object, or list
New in version 0.4.0.
-
fingerprint
(phrase)[source]¶ Return Q-Gram fingerprint.
- Parameters
phrase (str) -- The string from which to calculate the q-gram fingerprint
- Returns
The q-gram fingerprint of the phrase
- Return type
str
Examples
>>> qf = QGram() >>> qf.fingerprint('The quick brown fox jumped over the lazy dog.') 'azbrckdoedeleqerfoheicjukblampnfogovowoxpequrortthuiumvewnxjydzy' >>> qf.fingerprint('Christopher') 'cherhehrisopphristto' >>> qf.fingerprint('Niall') 'aliallni'
New in version 0.1.0.
Changed in version 0.3.6: Encapsulated in class
-
abydos.fingerprint.
qgram_fingerprint
(phrase, qval=2, start_stop='', joiner='')[source]¶ Return Q-Gram fingerprint.
This is a wrapper for
QGram.fingerprint()
.- Parameters
phrase (str) -- The string from which to calculate the q-gram fingerprint
qval (int) -- The length of each q-gram (by default 2)
start_stop (str) -- The start & stop symbol(s) to concatenate on either end of the phrase, as defined in
tokenizer.QGrams
joiner (str) -- The string that will be placed between each word
- Returns
The q-gram fingerprint of the phrase
- Return type
str
Examples
>>> qgram_fingerprint('The quick brown fox jumped over the lazy dog.') 'azbrckdoedeleqerfoheicjukblampnfogovowoxpequrortthuiumvewnxjydzy' >>> qgram_fingerprint('Christopher') 'cherhehrisopphristto' >>> qgram_fingerprint('Niall') 'aliallni'
New in version 0.1.0.
Deprecated since version 0.4.0: This will be removed in 0.6.0. Use the QGram.fingerprint method instead.
-
class
abydos.fingerprint.
Phonetic
(phonetic_algorithm=None, joiner=' ')[source]¶ Bases:
abydos.fingerprint._string.String
Phonetic Fingerprint.
A phonetic fingerprint is identical to a standard string fingerprint, as implemented in
String
, but performs the fingerprinting function after converting the string to its phonetic form, as determined by some phonetic algorithm. This fingerprint is described at [Ope12].New in version 0.3.6.
Initialize Phonetic instance.
- phonetic_algorithmfunction
A phonetic algorithm that takes a string and returns a string (presumably a phonetic representation of the original string). By default, this function uses
double_metaphone()
.- joinerstr
The string that will be placed between each word
New in version 0.4.0.
-
fingerprint
(phrase)[source]¶ Return the phonetic fingerprint of a phrase.
- Parameters
phrase (str) -- The string from which to calculate the phonetic fingerprint
- Returns
The phonetic fingerprint of the phrase
- Return type
str
Examples
>>> pf = Phonetic() >>> pf.fingerprint('The quick brown fox jumped over the lazy dog.') '0 afr fks jmpt kk ls prn tk'
>>> from abydos.phonetic import Soundex >>> pf = Phonetic(Soundex()) >>> pf.fingerprint('The quick brown fox jumped over the lazy dog.') 'b650 d200 f200 j513 l200 o160 q200 t000'
New in version 0.1.0.
Changed in version 0.3.6: Encapsulated in class
-
abydos.fingerprint.
phonetic_fingerprint
(phrase, phonetic_algorithm=<function double_metaphone>, joiner=' ', *args, **kwargs)[source]¶ Return the phonetic fingerprint of a phrase.
This is a wrapper for
Phonetic.fingerprint()
.- Parameters
phrase (str) -- The string from which to calculate the phonetic fingerprint
phonetic_algorithm (function) -- A phonetic algorithm that takes a string and returns a string (presumably a phonetic representation of the original string). By default, this function uses
double_metaphone()
.joiner (str) -- The string that will be placed between each word
*args -- Variable length argument list
**kwargs -- Arbitrary keyword arguments
- Returns
The phonetic fingerprint of the phrase
- Return type
str
Examples
>>> phonetic_fingerprint('The quick brown fox jumped over the lazy dog.') '0 afr fks jmpt kk ls prn tk'
>>> from abydos.phonetic import soundex >>> phonetic_fingerprint('The quick brown fox jumped over the lazy dog.', ... phonetic_algorithm=soundex) 'b650 d200 f200 j513 l200 o160 q200 t000'
New in version 0.1.0.
Deprecated since version 0.4.0: This will be removed in 0.6.0. Use the Phonetic.fingerprint method instead.
-
class
abydos.fingerprint.
OmissionKey
[source]¶ Bases:
abydos.fingerprint._fingerprint._Fingerprint
Omission Key.
The omission key of a word is defined in [PZ84].
New in version 0.3.6.
-
_consonants
= ('J', 'K', 'Q', 'X', 'Z', 'V', 'W', 'Y', 'B', 'F', 'M', 'G', 'P', 'D', 'H', 'C', 'L', 'N', 'T', 'S', 'R')¶
-
_letters
= {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'}¶
-
fingerprint
(word)[source]¶ Return the omission key.
- Parameters
word (str) -- The word to transform into its omission key
- Returns
The omission key
- Return type
str
Examples
>>> ok = OmissionKey() >>> ok.fingerprint('The quick brown fox jumped over the lazy dog.') 'JKQXZVWYBFMGPDHCLNTREUIOA' >>> ok.fingerprint('Christopher') 'PHCTSRIOE' >>> ok.fingerprint('Niall') 'LNIA'
New in version 0.1.0.
Changed in version 0.3.6: Encapsulated in class
-
-
abydos.fingerprint.
omission_key
(word)[source]¶ Return the omission key.
This is a wrapper for
OmissionKey.fingerprint()
.- Parameters
word (str) -- The word to transform into its omission key
- Returns
The omission key
- Return type
str
Examples
>>> omission_key('The quick brown fox jumped over the lazy dog.') 'JKQXZVWYBFMGPDHCLNTREUIOA' >>> omission_key('Christopher') 'PHCTSRIOE' >>> omission_key('Niall') 'LNIA'
New in version 0.1.0.
Deprecated since version 0.4.0: This will be removed in 0.6.0. Use the OmissionKey.fingerprint method instead.
-
class
abydos.fingerprint.
SkeletonKey
[source]¶ Bases:
abydos.fingerprint._fingerprint._Fingerprint
Skeleton Key.
The skeleton key of a word is defined in [PZ84].
New in version 0.3.6.
-
_letters
= {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'}¶
-
_vowels
= {'A', 'E', 'I', 'O', 'U'}¶
-
fingerprint
(word)[source]¶ Return the skeleton key.
- Parameters
word (str) -- The word to transform into its skeleton key
- Returns
The skeleton key
- Return type
str
Examples
>>> sk = SkeletonKey() >>> sk.fingerprint('The quick brown fox jumped over the lazy dog.') 'THQCKBRWNFXJMPDVLZYGEUIOA' >>> sk.fingerprint('Christopher') 'CHRSTPIOE' >>> sk.fingerprint('Niall') 'NLIA'
New in version 0.1.0.
Changed in version 0.3.6: Encapsulated in class
-
-
abydos.fingerprint.
skeleton_key
(word)[source]¶ Return the skeleton key.
This is a wrapper for
SkeletonKey.fingerprint()
.- Parameters
word (str) -- The word to transform into its skeleton key
- Returns
The skeleton key
- Return type
str
Examples
>>> skeleton_key('The quick brown fox jumped over the lazy dog.') 'THQCKBRWNFXJMPDVLZYGEUIOA' >>> skeleton_key('Christopher') 'CHRSTPIOE' >>> skeleton_key('Niall') 'NLIA'
New in version 0.1.0.
Deprecated since version 0.4.0: This will be removed in 0.6.0. Use the SkeletonKey.fingerprint method instead.
-
class
abydos.fingerprint.
Occurrence
(n_bits=16, most_common=('e', 't', 'a', 'o', 'i', 'n', 's', 'h', 'r', 'd', 'l', 'c', 'u', 'm', 'w', 'f'))[source]¶ Bases:
abydos.fingerprint._fingerprint._Fingerprint
Occurrence Fingerprint.
Based on the occurrence fingerprint from [CislakG17].
New in version 0.3.6.
Initialize Count instance.
- Parameters
n_bits (int) -- Number of bits in the fingerprint returned
most_common (list) -- The most common tokens in the target language, ordered by frequency
New in version 0.4.0.
-
fingerprint
(word)[source]¶ Return the occurrence fingerprint.
- Parameters
word (str) -- The word to fingerprint
- Returns
The occurrence fingerprint
- Return type
int
Examples
>>> of = Occurrence() >>> bin(of.fingerprint('hat')) '0b110000100000000' >>> bin(of.fingerprint('niall')) '0b10110000100000' >>> bin(of.fingerprint('colin')) '0b1110000110000' >>> bin(of.fingerprint('atcg')) '0b110000000010000' >>> bin(of.fingerprint('entreatment')) '0b1110010010000100'
New in version 0.3.0.
Changed in version 0.3.6: Encapsulated in class
-
abydos.fingerprint.
occurrence_fingerprint
(word, n_bits=16, most_common=('e', 't', 'a', 'o', 'i', 'n', 's', 'h', 'r', 'd', 'l', 'c', 'u', 'm', 'w', 'f'))[source]¶ Return the occurrence fingerprint.
This is a wrapper for
Occurrence.fingerprint()
.- Parameters
word (str) -- The word to fingerprint
n_bits (int) -- Number of bits in the fingerprint returned
most_common (list) -- The most common tokens in the target language, ordered by frequency
- Returns
The occurrence fingerprint
- Return type
int
Examples
>>> bin(occurrence_fingerprint('hat')) '0b110000100000000' >>> bin(occurrence_fingerprint('niall')) '0b10110000100000' >>> bin(occurrence_fingerprint('colin')) '0b1110000110000' >>> bin(occurrence_fingerprint('atcg')) '0b110000000010000' >>> bin(occurrence_fingerprint('entreatment')) '0b1110010010000100'
New in version 0.3.0.
Deprecated since version 0.4.0: This will be removed in 0.6.0. Use the Occurrence.fingerprint method instead.
-
class
abydos.fingerprint.
OccurrenceHalved
(n_bits=16, most_common=('e', 't', 'a', 'o', 'i', 'n', 's', 'h', 'r', 'd', 'l', 'c', 'u', 'm', 'w', 'f'))[source]¶ Bases:
abydos.fingerprint._fingerprint._Fingerprint
Occurrence Halved Fingerprint.
Based on the occurrence halved fingerprint from [CislakG17].
New in version 0.3.6.
Initialize Count instance.
- Parameters
n_bits (int) -- Number of bits in the fingerprint returned
most_common (list) -- The most common tokens in the target language, ordered by frequency
New in version 0.4.0.
-
fingerprint
(word)[source]¶ Return the occurrence halved fingerprint.
Based on the occurrence halved fingerprint from [CislakG17].
- Parameters
word (str) -- The word to fingerprint
n_bits (int) -- Number of bits in the fingerprint returned
most_common (list) -- The most common tokens in the target language, ordered by frequency
- Returns
The occurrence halved fingerprint
- Return type
int
Examples
>>> ohf = OccurrenceHalved() >>> bin(ohf.fingerprint('hat')) '0b1010000000010' >>> bin(ohf.fingerprint('niall')) '0b10010100000' >>> bin(ohf.fingerprint('colin')) '0b1001010000' >>> bin(ohf.fingerprint('atcg')) '0b10100000000000' >>> bin(ohf.fingerprint('entreatment')) '0b1111010000110000'
New in version 0.3.0.
Changed in version 0.3.6: Encapsulated in class
-
abydos.fingerprint.
occurrence_halved_fingerprint
(word, n_bits=16, most_common=('e', 't', 'a', 'o', 'i', 'n', 's', 'h', 'r', 'd', 'l', 'c', 'u', 'm', 'w', 'f'))[source]¶ Return the occurrence halved fingerprint.
This is a wrapper for
OccurrenceHalved.fingerprint()
.- Parameters
word (str) -- The word to fingerprint
n_bits (int) -- Number of bits in the fingerprint returned
most_common (list) -- The most common tokens in the target language, ordered by frequency
- Returns
The occurrence halved fingerprint
- Return type
int
Examples
>>> bin(occurrence_halved_fingerprint('hat')) '0b1010000000010' >>> bin(occurrence_halved_fingerprint('niall')) '0b10010100000' >>> bin(occurrence_halved_fingerprint('colin')) '0b1001010000' >>> bin(occurrence_halved_fingerprint('atcg')) '0b10100000000000' >>> bin(occurrence_halved_fingerprint('entreatment')) '0b1111010000110000'
New in version 0.3.0.
Deprecated since version 0.4.0: This will be removed in 0.6.0. Use the OccurrenceHalved.fingerprint method instead.
-
class
abydos.fingerprint.
Count
(n_bits=16, most_common=('e', 't', 'a', 'o', 'i', 'n', 's', 'h', 'r', 'd', 'l', 'c', 'u', 'm', 'w', 'f'))[source]¶ Bases:
abydos.fingerprint._fingerprint._Fingerprint
Count Fingerprint.
Based on the count fingerprint from [CislakG17].
New in version 0.3.6.
Initialize Count instance.
- Parameters
n_bits (int) -- Number of bits in the fingerprint returned
most_common (list) -- The most common tokens in the target language, ordered by frequency
New in version 0.4.0.
-
fingerprint
(word)[source]¶ Return the count fingerprint.
- Parameters
word (str) -- The word to fingerprint
- Returns
The count fingerprint
- Return type
int
Examples
>>> cf = Count() >>> bin(cf.fingerprint('hat')) '0b1010000000001' >>> bin(cf.fingerprint('niall')) '0b10001010000' >>> bin(cf.fingerprint('colin')) '0b101010000' >>> bin(cf.fingerprint('atcg')) '0b1010000000000' >>> bin(cf.fingerprint('entreatment')) '0b1111010000100000'
New in version 0.3.0.
Changed in version 0.3.6: Encapsulated in class
-
abydos.fingerprint.
count_fingerprint
(word, n_bits=16, most_common=('e', 't', 'a', 'o', 'i', 'n', 's', 'h', 'r', 'd', 'l', 'c', 'u', 'm', 'w', 'f'))[source]¶ Return the count fingerprint.
This is a wrapper for
Count.fingerprint()
.- Parameters
word (str) -- The word to fingerprint
n_bits (int) -- Number of bits in the fingerprint returned
most_common (list) -- The most common tokens in the target language, ordered by frequency
- Returns
The count fingerprint
- Return type
int
Examples
>>> bin(count_fingerprint('hat')) '0b1010000000001' >>> bin(count_fingerprint('niall')) '0b10001010000' >>> bin(count_fingerprint('colin')) '0b101010000' >>> bin(count_fingerprint('atcg')) '0b1010000000000' >>> bin(count_fingerprint('entreatment')) '0b1111010000100000'
New in version 0.3.0.
Deprecated since version 0.4.0: This will be removed in 0.6.0. Use the Count.fingerprint method instead.
-
class
abydos.fingerprint.
Position
(n_bits=16, most_common=('e', 't', 'a', 'o', 'i', 'n', 's', 'h', 'r', 'd', 'l', 'c', 'u', 'm', 'w', 'f'), bits_per_letter=3)[source]¶ Bases:
abydos.fingerprint._fingerprint._Fingerprint
Position Fingerprint.
Based on the position fingerprint from [CislakG17].
New in version 0.3.6.
Initialize Count instance.
- Parameters
n_bits (int) -- Number of bits in the fingerprint returned
most_common (list) -- The most common tokens in the target language, ordered by frequency
New in version 0.4.0.
-
fingerprint
(word)[source]¶ Return the position fingerprint.
- Parameters
word (str) -- The word to fingerprint
- Returns
The position fingerprint
- Return type
int
Examples
>>> bin(position_fingerprint('hat')) '0b1110100011111111' >>> bin(position_fingerprint('niall')) '0b1111110101110010' >>> bin(position_fingerprint('colin')) '0b1111111110010111' >>> bin(position_fingerprint('atcg')) '0b1110010001111111' >>> bin(position_fingerprint('entreatment')) '0b101011111111'
New in version 0.3.0.
Changed in version 0.3.6: Encapsulated in class
-
abydos.fingerprint.
position_fingerprint
(word, n_bits=16, most_common=('e', 't', 'a', 'o', 'i', 'n', 's', 'h', 'r', 'd', 'l', 'c', 'u', 'm', 'w', 'f'), bits_per_letter=3)[source]¶ Return the position fingerprint.
This is a wrapper for
Position.fingerprint()
.- Parameters
word (str) -- The word to fingerprint
n_bits (int) -- Number of bits in the fingerprint returned
most_common (list) -- The most common tokens in the target language, ordered by frequency
bits_per_letter (int) -- The bits to assign for letter position
- Returns
The position fingerprint
- Return type
int
Examples
>>> bin(position_fingerprint('hat')) '0b1110100011111111' >>> bin(position_fingerprint('niall')) '0b1111110101110010' >>> bin(position_fingerprint('colin')) '0b1111111110010111' >>> bin(position_fingerprint('atcg')) '0b1110010001111111' >>> bin(position_fingerprint('entreatment')) '0b101011111111'
New in version 0.3.0.
Deprecated since version 0.4.0: This will be removed in 0.6.0. Use the Position.fingerprint method instead.
-
class
abydos.fingerprint.
SynonameToolcode
[source]¶ Bases:
abydos.fingerprint._fingerprint._Fingerprint
Synoname Toolcode.
Cf. [JPGTrust91][Gro91].
New in version 0.3.6.
-
_gen_1
= ('the elder', ' sr.', ' sr', 'senior', 'der altere', 'il vecchio', "l'aine", 'p.re', 'padre', 'seniore', 'vecchia', 'vecchio')¶
-
_gen_2
= (' jr.', ' jr', 'der jungere', 'il giovane', 'giovane', 'juniore', 'junior', 'le jeune', 'the younger')¶
-
_method_dict
= {'beginning': 4, 'beginning_no_space': 8, 'end': 1, 'middle': 2}¶
-
_qual_1
= {'ascribed to', 'attributed to', 'attributed to or copy after', 'possibly'}¶
-
_qual_2
= {'copy after', 'copy after?', 'copy of'}¶
-
_qual_3
= {'adaptation after', 'after', 'assistant of', 'assistants of', 'circle of', 'follower of', 'imitator of', 'in the style of', 'manner of', 'pupil of', 'school of', 'studio of', 'style of', 'workshop of'}¶
-
_synoname_special_table
= ((False, 'NONE', '', 0), (False, 'aine', '', 3), (False, 'also erroneously', '', 4), (False, 'also identified with the', '', 2), (False, 'also identified with', '', 2), (False, 'archbishop', '', 7), (False, 'atelier', '', 7), (False, 'baron', '', 7), (False, 'cadet', '', 3), (False, 'cardinal', '', 7), (False, 'circle of', '', 5), (False, 'circle', '', 5), (False, 'class of', '', 5), (False, 'conde de', '', 7), (False, 'countess', '', 7), (False, 'count', '', 7), (False, "d'", " d'", 15), (False, 'dai', '', 15), (False, "dall'", " dall'", 15), (False, 'dalla', '', 15), (False, 'dalle', '', 15), (False, 'dal', '', 15), (False, 'da', '', 15), (False, 'degli', '', 15), (False, 'della', '', 15), (False, 'del', '', 15), (False, 'den', '', 15), (False, 'der altere', '', 3), (False, 'der jungere', '', 3), (False, 'der', '', 15), (False, 'de la', '', 15), (False, 'des', '', 15), (False, "de'", " de'", 15), (False, 'de', '', 15), (False, 'di ser', '', 7), (False, 'di', '', 15), (False, 'dos', '', 15), (False, 'du', '', 15), (False, 'duke of', '', 7), (False, 'earl of', '', 7), (False, 'el', '', 15), (False, 'fils', '', 3), (False, 'florentine follower of', '', 5), (False, 'follower of', '', 5), (False, 'fra', '', 7), (False, 'freiherr von', '', 7), (False, 'giovane', '', 7), (False, 'group', '', 5), (True, 'iii', '', 3), (True, 'ii', '', 3), (False, 'il giovane', '', 7), (False, 'il vecchio', '', 7), (False, 'il', '', 15), (False, "in't", '', 7), (False, 'in het', '', 7), (True, 'iv', '', 3), (True, 'ix', '', 3), (True, 'i', '', 3), (False, 'jr.', '', 3), (False, 'jr', '', 3), (False, 'juniore', '', 3), (False, 'junior', '', 3), (False, 'king of', '', 7), (False, "l'", " l'", 15), (False, "l'aine", '', 3), (False, 'la', '', 15), (False, 'le jeune', '', 3), (False, 'le', '', 15), (False, 'lo', '', 15), (False, 'maestro', '', 7), (False, 'maitre', '', 7), (False, 'marchioness', '', 7), (False, 'markgrafin von', '', 7), (False, 'marquess', '', 7), (False, 'marquis', '', 7), (False, 'master of the', '', 7), (False, 'master of', '', 7), (False, 'master known as the', '', 7), (False, 'master with the', '', 7), (False, 'master with', '', 7), (False, 'masters', '', 7), (False, 'master', '', 7), (False, 'meister', '', 7), (False, 'met de', '', 7), (False, 'met', '', 7), (False, 'mlle.', '', 7), (False, 'mlle', '', 7), (False, 'monogrammist', '', 7), (False, 'monsu', '', 7), (False, 'nee', '', 2), (False, 'of', '', 3), (False, 'oncle', '', 3), (False, 'op den', '', 15), (False, 'op de', '', 15), (False, 'or', '', 2), (False, 'over den', '', 15), (False, 'over de', '', 15), (False, 'over', '', 7), (False, 'p.re', '', 7), (False, 'p.r.a.', '', 1), (False, 'padre', '', 7), (False, 'painter', '', 7), (False, 'pere', '', 3), (False, 'possibly identified with', '', 6), (False, 'possibly', '', 6), (False, 'pseudo', '', 15), (False, 'r.a.', '', 1), (False, 'reichsgraf von', '', 7), (False, 'ritter von', '', 7), (False, 'sainte-', ' sainte-', 8), (False, 'sainte', '', 7), (False, 'saint-', ' saint-', 8), (False, 'saint', '', 7), (False, 'santa', '', 15), (False, "sant'", " sant'", 15), (False, 'san', '', 15), (False, 'ser', '', 7), (False, 'seniore', '', 3), (False, 'senior', '', 3), (False, 'sir', '', 5), (False, 'sr.', '', 3), (False, 'sr', '', 3), (False, 'ss.', ' ss.', 14), (False, 'ss', '', 6), (False, 'st-', ' st-', 8), (False, 'st.', ' st.', 15), (False, 'ste-', ' ste-', 8), (False, 'ste.', ' ste.', 15), (False, 'studio', '', 7), (False, 'sub-group', '', 5), (False, 'sultan of', '', 7), (False, 'ten', '', 15), (False, 'ter', '', 15), (False, 'the elder', '', 3), (False, 'the younger', '', 3), (False, 'the', '', 7), (False, 'tot', '', 15), (False, 'unidentified', '', 1), (False, 'van den', '', 15), (False, 'van der', '', 15), (False, 'van de', '', 15), (False, 'vanden', '', 15), (False, 'vander', '', 15), (False, 'van', '', 15), (False, 'vecchia', '', 7), (False, 'vecchio', '', 7), (True, 'viii', '', 3), (True, 'vii', '', 3), (True, 'vi', '', 3), (True, 'v', '', 3), (False, 'vom', '', 7), (False, 'von', '', 15), (False, 'workshop', '', 7), (True, 'xiii', '', 3), (True, 'xii', '', 3), (True, 'xiv', '', 3), (True, 'xix', '', 3), (True, 'xi', '', 3), (True, 'xviii', '', 3), (True, 'xvii', '', 3), (True, 'xvi', '', 3), (True, 'xv', '', 3), (True, 'xx', '', 3), (True, 'x', '', 3), (False, 'y', '', 7))¶
-
fingerprint
(lname, fname='', qual='', normalize=0)[source]¶ Build the Synoname toolcode.
- Parameters
lname (str) -- Last name
fname (str) -- First name (can be blank)
qual (str) -- Qualifier
normalize (int) -- Normalization mode (0, 1, or 2)
- Returns
The transformed names and the synoname toolcode
- Return type
tuple
Examples
>>> st = SynonameToolcode() >>> st.fingerprint('hat') ('hat', '', '0000000003$$h') >>> st.fingerprint('niall') ('niall', '', '0000000005$$n') >>> st.fingerprint('colin') ('colin', '', '0000000005$$c') >>> st.fingerprint('atcg') ('atcg', '', '0000000004$$a') >>> st.fingerprint('entreatment') ('entreatment', '', '0000000011$$e')
>>> st.fingerprint('Ste.-Marie', 'Count John II', normalize=2) ('ste.-marie ii', 'count john', '0200491310$015b049a127c$smcji') >>> st.fingerprint('Michelangelo IV', '', 'Workshop of') ('michelangelo iv', '', '3000550015$055b$mi')
New in version 0.3.0.
Changed in version 0.3.6: Encapsulated in class
-
-
abydos.fingerprint.
synoname_toolcode
(lname, fname='', qual='', normalize=0)[source]¶ Build the Synoname toolcode.
This is a wrapper for
SynonameToolcode.fingerprint()
.- Parameters
lname (str) -- Last name
fname (str) -- First name (can be blank)
qual (str) -- Qualifier
normalize (int) -- Normalization mode (0, 1, or 2)
- Returns
The transformed names and the synoname toolcode
- Return type
tuple
Examples
>>> synoname_toolcode('hat') ('hat', '', '0000000003$$h') >>> synoname_toolcode('niall') ('niall', '', '0000000005$$n') >>> synoname_toolcode('colin') ('colin', '', '0000000005$$c') >>> synoname_toolcode('atcg') ('atcg', '', '0000000004$$a') >>> synoname_toolcode('entreatment') ('entreatment', '', '0000000011$$e')
>>> synoname_toolcode('Ste.-Marie', 'Count John II', normalize=2) ('ste.-marie ii', 'count john', '0200491310$015b049a127c$smcji') >>> synoname_toolcode('Michelangelo IV', '', 'Workshop of') ('michelangelo iv', '', '3000550015$055b$mi')
New in version 0.3.0.
Deprecated since version 0.4.0: This will be removed in 0.6.0. Use the SynonameToolcode.fingerprint method instead.