q9uri
commited on
Commit
·
9ef5a80
1
Parent(s):
e36b461
add jtalkdic-ud-place-names
Browse files- src/ja/openjtalk-dictionarys/jtalkdic-ud-place-names/.gitignore +1 -0
- src/ja/openjtalk-dictionarys/jtalkdic-ud-place-names/LICENSE +3 -0
- src/ja/openjtalk-dictionarys/jtalkdic-ud-place-names/README.md +21 -0
- src/ja/openjtalk-dictionarys/jtalkdic-ud-place-names/build/jtalkdic-ud-place-names-ipadic.csv +3 -0
- src/ja/openjtalk-dictionarys/jtalkdic-ud-place-names/build/jtalkdic-ud-place-names-noacc.csv +3 -0
- src/ja/openjtalk-dictionarys/jtalkdic-ud-place-names/convert.py +43 -0
- src/ja/openjtalk-dictionarys/jtalkdic-ud-place-names/mozcdic-ut-place-names.txt.bz2 +3 -0
- src/ja/openjtalk-dictionarys/jtalkdic-ud-place-names/requirements.txt +1 -0
src/ja/openjtalk-dictionarys/jtalkdic-ud-place-names/.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
.venv
|
src/ja/openjtalk-dictionarys/jtalkdic-ud-place-names/LICENSE
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[Public Domain](https://www.post.japanpost.jp/zipcode/dl/readme.html)
|
| 2 |
+
|
| 3 |
+
> 郵便番号データに限っては日本郵便株式会社は著作権を主張しません。
|
src/ja/openjtalk-dictionarys/jtalkdic-ud-place-names/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
## Overview
|
| 2 |
+
|
| 3 |
+
A dictionary converted from the [Japan Post's ZIP code data](https://www.post.japanpost.jp/zipcode/download.html) for Mozc.
|
| 4 |
+
|
| 5 |
+
Thanks to the Japan Post's ZIP code data team.
|
| 6 |
+
|
| 7 |
+
## License
|
| 8 |
+
|
| 9 |
+
[Public Domain](https://www.post.japanpost.jp/zipcode/dl/readme.html)
|
| 10 |
+
|
| 11 |
+
> 郵便番号データに限っては日本郵便株式会社は著作権を主張しません。
|
| 12 |
+
|
| 13 |
+
## Usage
|
| 14 |
+
|
| 15 |
+
See [merge-ut-dictionaries](https://github.com/utuhiro78/merge-ut-dictionaries).
|
| 16 |
+
|
| 17 |
+
## Source
|
| 18 |
+
|
| 19 |
+
https://github.com/utuhiro78/merge-ut-dictionaries/tree/main/src
|
| 20 |
+
|
| 21 |
+
[HOME](http://linuxplayers.g1.xrea.com/mozc-ut.html)
|
src/ja/openjtalk-dictionarys/jtalkdic-ud-place-names/build/jtalkdic-ud-place-names-ipadic.csv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:98c299a815f385782602a0746076c52c21ed4c6ccc95d8b8e2b2b2cdbfb828e3
|
| 3 |
+
size 31411412
|
src/ja/openjtalk-dictionarys/jtalkdic-ud-place-names/build/jtalkdic-ud-place-names-noacc.csv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:30cf4d01c282ce942da7a27f82e3707f039852c7f6b1537d4800abf891900577
|
| 3 |
+
size 32697836
|
src/ja/openjtalk-dictionarys/jtalkdic-ud-place-names/convert.py
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from pathlib import Path
|
| 2 |
+
import jaconv
|
| 3 |
+
import bz2
|
| 4 |
+
|
| 5 |
+
def is_hiragana(text):
|
| 6 |
+
hira_list = "ぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろゎわゐゑをんゔ"
|
| 7 |
+
for i in range( len(text)):
|
| 8 |
+
if text[i] not in hira_list:
|
| 9 |
+
return False
|
| 10 |
+
return True
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
with bz2.open("./mozcdic-ut-place-names.txt.bz2", "rt", encoding="utf-8") as f:
|
| 14 |
+
data = f.read()
|
| 15 |
+
|
| 16 |
+
data = data.split("\n")
|
| 17 |
+
|
| 18 |
+
out = []
|
| 19 |
+
for line in data:
|
| 20 |
+
split_line = line.split("\t")
|
| 21 |
+
if len(split_line) >= 2:
|
| 22 |
+
surface = split_line[4]
|
| 23 |
+
yomi = split_line[0]
|
| 24 |
+
yomi = jaconv.kata2hira(yomi)
|
| 25 |
+
if is_hiragana(yomi):
|
| 26 |
+
|
| 27 |
+
new_line = f"{surface},1345,1345,8000,名詞,一般,*,*,*,*,{surface},{yomi},{yomi}"
|
| 28 |
+
out.append((new_line))
|
| 29 |
+
|
| 30 |
+
Path("./build/jtalkdic-ud-place-names-ipadic.csv").write_text("\n".join(out), encoding="utf-8")
|
| 31 |
+
|
| 32 |
+
out = []
|
| 33 |
+
for line in data:
|
| 34 |
+
split_line = line.split("\t")
|
| 35 |
+
if len(split_line) >= 2:
|
| 36 |
+
surface = split_line[4]
|
| 37 |
+
yomi = split_line[0]
|
| 38 |
+
if is_hiragana(yomi):
|
| 39 |
+
yomi = jaconv.hira2kata(yomi)
|
| 40 |
+
new_line = f"{surface},1345,1345,8000,名詞,一般,*,*,*,*,{surface},{yomi},{yomi},*/*,*"
|
| 41 |
+
out.append((new_line))
|
| 42 |
+
|
| 43 |
+
Path("./build/jtalkdic-ud-place-names-noacc.csv").write_text("\n".join(out), encoding="utf-8")
|
src/ja/openjtalk-dictionarys/jtalkdic-ud-place-names/mozcdic-ut-place-names.txt.bz2
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:db579d26ea9d3ea0581869fb82a7ce1f8337b4119a07c7a1d3a31f3f4f023ddd
|
| 3 |
+
size 1742919
|
src/ja/openjtalk-dictionarys/jtalkdic-ud-place-names/requirements.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
jaconv
|