Skip to main content

Discover haiku from text.

Project description


Discover haiku from text. Thanks to


  • Python 3.8.x+
  • MeCab with IPADIC (e.g. brew install mecab mecab-ipadic)


pip install ikku


Reviewer is the main interface for this library.

from ikku import Reviwer
reviewer = Reviewer()

Judge if given text is valid song or not.

reviewer.judge("古池や蛙飛び込む水の音") #=> true
reviewer.judge("ああ古池や蛙飛び込む水の音ああ") #=> false

Find one valid song from given text.

#=> <class ''>

Search all valid songs from given text."ああ古池や蛙飛び込む水の音ああ天秤や京江戸かけて千代の春ああ")
#=> [
#     [<class ''>],
#     [<class ''>],
#   ]

Return an Array of phrases of ikku.node.Node.

song.phrases #=> [["古池", "や"], ["蛙", "飛び込む"], ["水", "の", "音"]]

Pass rule option to change the measure rule (default: [5, 7, 5]).

reviewer = Reviewer(rule = [4, 3, 5])
reviewer.judge("古池や蛙飛び込む水の音") #=> false
reviewer.judge("すもももももももものうち") #=> true

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

ikku-0.1.3.tar.gz (5.8 kB view hashes)

Uploaded source

Built Distribution

ikku-0.1.3-py3-none-any.whl (6.7 kB view hashes)

Uploaded py3

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