-
Notifications
You must be signed in to change notification settings - Fork 35
/
dict.ts
40 lines (36 loc) · 1.54 KB
/
dict.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { convert } from './dictionaries/convert'
export const toRegexPattern = (string: string) => {
let _str = string
// 以下なるべく文字数が多いものほど上にすること
_str = _str
.replace(/三栄町|四谷三栄町/g, '(三栄町|四谷三栄町)')
.replace(/鬮野川|くじ野川|くじの川/g, '(鬮野川|くじ野川|くじの川)')
.replace(/柿碕町|柿さき町/g, '(柿碕町|柿さき町)')
.replace(/通り|とおり/g, '(通り|とおり)')
.replace(/埠頭|ふ頭/g, '(埠頭|ふ頭)')
.replace(/番町|番丁/g, '(番町|番丁)')
.replace(/大冝|大宜/g, '(大冝|大宜)')
.replace(/穝|さい/g, '(穝|さい)')
.replace(/杁|えぶり/g, '(杁|えぶり)')
.replace(/薭|稗|ひえ|ヒエ/g, '(薭|稗|ひえ|ヒエ)')
.replace(/[之ノの]/g, '[之ノの]')
.replace(/[ヶケが]/g, '[ヶケが]')
.replace(/[ヵカか力]/g, '[ヵカか力]')
.replace(/[ッツっつ]/g, '[ッツっつ]')
.replace(/[ニ二]/g, '[ニ二]')
.replace(/[ハ八]/g, '[ハ八]')
.replace(/塚|塚/g, '(塚|塚)')
.replace(/釜|竈/g, '(釜|竈)')
.replace(/條|条/g, '(條|条)')
.replace(/狛|拍/g, '(狛|拍)')
.replace(/藪|薮/g, '(藪|薮)')
.replace(/渕|淵/g, '(渕|淵)')
.replace(/エ|ヱ|え/g, '(エ|ヱ|え)')
.replace(/曾|曽/g, '(曾|曽)')
.replace(/舟|船/g, '(舟|船)')
.replace(/莵|菟/g, '(莵|菟)')
.replace(/市|巿/g, '(市|巿)')
.replace(/崎|﨑/g, '(崎|﨑)')
_str = convert(_str)
return _str
}