https://github.com/poyo46/jadoc
Tokenizes Japanese documents to enable CRUD operations.
https://github.com/poyo46/jadoc
conjugate crud inflect japanese mecab nlp tokenize
Last synced: 4 months ago
JSON representation
Tokenizes Japanese documents to enable CRUD operations.
- Host: GitHub
- URL: https://github.com/poyo46/jadoc
- Owner: poyo46
- License: apache-2.0
- Created: 2021-01-01T06:53:21.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-02-02T19:27:18.000Z (over 5 years ago)
- Last Synced: 2025-09-28T07:23:48.631Z (10 months ago)
- Topics: conjugate, crud, inflect, japanese, mecab, nlp, tokenize
- Language: Python
- Homepage:
- Size: 105 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Jadoc: Tokenizes Japanese Documents to Enable CRUD Operations
[](https://pypi.org/pypi/jadoc/)
[](https://pypi.org/pypi/jadoc/)
[](https://github.com/poyo46/jadoc/blob/main/LICENSE)
[](https://github.com/psf/black)
[](https://pycqa.github.io/isort/)
## Installation
**Install MeCab**
MeCab is required for Jadoc to work.
If it is not already installed, [install MeCab](https://taku910.github.io/mecab/) first.
**Install Jadoc**
```console
$ pip install jadoc
```
## Examples
```python
from jadoc.doc import Doc
doc = Doc("本を書きました。")
# print surface forms of the tokens.
surfaces = [word.surface for word in doc.words]
print("/".join(surfaces)) # 本/を/書き/まし/た/。
# print plain text
print(doc.get_text()) # 本を書きました。
# delete a word
doc.delete(3) # Word conjugation will be done as needed.
print(doc.get_text()) # 本を書いた。
# update a word
word = doc.conjugation.tokenize("読む")
# In addition to conjugation, transform the peripheral words as needed.
doc.update(2, word)
print(doc.get_text()) # 本を読んだ。
```