-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
411 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# URS-003 解構方音符號 | ||
|
||
## 摘要 | ||
|
||
將【方音符號】解構成:【聲母】、【韻母】、【調符】。 | ||
|
||
如: | ||
|
||
1. 歸:ㄍㄨㄧ | ||
- 聲母:ㄍ | ||
- 韻母:ㄨㄧ | ||
- 調符:1 | ||
|
||
2. 己:ㄧˋ | ||
- 聲母: | ||
- 韻母:ㄧ | ||
- 調符:2 | ||
|
||
3. 敬:ㄍㄧㄥ˪ | ||
- 聲母:ㄍ | ||
- 韻母:ㄧㄥ | ||
- 調符:3 | ||
|
||
4. 覺:ㄍㄚㆻ | ||
- 聲母:ㄍ | ||
- 韻母:ㄚㆻ | ||
- 調符:4 | ||
|
||
5. 來:ㄌㄞˊ | ||
- 聲母:ㄌ | ||
- 韻母:ㄞ | ||
- 調符:5 | ||
|
||
7. 是:ㄒㄧ˫ | ||
- 聲母:ㄒ | ||
- 韻母:ㄧ | ||
- 調符:7 | ||
|
||
8. 獨:ㄉㄚㆻ˙ | ||
- 聲母:ㄉ | ||
- 韻母:ㄚㆻ | ||
- 調符:7 | ||
|
||
|
||
## 拆解流程 | ||
|
||
1. 檢查輸入之【方音符號】的最尾一個字元是否為【方音調符】。若有,對映成【調號】。 | ||
|
||
檢查用之 pattern 。 | ||
|
||
```python | ||
HongImTiauHu = re.compile(r"ˋ|˪|ˊ|˫|\u02D9", re.I) | ||
``` | ||
|
||
透過 Dictionary 對映,將【方音調號】對映成【調號】。 | ||
|
||
```python | ||
Hong_Im_Tiau_Hu_Dict = { | ||
"ˋ" : 2, | ||
"˪" : 3, | ||
"ˊ" : 5, | ||
"˫" : 7, | ||
"\u02D9": 8, | ||
} | ||
``` | ||
|
||
2. 判斷沒有【方音調符】的【方音符號】,是第一聲?還是第四聲? | ||
|
||
若是【方音符號】最尾端的字元為:ㆴ、ㆵ、ㆻ、ㆷ,則表示為第四聲(陰入); | ||
若否,則為第一聲(陰平)。 | ||
|
||
3. 將【方音符號】剔除【方音調符】成為:【無調符方音符號】。 | ||
|
||
如: | ||
|
||
- 【方音符號】:ㄒㄧ˫ ==> 【無調符方音符號】: ㄒㄧ | ||
- 【方音符號】:ㄉㄧㆲ˪ ==> 【無調符方音符號】: ㄉㄧㆲ | ||
|
||
4. 將【無調符方音符號】的第一個字元抽出當【聲母】;餘下的【無調符方音符號】 | ||
當作【韻母】。 | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.