Metadata-Version: 2.1
Name: ikku
Version: 0.1.1
Summary: Discover haiku from text.
Home-page: https://github.com/Gappo-Gappo/ikku
Author: Yohei Kirino
Author-email: kirino.yohei@gmail.com
License: MIT
Keywords: MeCab
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Text Processing :: Linguistic
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: mecab
Requires-Dist: mecab-python3

ikku
===========

Discover haiku from text.
Thanks to https://github.com/r7kamura/ikku

Requirements
------------

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

Installation
------------

::

 $ pip install ikku

Example
------------

Reviewer is the main interface for this library.

.. code:: python

    from ikku import Reviwer
    reviewer = Reviewer()

Judge if given text is valid song or not.

.. code:: python

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

Find one valid song from given text.

.. code:: python

    reviewer.find("ああ古池や蛙飛び込む水の音ああ")
    #=> <class 'ikku.song.Song'>

Search all valid songs from given text.

.. code:: python

    reviewer.search("ああ古池や蛙飛び込む水の音ああ天秤や京江戸かけて千代の春ああ")
    #=> [
    #     [<class 'ikku.song.Song'>],
    #     [<class 'ikku.song.Song'>],
    #   ]

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

.. code:: python

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

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

.. code:: python

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


