Giter Club home page Giter Club logo

haiku's Introduction

HAIKU

A funny class that generates haiku in ITALIAN language using Markov Chains and some graceful brute force.

Designed and built with all the love in the world by Gianluca Pericoli

how does it work

The class retrieves "input.txt" and generates a Markov Chain, the function "generate" uses it to create 3 sencentecs of 5/7/5 syllabes as a real Haiku (俳句)

Syllables counting algorithm was ported and refactored in Python from This Site

input.txt

actually input.txt contains 3 books:

  • Le avventure di Alice nel Paese delle Meraviglie, Lewis Carroll
  • Divina Commedia, Dante Alighieri
  • Garibaldi e Montevideo, Dumas Alexandre

thanks to

Met4lpaca who rekindled my interest for Haiku poetry

examples

(haiku) hash@hash:~/haiku$ python haiku.py
***
Più non si spezza.
E al nome si spande!
Ma ’l suo pensiero!
***

***
Sa che un solo.
Un dice che la punse.
Tal ne s’offerse.
***

***
El par che senta.
Non vi fu gran silenzio.
Ma che ti porse!
***

***
«O tu che vinci!’.
Corrientes cade in Po.
Non credo che sia.
***

***
Se di là dura.
Ma perché di tal gloria.
Vie più che burro.
***

***
E vo’ che tu die.
Come del suo signore.
Tra l’erba e ’ suoi.
***

***
Quest’ è la scorta?
Vedi lo sol ferisse.
E tu che vinci!’.
***

***
E quel che sòle?
Una delle sue forze.
Ella non ci ha.
***

***
Ma ciò che tu muoi.
Ma venuto a questo’.
Là sù non vada.
***

***
E se ’l mio volto.
Poscia Più non si schianta.
Ver’ me si vegna.
***

licence

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or(at your option) any later version.

haiku's People

Contributors

gpericol avatar

Watchers

Oscar Chinellato avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.