The Western Airlines matching rating approach name encoder

mra_encode(word, clean = TRUE)

mra_compare(x, y)

Arguments

word

string or vector of strings to encode

clean

if TRUE, return NA for unknown alphabetical characters

x

MRA-encoded character vector

y

MRA-encoded character vector

Value

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.

Details

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 "Ü," 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.

References

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.

See also

Other phonics: caverphone(), cologne(), lein(), metaphone(), nysiis(), onca(), phonex(), phonics(), rogerroot(), soundex(), statcan()

Examples

mra_encode("William")
#> [1] "WLM"
mra_encode(c("Peter", "Peady"))
#> [1] "PTR" "PDY"
mra_encode("Stevenson")
#> [1] "STVNSN"