Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
22852ba
start new dev cycle
r9y9 Aug 22, 2023
df77b13
test
r9y9 Nov 4, 2023
c1377bc
update submodule open_jtalk
r9y9 Nov 5, 2023
e74b4e5
remove cython upper bound
r9y9 Nov 5, 2023
f0decaa
Merge pull request #71 from r9y9/test
r9y9 Nov 5, 2023
f273bd5
prep for v0.3.3
r9y9 Nov 5, 2023
6928f45
start new dev cycle
r9y9 Nov 5, 2023
b0f0250
Add user dic support
r9y9 Nov 18, 2023
e8955a6
add userdict support in README
r9y9 Nov 18, 2023
6740742
fix tests
r9y9 Nov 18, 2023
26fcdd9
Merge pull request #72 from r9y9/userdic
r9y9 Nov 18, 2023
60acd92
ENH: support python3.12
sabonerune Dec 12, 2023
48dd78c
Merge pull request #73 from sabonerune/enh/support-py312
r9y9 Dec 13, 2023
5199948
BLD: remove distutil from setup.py
sabonerune Feb 27, 2024
8b942a8
FIX: remove legacy API
sabonerune Dec 16, 2023
039ff28
MAINT: Bump up `actions/checkout` ` actions/setup-python`
sabonerune May 22, 2024
ba2fcd1
FIX: skip Lint with pysen if 3.7
sabonerune May 22, 2024
a4f5e69
Merge pull request #74 from sabonerune/fix/remove-legacy-api
r9y9 Jul 13, 2024
f0d4d22
Merge pull request #77 from sabonerune/bld/remove-distutil
r9y9 Jul 13, 2024
935ed40
Merge pull request #80 from sabonerune/maint/fix-ci
r9y9 Jul 13, 2024
861a792
drop python 3.7
r9y9 Jul 13, 2024
d88a275
Merge pull request #81 from r9y9/drop37
r9y9 Jul 13, 2024
7fb1548
update open_jtalk rev
r9y9 Jul 13, 2024
e918dc7
Merge pull request #82 from r9y9/update-ojt
r9y9 Jul 13, 2024
2d55a08
v0.3.4
r9y9 Jul 13, 2024
a3e2115
bump new dev ver
r9y9 Jul 13, 2024
c362dae
BLD: Declarative config
sabonerune Oct 21, 2024
9c7a9e1
ENH: Release GIL in `mecab_dict_index`
sabonerune Oct 24, 2024
3f20a06
ENH: Optimizations and larger scope of GIL release.
sabonerune Nov 3, 2024
5374f0c
ENH: Add mutex for global instance
sabonerune Nov 4, 2024
9bbebfb
ENH: Add lock.
sabonerune Nov 21, 2024
3c9894f
Merge pull request #87 from sabonerune/enh/add-mutex
r9y9 Dec 10, 2024
5f07318
Update pyproject.toml
sabonerune Dec 11, 2024
341b337
Update pyproject.toml
sabonerune Dec 11, 2024
dfb2451
Update pyproject.toml
sabonerune Dec 11, 2024
a8140bf
Update pyproject.toml
sabonerune Dec 11, 2024
3a91d16
Merge pull request #85 from sabonerune/bld/declarative-config
r9y9 Dec 11, 2024
73173e8
TST: Add test.
sabonerune Dec 14, 2024
acfb7c0
FIX: Fix setuptools warning.
sabonerune Dec 19, 2024
e01c0a9
FIX: Fix or suppress the warning.
sabonerune Dec 20, 2024
0cedad1
Merge pull request #88 from sabonerune/enh/release-gil
r9y9 Dec 25, 2024
42cf16f
Merge pull request #90 from sabonerune/fix/setuptools-warning
r9y9 Dec 25, 2024
36acdff
FIX: Revert to `cython>=0.28.0`
sabonerune Dec 25, 2024
d9e08a8
FIX: fix Cython version.
sabonerune Dec 26, 2024
723bdde
Merge branch 'master' into fix/fix-or-suppress-warning
r9y9 Dec 26, 2024
eaed6bb
Merge pull request #91 from sabonerune/fix/fix-or-suppress-warning
r9y9 Dec 26, 2024
0ad5462
pypi upload by github actions
r9y9 Jan 22, 2025
bcf81cb
Merge pull request #93 from r9y9/pypi
r9y9 Jan 22, 2025
4ae89cc
remove release.sh as it is no longer necessary
r9y9 Jan 24, 2025
65976e4
Merge pull request #95 from r9y9/fix-release
r9y9 Jan 24, 2025
ae1a729
update open_jtalk for #99
r9y9 Mar 31, 2025
6eab639
Merge tag 'v0.4.0' into mnt/merge-v0.4.0
sabonerune Apr 3, 2025
6ee84b9
FIX: fix warning `release.sh`.
sabonerune Apr 3, 2025
fd8864e
simplify cmake command
r9y9 Apr 8, 2025
92bb01b
Merge pull request #100 from r9y9/fix-cmake4
r9y9 Apr 8, 2025
0f0fc44
Merge pull request #101 from sabonerune/fix/MANIFEST-in
r9y9 Apr 8, 2025
6bf482b
Merge tag 'v0.4.1' into mnt/merge-v0.4.0
sabonerune Apr 8, 2025
62d76b3
FIX: `unset_user_dict()`を復活
sabonerune Apr 17, 2025
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
89 changes: 83 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,37 @@ name: Python package
on:
push:
branches: [ master ]
tags:
- 'v*'
pull_request:
branches: [ master ]

jobs:
build:

test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
python-version: 3.7
- os: ubuntu-latest
python-version: 3.8
- os: ubuntu-latest
python-version: 3.9
- os: ubuntu-latest
python-version: '3.10'
- os: ubuntu-latest
python-version: '3.11'
- os: macos-latest
python-version: 3.9
- os: windows-latest
python-version: 3.9

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -48,3 +50,78 @@ jobs:
run: |
pip install pytest
pytest

build-for-publish:
name: Build distribution 📦
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags')"
needs: test
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade build

- name: Build a source tarball and wheel
run: python -m build .

- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
# NOTE: for now upload sdist only to prevent errors like unsupported platform tag 'linux_x86_64'.
path: dist/*.tar.gz

publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build-for-publish
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/pyopenjtalk
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true

# NOTE: for testing purposes only
# publish-to-testpypi:
# name: Publish Python 🐍 distribution 📦 to TestPyPI
# needs:
# - build-for-publish
# runs-on: ubuntu-latest
# environment:
# name: testpypi
# url: https://test.pypi.org/p/pyopenjtalk
# permissions:
# id-token: write # IMPORTANT: mandatory for trusted publishing
# steps:
# - name: Download all the dists
# uses: actions/download-artifact@v4
# with:
# name: python-package-distributions
# path: dist/
# - name: Publish distribution 📦 to TestPyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# repository-url: https://test.pypi.org/legacy/
# verbose: true
9 changes: 6 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
include README.md LICENSE.md
recursive-include pyopenjtalk *.cpp *.pxd *.md *.pyx
recursive-include lib *.cpp *.c *.h README LICENSE COPYING CMakeLists.txt *.in
include pyopenjtalk/version.py
exclude .gitignore .gitmodules .travis.yml tox.ini
prune .github/*
prune docs/**
recursive-include lib *.cpp *.c *.h README COPYING CMakeLists.txt *.in
exclude lib/open_jtalk/src/mecab/src/config.h
prune lib/open_jtalk/src/build/**
54 changes: 29 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,52 +105,56 @@ In [3]: pyopenjtalk.g2p("こんにちは", kana=True)
Out[3]: 'コンニチワ'
```

### About `run_marine` option
### Create/Apply user dictionary

After v0.3.0, the `run_marine` option has been available for estimating the Japanese accent with the DNN-based method (see [marine](https://github.com/6gsn/marine)). If you want to use the feature, please install pyopenjtalk as below;
1. Create a CSV file (e.g. `user.csv`) and write custom words like below:

```shell
pip install pyopenjtalk[marine]
```csv
GNU,,,1,名詞,一般,*,*,*,*,GNU,グヌー,グヌー,2/3,*
```

And then, you can use the option as the following examples;
2. Call `mecab_dict_index` to compile the CSV file.

```python
In [1]: import pyopenjtalk

In [2]: x, sr = pyopenjtalk.tts("おめでとうございます", run_marine=True) # for TTS
In [2]: pyopenjtalk.mecab_dict_index("user.csv", "user.dic")
reading user.csv ... 1
emitting double-array: 100% |###########################################|

In [3]: label = pyopenjtalk.extract_fullcontext("こんにちは", run_marine=True) # for text processing frontend only
done!
```

### Create/Apply user dictionary
3. Call `update_global_jtalk_with_user_dict` to apply the user dictionary.

1. Create a CSV file (e.g. `user.csv`) and write custom words like below:
```python
In [3]: pyopenjtalk.g2p("GNU")
Out[3]: 'j i i e n u y u u'

```csv
GNU,,,1,名詞,一般,*,*,*,*,GNU,グヌー,グヌー,2/3,*
In [4]: pyopenjtalk.update_global_jtalk_with_user_dict("user.dic")

In [5]: pyopenjtalk.g2p("GNU")
Out[5]: 'g u n u u'
```

2. Call `create_user_dict` to compile the CSV file.
### About `run_marine` option

```
>>> import pyopenjtalk
>>> pyopenjtalk.create_user_dict("user.csv", "user.dic")
reading user.csv ... 1
emitting double-array: 100% |###########################################|
After v0.3.0, the `run_marine` option has been available for estimating the Japanese accent with the DNN-based method (see [marine](https://github.com/6gsn/marine)). If you want to use the feature, please install pyopenjtalk as below;

done!
```shell
pip install pyopenjtalk[marine]
```

3. Call `set_user_dict` to apply the user dictionary.
And then, you can use the option as the following examples;

```python
In [1]: import pyopenjtalk

In [2]: x, sr = pyopenjtalk.tts("おめでとうございます", run_marine=True) # for TTS

In [3]: label = pyopenjtalk.extract_fullcontext("こんにちは", run_marine=True) # for text processing frontend only
```
>>> pyopenjtalk.g2p("GNU")
'j i i e n u y u u'
>>> pyopenjtalk.set_user_dict("user.dic")
>>> pyopenjtalk.g2p("GNU")
'g u n u u'
```


## LICENSE

Expand Down
Loading