Code Monkey home page Code Monkey logo

belleabsentebot's Introduction

Belle Absente Bot

Generate Belle Absente poems from works of literature! Can also be used to find naturally-occurring lipograms.

What is a Belle Absente?

Belle Absente: A poetic form developed by members of a French collective of mathematician-poets in the 1960s.

In a Belle Absente poem, each line is a pangrammatic lipogram (it contains every letter of the alphabet except for one). Together, the missing letters in each line spell out a person's name or initials.

As a form, the Belle Absente - which translates roughly to "Beautiful Outlaw" - plays with notions of loss, longing, and constraint. Taken line-by-line, the absence of a letter is rarely noticable. But as the reader progresses through the poem, the cumulative effect of the missing letters becomes increasingly visible.

What is the Belle Absente Bot?

This program searches one or more input text files for sentences that are pangrammatic lipograms (the building blocks of a Belle Absente). It can also be used to search for sentences that are just lipograms (specify the lipogram flag instead of the belle_absente flag).

Arguments

Flag Name Description Notes
directory Directory to search for Belle Absentes Must specify either directory or file
file Single file to search for Belle Absentes Must specify either directory or file
alphabet Letters whose presence in a sentence constitutes a pangram Defaults to 'abcdefghiklmnoprstuvwxy'1
lipogram Letter to be avoided Must specify either lipogram (find lipograms) or belle_absente (find pangrammatic lipograms)
belle_absente Letters to avoid (using Belle Absente formula) Must specify either lipogram (find lipograms) or belle_absente (find pangrammatic lipograms)

1 The default alphabet is missing j, q, z (the 3 most infrequently used letters in the English language), in accordance with Georges Perec's approach to the Belle Absente. This accommodation results in better poetry.

Output

A text file containing:

  1. A list of files (if directory was specified) that contain a Belle Absente
  2. A per-file breakdown of every pangrammatic lipogram for each of the Belle Absente letters

Installation

git clone https://github.com/chloerevery/BelleAbsenteBot.git

Example Usage

Make a Belle Absente for Ruth Bader Ginsburg using contents of the /books directory:

python3 belle_absente_bot.py -directory books/ -belle_absente rgb

Make a Belle Absente for Ruth Bader Ginsburg using the text of Don Quixote:

python3 belle_absente_bot.py -file books/quixote.txt -belle_absente rgb

Find lipograms missing the letter J in Les Miserables:

python3 belle_absente_bot.py -file books/miz.txt -lipogram j

Make a Belle Absente for Jean Valjean using the text of Les Miserables:

python3 belle_absente_bot.py -file books/miz.txt -belle_absente jvj

License

MIT

belleabsentebot's People

Contributors

chloerevery avatar

Stargazers

Matt Nish-Lapidus avatar Will Hall avatar Osman Zeki avatar Pierre Depaz avatar Xander Peterson avatar Sara Gulotta avatar Tamreen Khan avatar Pius Uzamere avatar Puneeth Chaganti avatar Allison Colyer avatar Enrico Lamperti avatar

Watchers

James Cloos avatar  avatar

Forkers

cenybar

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.