Skip to content

Commit

Permalink
「船」と「舟」及び「莵」と「菟」のゆらぎの解消 (#117)
Browse files Browse the repository at this point in the history
* fixed #115
  • Loading branch information
miya0001 authored Sep 6, 2021
1 parent 9313c3a commit c2cab1c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/dict.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ export const toRegex = (string: string) => {
.replace(/|/g, '(渕|淵)')
.replace(/||/g, '(エ|ヱ|え)')
.replace(/|/g, '(曾|曽)')
.replace(/|/g, '(舟|船)')
.replace(/|/g, '(莵|菟)')

_str = jisKanji(_str)

Expand Down
20 changes: 20 additions & 0 deletions test/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,26 @@ test('岩手県花巻市12丁目704', async () => {
expect(res).toStrictEqual({"pref": "岩手県", "city": "花巻市", "town": "十二丁目", "addr": "704", "lat": 39.358268, "lng": 141.122331, "level": 3})
})

test('京都府京都市中京区河原町二条下ル一之船入町537-50', async () => {
const res = await normalize('京都府京都市中京区河原町二条下ル一之船入町537-50')
expect(res).toStrictEqual({"pref": "京都府", "city": "京都市中京区", "town": "一之船入町", "addr": "537-50", "level": 3, "lat": 35.01217, "lng": 135.769483})
})

test('京都府宇治市莵道森本8−10', async () => {
const res = await normalize('京都府宇治市莵道森本8−10')
expect(res).toStrictEqual({"pref": "京都府", "city": "宇治市", "town": "莵道", "addr": "森本8-10", "level": 3, "lat": 34.904244, "lng": 135.827041})
})

test('京都府京都市中京区河原町二条下ル一之舟入町537-50(船と舟のゆらぎ)', async () => {
const res = await normalize('京都府京都市中京区河原町二条下ル一之船入町537-50')
expect(res).toStrictEqual({"pref": "京都府", "city": "京都市中京区", "town": "一之船入町", "addr": "537-50", "level": 3, "lat": 35.01217, "lng": 135.769483})
})

test('京都府宇治市莵道森本8−10(莵と菟のゆらぎ)', async () => {
const res = await normalize('京都府宇治市菟道森本8−10')
expect(res).toStrictEqual({"pref": "京都府", "city": "宇治市", "town": "莵道", "addr": "森本8-10", "level": 3, "lat": 34.904244, "lng": 135.827041})
})

// 「都道府県」の文字列を省略した場合
test('岩手花巻市12丁目704', async () => {
const res = await normalize('岩手花巻市12丁目704')
Expand Down

0 comments on commit c2cab1c

Please sign in to comment.