Skip to main content

Toolbox for Japanese text.

Project description

Shikaku (詩客)

Test PyPI version

Toolbox for Japanese text.

Example

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")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shikaku-0.2.3.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

shikaku-0.2.3-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file shikaku-0.2.3.tar.gz.

File metadata

  • Download URL: shikaku-0.2.3.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for shikaku-0.2.3.tar.gz
Algorithm Hash digest
SHA256 00f9e3d806cdb3dfb4ce8af551c34f460f8e3eae2abe61551a3b403f5e382c3c
MD5 023e2475f6642c7982bb9e190b0b8e09
BLAKE2b-256 56fe7d8c090d000cec1652c1ba1efa6665f9b481614ef8106c7262b4c8c3a4b7

See more details on using hashes here.

File details

Details for the file shikaku-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: shikaku-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for shikaku-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f464771846f05db60ebea22b4f901e3c13f05dacfa0593841d80f52f6c92eb52
MD5 28371d1fd123760bb4bb96cea5259725
BLAKE2b-256 df788dd7633808d9d2cb1891cf235094cb8c36f66a57f2e5b716373290f54f0c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page