|
45 | 45 | { s : /\'/, r : "'"}, |
46 | 46 | { s : /\"/, r : '"'}, |
47 | 47 | { s : /\(/, r : "("}, |
48 | | - { s : /\./, r : "."} |
| 48 | + { s : /\./, r : "."}, |
| 49 | + { s : /,/, r : ","}, |
| 50 | + { s : /\//, r : "/"} |
49 | 51 | ]; |
50 | 52 |
|
51 | 53 | for (var i = 0; i < splitters.length; i++) { |
|
96 | 98 | .replace(/\bMacKey\b/, "Mackey") |
97 | 99 | .replace(/\bMacKley\b/, "Mackley") |
98 | 100 | .replace(/\bMacHell\b/, "Machell") |
99 | | - .replace(/\bMacHon\b/, "Machon"); |
| 101 | + .replace(/\bMacHon\b/, "Machon") |
| 102 | + .replace(/\bMacAyla\b/, "Macayla"); |
100 | 103 | } |
101 | 104 |
|
102 | 105 |
|
|
107 | 110 |
|
108 | 111 |
|
109 | 112 | // Fixes for "son (daughter) of" etc. in various languages. |
110 | | - .replace(/\bAl(?=\s+\w)/g, "al") // al Arabic or forename Al. |
| 113 | + .replace(/\bAl(?=\s+\w)\b/g, "al") // al Arabic or forename Al. |
111 | 114 | .replace(/\b(Bin|Binti|Binte)\b/, "bin") // bin, binti, binte Arabic |
112 | 115 | .replace(/\bAp\b/g, "ap") // ap Welsh. |
113 | 116 | .replace(/\bBen(?=\s+\w)\b/g, "ben") // ben Hebrew or forename Ben. |
114 | 117 | .replace(/\bDell([ae])\b/g, "dell$1") // della and delle Italian. |
115 | 118 | .replace(/\bD([aeiu])\b/g, "d$1") // da, de, di Italian; du French. |
116 | 119 | .replace(/\bDe([nlr])\b/g, "de$1") // del Italian; der/den Dutch/Flemish. |
117 | 120 | .replace(/\bEl\b/g, "el") // el Greek |
118 | | - .replace(/\bLa\b/g, "la") // la French |
119 | | - .replace(/\bL([eo])\b/g, "l$1") // lo Italian; le French. |
120 | | - .replace(/\bVan(?=\s+\w)/g, "van") // van German or forename Van. |
| 121 | + .replace(/\bLa\b/g, "la") // la French |
| 122 | + .replace(/\bLe(?=\s+\w)\b/g, "le") // le French |
| 123 | + .replace(/\bLo\b/g, "lo") // lo Italian |
| 124 | + .replace(/\bVan(?=\s+\w)\b/g, "van") // van German or forename Van. |
121 | 125 | .replace(/\bVon\b/g, "von") // von Dutch/Flemish |
122 | 126 |
|
123 | 127 | // Fixes for roman numeral names, e.g. Henry VIII |
|
138 | 142 | // Somewhat arbitrary rule where two letter combos not containing vowels should be capitalized |
139 | 143 | // fixes /JJ Abrams/ and /JD Salinger/ |
140 | 144 | // With some exceptions |
141 | | - .replace(/\b[bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ]{2}\s/, function (v) { return v.toUpperCase(); } ) |
142 | | - .replace(/\bMR\s/, "Mr") |
143 | | - .replace(/\bMS\s/, "Ms") |
144 | | - .replace(/\bDR\s/, "Dr") |
145 | | - .replace(/\bST\s/, "St") |
146 | | - .replace(/\bJR\s/, "Jr") |
147 | | - .replace(/\bSR\s/, "Sr") |
148 | | - .replace(/\bLT\s/, "Lt") |
| 145 | + .replace(/\b[bcdfghjklmnpqrstvwxzBCDFGHJKLMNPQRSTVWXZ]{2}\s/, function (v) { return v.toUpperCase(); } ) |
| 146 | + .replace(/\bMR\.?\b/, "Mr") |
| 147 | + .replace(/\bMS\.?\b/, "Ms") |
| 148 | + .replace(/\bDR\.?\b/, "Dr") |
| 149 | + .replace(/\bST\.?\b/, "St") |
| 150 | + .replace(/\bJR\.?\b/, "Jr") |
| 151 | + .replace(/\bSR\.?\b/, "Sr") |
| 152 | + .replace(/\bLT\.?\b/, "Lt") |
149 | 153 |
|
150 | 154 |
|
151 | 155 | // lowercase words |
|
0 commit comments