Metadata-Version: 2.4
Name: shikaku
Version: 0.2.5
Summary: Toolbox for Japanese text.
Keywords: japanese,markov-chain,text-generation,word-cloud
Author: Takahiro Ueda
Author-email: Takahiro Ueda <t.ueda.od@juntendo.ac.jp>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Text Processing :: Linguistic
Requires-Dist: igraph>=1.0.0
Requires-Dist: markovify>=0.9.4
Requires-Dist: matplotlib>=3.10.9
Requires-Dist: matplotlib-fontja>=1.1.0
Requires-Dist: mecab-python3>=1.0.12
Requires-Dist: unidic-lite>=1.0.8
Requires-Dist: wordcloud>=1.9.6
Requires-Python: >=3.10
Project-URL: repository, https://github.com/tueda/shikaku
Description-Content-Type: text/markdown

# Shikaku (詩客)

[![Test](https://github.com/tueda/shikaku/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/tueda/shikaku/actions/workflows/test.yml?query=branch%3Amain)
[![PyPI version](https://badge.fury.io/py/shikaku.svg)](https://pypi.org/project/shikaku/)

Toolbox for Japanese text.

## Example

```python
from shikaku import load_aozorabunko, TextModel, WordCloud
import matplotlib.pyplot as plt

# Aozora Bunko, author_id = 35, work_id = 1567 ==> Run, Melos!
text = load_aozorabunko(35, 1567)

# Text generator using Markov chains.
model = TextModel()
model.fit(text)
result = model.generate()
print(result)

# Word cloud.
wc = WordCloud()
wc.fit(text)
result = wc.generate()
result.to_file("wc.png")

# Visualize Markov chains (preliminary).
model = TextModel(state_size=1)
model.fit("吾輩は猫である。名前はまだない。")
model.plot()
plt.savefig("model.png")
```

## Development

```bash
# Setup
uv sync --python 3.13
uv run task prepare

# Linting and testing
uv run task lint
uv run task test

# Release a new version
./scripts/make-release.sh <new_version>  # e.g., 0.2.5rc1
```
