The Western Airlines matching rating approach name encoder
mra_encode(word, clean = TRUE)mra_compare(x, y)
string or vector of strings to encode
if TRUE, return NA for unknown alphabetical characters
MRA-encoded character vector
MRA-encoded character vector
The mra_encode function returns match rating approach
encoded character vector. The mra_compare returns a boolean
vector which is TRUE if x and y pass the MRA
comparison test.
The variable word is the name to be encoded. The variable
maxCodeLen is not supported in this algorithm encoder
because the algorithm itself is dependent upon its six-character
length. The variables x and y are MRA-encoded and are
compared to each other using the MRA comparison specification.
The mra_encode algorithm is only defined for inputs over the
standard English alphabet, i.e., "A-Z.". Non-alphabetical
characters are removed from the string in a locale-dependent fashion.
This strips spaces, hyphens, and numbers. Other letters, such as
"<U+00DC>," may be permissible in the current locale but are unknown to
mra_encode. For inputs outside of its known range, the output is
undefined and NA is returned and a warning this thrown.
If clean is FALSE, mra_encode attempts to process the
strings. The default is TRUE.
James P. Howard, II, "Phonetic Spelling Algorithm Implementations for R," Journal of Statistical Software, vol. 25, no. 8, (2020), p. 1--21, <10.18637/jss.v095.i08>.
G.B. Moore, J.L. Kuhns, J.L. Treffzs, and C.A. Montgomery, Accessing Individual Records from Personal Data Files Using Nonunique Identifiers, US National Institute of Standards and Technology, SP-500-2 (1977), p. 17.
Other phonics:
caverphone(),
cologne(),
lein(),
metaphone(),
nysiis(),
onca(),
phonex(),
phonics(),
rogerroot(),
soundex(),
statcan()
# NOT RUN {
mra_encode("William")
mra_encode(c("Peter", "Peady"))
mra_encode("Stevenson")
# }
Run the code above in your browser using DataLab