Skip to content

Commit cdc5015

Browse files
authored
Merge pull request #135 from ku-nlp/develop
Release
2 parents f97ae7a + d988c10 commit cdc5015

File tree

15 files changed

+317
-289
lines changed

15 files changed

+317
-289
lines changed

.github/workflows/test-example.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
python-version: ["3.8", "3.9", "3.10"]
16+
python-version: ["3.8", "3.9", "3.10", "3.11"]
1717
steps:
1818
- name: Checkout repository
1919
uses: actions/checkout@v3

.github/workflows/test.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,13 @@ jobs:
3737
path: /tmp/kwja
3838
key: kwja-${{ env.KWJA_VERSION }}
3939
- name: Run tests with KWJA
40-
# KWJA does not support Python 3.7 and 3.11
41-
if: ${{ matrix.python-version != 3.7 && matrix.python-version != 3.11 }}
40+
# KWJA does not support Python 3.7
41+
if: ${{ matrix.python-version != 3.7 }}
4242
run: |
4343
pipx install kwja
44-
ulimit -n 4096
4544
poetry run pytest --cov=./ --cov-report=xml -v ./tests
4645
- name: Run tests without KWJA
47-
if: ${{ matrix.python-version == 3.7 || matrix.python-version == 3.11 }}
46+
if: ${{ matrix.python-version == 3.7 }}
4847
run: |
4948
poetry run pytest -v --ignore ./tests/processors/test_kwja.py ./tests
5049
- name: Upload coverage to Codecov

.pre-commit-config.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ repos:
2525
hooks:
2626
- id: absolufy-imports
2727
- repo: https://github.com/pre-commit/mirrors-mypy
28-
rev: v1.2.0
28+
rev: v1.3.0
2929
hooks:
3030
- id: mypy
3131
additional_dependencies:
@@ -34,8 +34,9 @@ repos:
3434
- rich
3535
- uvicorn
3636
- fastapi
37+
- markdown-it-py==2.2.0
3738
- repo: https://github.com/asottile/pyupgrade
38-
rev: v3.3.2
39+
rev: v3.6.0
3940
hooks:
4041
- id: pyupgrade
4142
args:
@@ -45,6 +46,6 @@ repos:
4546
hooks:
4647
- id: pydocstyle
4748
- repo: https://github.com/pre-commit/mirrors-prettier
48-
rev: v2.7.1
49+
rev: v3.0.0-alpha.9-for-vscode
4950
hooks:
5051
- id: prettier

README.md

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,22 @@
1616
<a href="https://github.com/psf/black"><img alt="Code style - black" src="https://img.shields.io/badge/code%20style-black-222222?style=flat-square"></a>
1717
</p>
1818

19+
---
20+
21+
**Documentation**: [https://rhoknp.readthedocs.io/en/latest/](https://rhoknp.readthedocs.io/en/latest/)
22+
23+
**Source Code**: [https://github.com/ku-nlp/rhoknp](https://github.com/ku-nlp/rhoknp)
24+
25+
---
26+
1927
_rhoknp_ is a Python binding for [Juman++](https://github.com/ku-nlp/jumanpp), [KNP](https://github.com/ku-nlp/knp), and [KWJA](https://github.com/ku-nlp/kwja).[^1]
2028

21-
[^1]: The logo was originally generated using OpenAI DALL·E 2
29+
[^1]: The logo was generated by OpenAI DALL·E 2.
2230

2331
```python
2432
import rhoknp
2533

26-
# Perform language analysis by Juman++
34+
# Perform morphological analysis by Juman++
2735
jumanpp = rhoknp.Jumanpp()
2836
sentence = jumanpp.apply_to_sentence(
2937
"電気抵抗率は電気の通しにくさを表す物性値である。"
@@ -33,47 +41,40 @@ sentence = jumanpp.apply_to_sentence(
3341
for morpheme in sentence.morphemes: # a.k.a. keitai-so
3442
...
3543

36-
# Save language analysis by Juman++
44+
# Save the result
3745
with open("result.jumanpp", "wt") as f:
3846
f.write(sentence.to_jumanpp())
3947

40-
# Load language analysis by Juman++
48+
# Load the result
4149
with open("result.jumanpp", "rt") as f:
4250
sentence = rhoknp.Sentence.from_jumanpp(f.read())
4351
```
4452

4553
## Requirements
4654

4755
- Python 3.7+
48-
49-
## Optional requirements for language analysis
50-
51-
- [Juman++](https://github.com/ku-nlp/jumanpp) v2.0.0-rc3+
52-
- [KNP](https://github.com/ku-nlp/knp) 5.0+
53-
- [KWJA](https://github.com/ku-nlp/kwja) 1.0.0+
56+
- (Optional) [Juman++](https://github.com/ku-nlp/jumanpp) v2.0.0-rc3+
57+
- (Optional) [KNP](https://github.com/ku-nlp/knp) 5.0+
58+
- (Optional) [KWJA](https://github.com/ku-nlp/kwja) 1.0.0+
5459

5560
## Installation
5661

5762
```shell
5863
pip install rhoknp
5964
```
6065

61-
## Documentation
62-
63-
[https://rhoknp.readthedocs.io/en/latest/](https://rhoknp.readthedocs.io/en/latest/)
64-
6566
## Quick tour
6667

67-
Let's start with using Juman++ with _rhoknp_.
68-
Here is a simple example of using Juman++ to analyze a sentence.
68+
Let's begin by using Juman++ with rhoknp.
69+
Here, we present a simple example demonstrating how Juman++ can be used to analyze a sentence.
6970

7071
```python
71-
# Perform language analysis by Juman++
72+
# Perform morphological analysis by Juman++
7273
jumanpp = rhoknp.Jumanpp()
7374
sentence = jumanpp.apply_to_sentence("電気抵抗率は電気の通しにくさを表す物性値である。")
7475
```
7576

76-
You can easily access the morphemes that make up the sentence.
77+
You can easily access the individual morphemes that make up the sentence.
7778

7879
```python
7980
for morpheme in sentence.morphemes: # a.k.a. keitai-so
@@ -125,7 +126,7 @@ with open("sentence.knp", "rt") as f:
125126
sentence = rhoknp.Sentence.from_knp(f.read())
126127
```
127128

128-
_rhoknp_ also provides APIs for document-level language analysis.
129+
Furthermore, rhoknp provides convenient APIs for document-level language analysis.
129130

130131
```python
131132
document = rhoknp.Document.from_raw_text(
@@ -140,10 +141,10 @@ document = rhoknp.Document.from_sentences(
140141
)
141142
```
142143

143-
Document objects can be handled in almost the same way as Sentence objects.
144+
Document objects can be handled in a similar manner as Sentence objects.
144145

145146
```python
146-
# Perform language analysis by Juman++
147+
# Perform morphological analysis by Juman++
147148
document = jumanpp.apply_to_document(document)
148149

149150
# Access language units in the document
@@ -161,25 +162,25 @@ with open("document.jumanpp", "rt") as f:
161162
document = rhoknp.Document.from_jumanpp(f.read())
162163
```
163164

164-
For more information, explore the [examples](./examples) and [documentation](https://rhoknp.readthedocs.io/en/latest/).
165+
For more information, please refer to the [examples](./examples) and [documentation](https://rhoknp.readthedocs.io/en/latest/).
165166

166167
## Main differences from [pyknp](https://github.com/ku-nlp/pyknp/)
167168

168-
[_pyknp_](https://pypi.org/project/pyknp/) has been developed as the official Python binding for Juman++ and KNP.
169-
In _rhoknp_, we redesigned the API from the top-down, taking into account the current use cases of _pyknp_.
170-
The main differences are as follows:
169+
[_pyknp_](https://pypi.org/project/pyknp/) serves as the official Python binding for Juman++ and KNP.
170+
In the development of rhoknp, we redesigned the API, considering the current use cases of pyknp.
171+
The key differences between the two are as follows:
171172

172-
- **Support for document-level language analysis**: _rhoknp_ can load and instantiate the result of document-level language analysis (i.e., cohesion analysis and discourse relation analysis).
173-
- **Strictly type-aware**: _rhoknp_ is thoroughly annotated with type annotations.
174-
- **Extensive test suite**: _rhoknp_ is tested with an extensive test suite. See the code coverage at [Codecov](https://app.codecov.io/gh/ku-nlp/rhoknp).
173+
- **Support for document-level language analysis**: rhoknp allows you to load and instantiate the results of document-level language analysis, including cohesion analysis and discourse relation analysis.
174+
- **Strict type-awareness**: rhoknp has been thoroughly annotated with type annotations, ensuring strict type checking and improved code clarity.
175+
- **Comprehensive test suite**: rhoknp is extensively tested with a comprehensive test suite. You can view the code coverage report on [Codecov](https://app.codecov.io/gh/ku-nlp/rhoknp).
175176

176177
## License
177178

178179
MIT
179180

180181
## Contributing
181182

182-
We welcome contributions to _rhoknp_.
183+
We warmly welcome contributions to rhoknp.
183184
You can get started by reading the [contribution guide](https://rhoknp.readthedocs.io/en/latest/contributing/index.html).
184185

185186
## Reference

0 commit comments

Comments
 (0)