Caverphone


The Caverphone is a phonetic matching algorithm invented to identify English names with their sounds, originally built to process a custom dataset compound between 1893 and 1938 in southern Dunedin, New Zealand. Started from a similar concept as metaphone, it has been developed to accommodate and process general English since then.

Etymology

The Caverphone was created by David Hood in the Caversham Project at the University of Otago in New Zealand in 2002, revised in 2004. It was created to assist in data matching between late 19th century and early 20th century electoral rolls, where the name only needed to be in a "commonly recognisable form". The algorithm was intended to apply to those names that could not easily be matched between electoral rolls, after the exact matches were removed from the pool of potential matches. The algorithm is optimised for accents present in the study area.

Procedure

Caverphone 1.0

The rules of the algorithm are applied consecutively to any particular name, as a series of replacements.
The algorithm is as follows:
  1. Convert to lowercase
  2. Remove anything not A-Z
  3. If the name starts with...
  4. # cough, replace it by cou2f
  5. # rough, replace it by rou2f
  6. # tough, replace it by tou2f
  7. # enough, replace it by enou2f
  8. # gn, replace it by 2n
  9. If the name ends with
  10. # mb, replace it by m2
  11. Replace
  12. # cq with 2q
  13. # ci with si
  14. # ce with se
  15. # cy with sy
  16. # tch with 2ch
  17. # c with k
  18. # q with k
  19. # x with k
  20. # v with f
  21. # dg with 2g
  22. # tio with sio
  23. # tia with sia
  24. # d with t
  25. # ph with fh
  26. # b with p
  27. # sh with s2
  28. # z with s
  29. # any initial vowel with an A
  30. # all other vowels with a 3
  31. # 3gh3 with 3kh3
  32. # gh with 22
  33. # g with k
  34. # groups of the letter s with a S
  35. # groups of the letter t with a T
  36. # groups of the letter p with a P
  37. # groups of the letter k with a K
  38. # groups of the letter f with a F
  39. # groups of the letter m with a M
  40. # groups of the letter n with a N
  41. # w3 with W3
  42. # wy with Wy
  43. # wh3 with Wh3
  44. # why with Why
  45. # w with 2
  46. # any initial h with an A
  47. # all other occurrences of h with a 2
  48. # r3 with R3
  49. # ry with Ry
  50. # r with 2
  51. # l3 with L3
  52. # ly with Ly
  53. # l with 2
  54. # j with y
  55. # y3 with Y3
  56. # y with 2
  57. remove all
  58. # 2
  59. # 3
  60. put six 1 on the end
  61. take the first six characters as the code

    Caverphone 2.0

  62. Start with a word
  63. Convert to lowercase
  64. Remove anything not in the standard alphabet
  65. Remove final e
  66. If the name starts with
  67. #cough make it cou2f
  68. #rough make it rou2f
  69. #tough make it tou2f
  70. #enough make it enou2f
  71. #trough make it trou2f
  72. #gn make it 2n
  73. If the name ends with
  74. #mb make it m2
  75. Replace
  76. #cq with 2q
  77. #ci with si
  78. #ce with se
  79. #cy with sy
  80. #tch with 2ch
  81. #c with k
  82. #q with k
  83. #x with k
  84. #v with f
  85. #dg with 2g
  86. #tio with sio
  87. #tia with sia
  88. #d with t
  89. #ph with fh
  90. #b with p
  91. #sh with s2
  92. #z with s
  93. #an initial vowel with an A
  94. #all other vowels with a 3
  95. #j with y
  96. #an initial y3 with Y3
  97. #an initial y with A
  98. #y with 3
  99. #3gh3 with 3kh3
  100. #gh with 22
  101. #g with k
  102. #groups of the letter s with a S
  103. #groups of the letter t with a T
  104. #groups of the letter p with a P
  105. #groups of the letter k with a K
  106. #groups of the letter f with a F
  107. #groups of the letter m with a M
  108. #groups of the letter n with a N
  109. #w3 with W3
  110. #wh3 with Wh3
  111. #if the name ends in w replace the final w with 3
  112. #w with 2
  113. #an initial h with an A
  114. #all other occurrences of h with a 2
  115. #r3 with R3
  116. #if the name ends in r replace the final r with 3
  117. #r with 2
  118. #l3 with L3
  119. #if the name ends in l replace the final l with 3
  120. #l with 2
  121. remove all 2s
  122. if the name end in 3, replace the final 3 with A
  123. remove all 3s
  124. put ten 1s on the end
  125. take the first ten characters as the code
----

Examples

Caverphone 1.0


Lee -> lee
lee -> l33
l33 -> L33
L33 -> L
L -> L111111
L111111 -> L11111


Thompson -> thompson
thompson -> th3mps3n
th3mps3n -> th3mpS3n
th3mpS3n -> Th3mpS3n
Th3mpS3n -> Th3mPS3n
Th3mPS3n -> Th3MPS3n
Th3MPS3n -> Th3MPS3N
Th3MPS3N -> T23MPS3N
T23MPS3N -> TMPSN
TMPSN111111 -> TMPSN1

Caverphone 2.0


Lee -> lee
lee -> le
le -> l3
l3 -> L3
L3 -> LA
LA -> LA1111111111
LA1111111111 -> LA11111111


Thompson -> thompson
thompson -> th3mps3n
th3mps3n -> th3mpS3n
th3mpS3n -> Th3mpS3n
Th3mpS3n -> Th3mPS3n
Th3mPS3n -> Th3MPS3n
Th3MPS3n -> Th3MPS3N
Th3MPS3N -> T23MPS3N
T23MPS3N -> TMPSN
TMPSN1111111111 -> TMPSN11111