Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cumulative bugs and add features #4

Merged
merged 54 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
0972c5a
Rename 正則化韻 to 韻目到韻
ayaka14732 Jun 1, 2021
275d360
Change 母到組 to function
ayaka14732 Jun 1, 2021
20e9139
Fix circular dependencies
ayaka14732 Jun 1, 2021
c37539a
Change 母到音 to function
ayaka14732 Jun 2, 2021
4440076
Change 韻到攝 to function
ayaka14732 Jun 2, 2021
307b368
Fix bug
ayaka14732 Jun 2, 2021
b459218
Change 母到清濁 to function
ayaka14732 Jun 2, 2021
aaac0e5
Update documentation
ayaka14732 Jun 2, 2021
d6d2697
Move 元韻 to 山攝
ayaka14732 Jun 2, 2021
900157e
Change 欣韻 to 殷韻
ayaka14732 Jun 2, 2021
1ad2ab0
Fix bug
ayaka14732 Jun 3, 2021
81bcf30
Change 眞韻 to 真韻
ayaka14732 Jun 3, 2021
b0f03ea
Add 容錯 for 欣韻 and 眞韻
ayaka14732 Jun 3, 2021
57d9256
Fix bug
ayaka14732 Jun 4, 2021
4b208d8
Fix bug
ayaka14732 Jun 5, 2021
7d992d1
Add class 韻鏡位置
ayaka14732 Jun 7, 2021
c42c9db
Update documentation
ayaka14732 Jun 7, 2021
dc2541e
Rename 開合皆有的韻 to 開合兼備的韻
ayaka14732 Jun 7, 2021
92394b1
Minor fix
ayaka14732 Jun 8, 2021
a1211a4
Add 音韻地位.is_normal
ayaka14732 Jun 8, 2021
3d46ab9
Minor fix
ayaka14732 Jun 8, 2021
c54bfb2
Add 音韻地位到韻鏡位置, 韻鏡位置到音韻地位 and 音韻屬性到韻鏡位置們
ayaka14732 Jun 8, 2021
21edc3a
Add __hash__ method
ayaka14732 Jun 9, 2021
1f71609
Implement 音韻屬性到韻鏡位置們
ayaka14732 Jun 9, 2021
7d373ba
Implement 韻鏡位置到音韻地位
ayaka14732 Jun 9, 2021
a1e637d
Fix bug
ayaka14732 Jun 9, 2021
bb126b5
Fix bug
ayaka14732 Jun 9, 2021
a94ecac
Fix bug
ayaka14732 Jun 9, 2021
5d68a8d
Fix bug
ayaka14732 Jun 10, 2021
90f6f53
Implement more methods for 韻鏡位置
ayaka14732 Jun 10, 2021
7aa2727
Fix bug
ayaka14732 Jun 10, 2021
8bf6baa
Support Python 3.10 and drop support of Python 3.6
ayaka14732 Jul 10, 2021
935450d
Fix bug
ayaka14732 Jul 10, 2021
e46cb11
Fix bug
ayaka14732 Jul 10, 2021
64fd85c
Fix bug
ayaka14732 Jul 10, 2021
8c3ba9d
Add comparison operations for 音韻地位
ayaka14732 Aug 9, 2021
71e3ca5
Update src/QieyunEncoder/工具/韻目到韻.py
ayaka14732 Sep 26, 2021
0693527
Implement 五十一聲類
ayaka14732 Feb 8, 2022
625fc1e
Add 韻目 variants from 切韻諸本輯覽 and 集韻
untunt Feb 9, 2022
e82cd3a
Add 韻目 variants
ayaka14732 Mar 19, 2022
0081f3b
Undo commited modifications
ayaka14732 Apr 18, 2024
331ad91
Undo
ayaka14732 Apr 18, 2024
70e891d
Undo
ayaka14732 Apr 18, 2024
2da2216
Merge branch 'main' into feat-0.5.x
ayaka14732 Apr 18, 2024
094f76b
Update
ayaka14732 Apr 18, 2024
63ccd3d
Update
ayaka14732 Apr 18, 2024
0fa92a7
Update
ayaka14732 Apr 18, 2024
fd2e431
Update
ayaka14732 Apr 18, 2024
fdad9a8
Update
ayaka14732 Apr 18, 2024
0492000
Fix tests
ayaka14732 Apr 18, 2024
1b24342
Fix tests
ayaka14732 Apr 18, 2024
9303921
Add tests
ayaka14732 Apr 18, 2024
192e3e7
Update
ayaka14732 Apr 19, 2024
a4c04eb
Update
ayaka14732 Apr 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: ["3.7", "3.8", "3.9", "3.10.0-beta.3"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setup(
name='qieyun-encoder',
version='0.4.2',
version='0.5.0',
description='A Python library for the operating the basic structure of the Qieyun phonological system',
long_description=long_description,
long_description_content_type='text/markdown',
Expand All @@ -25,15 +25,15 @@
'Natural Language :: Chinese (Traditional)',
'License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9'
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
],
keywords='middle-chinese historical-linguistics qieyun',
packages=find_packages('src'),
package_dir={'': 'src'},
python_requires='>=3.6, <4',
python_requires='>=3.7, <4',
entry_points={},
project_urls={
'Bug Reports': 'https://github.com/nk2028/qieyun-encoder-python/issues',
Expand Down
13 changes: 11 additions & 2 deletions src/QieyunEncoder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

from .常量 import 常量
from .音韻地位 import 音韻地位
from .工具 import 反切, 正則化韻
from .韻鏡位置 import 韻鏡位置
from .工具.反切 import 反切
from .工具.韻目到韻 import 韻目到韻
from .工具.母到清濁 import 母到清濁
from .工具.母到組 import 母到組
from .工具.母到音 import 母到音
from .工具.韻到攝 import 韻到攝
from .工具.音韻地位到韻鏡位置 import 音韻地位到韻鏡位置
from .工具.韻鏡位置到音韻地位 import 韻鏡位置到音韻地位
from .工具.音韻屬性到韻鏡位置們 import 音韻屬性到韻鏡位置們

__version__ = '0.4.2'
__version__ = '0.5.0'
106 changes: 0 additions & 106 deletions src/QieyunEncoder/_拓展音韻屬性.py

This file was deleted.

43 changes: 43 additions & 0 deletions src/QieyunEncoder/_母對應的標準等.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# -*- coding: utf-8 -*-

# 實際可能超出此範圍,即「無音有字」
母對應的標準等 = {
'幫': '一二三四',
'滂': '一二三四',
'並': '一二三四',
'明': '一二三四',
'端': '一四',
'透': '一四',
'定': '一四',
'泥': '一四',
'來': '一二三四',
'知': '二三',
'徹': '二三',
'澄': '二三',
'孃': '二三',
'精': '一三四',
'清': '一三四',
'從': '一三四',
'心': '一三四',
'邪': '三',
'莊': '二三',
'初': '二三',
'崇': '二三',
'生': '二三',
'俟': '三',
'章': '三',
'昌': '三',
'常': '三',
'書': '三',
'船': '三',
'日': '三',
'見': '一二三四',
'溪': '一二三四',
'羣': '三',
'疑': '一二三四',
'影': '一二三四',
'曉': '一二三四',
'匣': '一二四',
'云': '三',
'以': '三',
}
3 changes: 0 additions & 3 deletions src/QieyunEncoder/工具/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@
'''
與切韻音系相關的工具。
'''

from .反切 import 反切
from .正則化韻 import 正則化韻
4 changes: 2 additions & 2 deletions src/QieyunEncoder/工具/反切.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from typing import List
from ..常量 import 常量
from ..音韻地位 import 音韻地位
from .._拓展音韻屬性 import 母到標準等
from .._母對應的標準等 import 母對應的標準等


def _jointer(xs: List[str]):
Expand Down Expand Up @@ -139,7 +139,7 @@ def 反切(上字音韻地位: 音韻地位, 下字音韻地位: 音韻地位,

# 母對等的約束

標準等 = 母到標準等[母]
標準等 = 母對應的標準等[母]
if any(等1 not in 標準等 for 等1 in 等):
等 = ''.join(等1 for 等1 in 等 if 等1 in 標準等)
步驟.append(f'{母}母只能爲{標準等}等')
Expand Down
85 changes: 0 additions & 85 deletions src/QieyunEncoder/工具/正則化韻.py

This file was deleted.

28 changes: 28 additions & 0 deletions src/QieyunEncoder/工具/母到清濁.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-

'''
將母轉換爲清濁。
'''

_清濁到母表 = (
('全清', '幫端知精心莊生章書見影曉'),
('次清', '滂透徹清初昌溪'),
('全濁', '並定澄從邪崇俟常船羣匣'),
('次濁', '明泥孃來日疑云以'),
)

_d母到清濁 = {母: 清濁 for 清濁, 母們 in _清濁到母表 for 母 in 母們}


def 母到清濁(母: str):
'''
將母轉換爲清濁。

```python
>>> 母到清濁('端')
'全清'
>>> 母到清濁('以')
'次濁'
```
'''
return _d母到清濁[母]
35 changes: 35 additions & 0 deletions src/QieyunEncoder/工具/母到組.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-

'''
將母轉換爲組。
'''

_組到母表 = (
('幫', '幫滂並明'),
('端', '端透定泥'),
('知', '知徹澄孃'),
('精', '精清從心邪'),
('莊', '莊初崇生俟'),
('章', '章昌船書常'),
('見', '見溪羣疑'),
('影', '影曉匣云'),
(None, '來日以'),
)

_d母到組 = {母: 組 for 組, 母們 in _組到母表 for 母 in 母們}


def 母到組(母: str):
'''
將母轉換爲組。

```python
>>> 母到組('滂')
'幫'
>>> 母到組('云')
'影'
>>> 母到組('以')
None
```
'''
return _d母到組[母]
Loading