All Projects → sloev → gutenhaiku

sloev / gutenhaiku

Licence: MIT license
Guten Haiku extracts Haiku poems from text

Programming Languages

python
139335 projects - #7 most used programming language

Guten Haiku

Build Status Latest Version Python Support

Buy Me A Coffee

A Commandline tool to mine haiku poems from text

  • 80's cli interface with colors
  • Works great with gutenberg books thx to a builtin cleaner script from Peyman Mohseni Kiasari
  • Reconstructs punctuation of haikus using deepcorrect
  • Appends json haiku's to a file

Install

$ pip install gutenhaiku

Then you need to download the models in cache:

$ gutenhaiku setup

Usage

$ gutenhaiku -f frankenstein.txt -a 'mary shelley' -t 'frankenstein' -d '1818-01-01'

Wat?             Guten Haiku lets you extract haiku poems from text
Usage:           gutenhaiku \
                 -f frankenstein.txt \
                 -a 'Mary Wollstonecraft Shelley' \
                 -t 'frankenstein' \
                 -d '1818-01-01'
Optional params: --commandfile [-cf] a file with comma seperated 
                                     values for f,a,t,d params
                 --outputfile   [-o] the output file path [default haiku.json
                 --eighties     [-e] eighties mode [default 1]

Advanced usage:  gutenhaiku \
                 -f frankenstein.txt \
                 -a 'Mary Wollstonecraft Shelley' \
                 -t 'frankenstein' \
                 -d '1818-01-01' \
                 -f dracula.txt \
                 -a 'Bram Stoker' \
                 -t 'dracula' \
                 -d '1897-05-26'

setup:           gutenhaiku setup
                 downloads AI models

Output format

example from assets

{
    "page": 261,
    "word_number": 65407,
    "haiku": [
        "He pointed towards.",
        "The corpse of my wife I rushed.",
        "Towards the window."
    ],
    "author": "mary shelley",
    "title": "frankenstein",
    "date": "1818-01-01T00:00:00"
}

Dev

Run tests with

$ poetry run nox
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].