Giter Site home page Giter Site logo

poet's Introduction

Poet

"poet" is a helper.

It can analyze prose to determine (or guess) whether the prose is a sonnet or haiku, including checking for rhyming and form. It also has a basic rhyming dictionary.

poet includes a web server, or it can take input from a text file and output the analysis in a terminal.

Usage

To run the poet web server:

$ cd <the directory where poet is>
$ ./poet -s

then go to http://127.0.0.1:8000/ in a web browser.

You can quit the server with Control-C in the terminal.

To run poet in the terminal on a file input:

$ cd <the directory where poet is>
$ ./poet -i <PATH, e.g. examples/stella-1.txt>

Generally, poet only knows about words in its dictionaries. These are loaded at startup and read-only. However, there's a hacky form for fetching unknown words. The output can be copied into userdict.dict so that it will be included in the next run.

These files are included in a release package of poet:

  • poet: The binary.
  • cmudict.dict: The base dictionary. Required. This can also be downlaoded from https://github.com/cmusphinx/cmudict/raw/master/cmudict.dict
  • userdict.dict: Optional. Your own per-word additions in the cmudict format.
  • examples/: Some random snippets of poetry I use for testing.
  • static/: files for the web server.
  • templates/: files for the web server.

Feedback, feature requests, and bug reports welcome. If you want to mess with the presentation (styles/formatting) of most of the things on the web server, you can edit static & templates.

Also, if you get some weird "unidentified developer" errors, try running this once:

$ xattr -l poet; xattr -d com.apple.quarantine poet

Why poet?

I was recently nerd-sniped:

From: Someone who has written hundreds of sonnets
Date: Wed, Oct 7, 2020 at 7:08 AM
Subject: There's no quick way to create a rhyming dictionary is there?
To: Me

I'm frustrated having tapped out existing rhyming dictionaries' capacity (they
cluster on common words, limiting vocab) and they don't allow you to add new
words. I'm wondering if there'd be any more comprehensive search tool and
database if I understood UNIX or regular expressions or something. My next-best
alternative is to keep a word bank in a spreadsheet with columns separated by
final phoneme.

This reminded me of the sphinx phonetic dictionary that I'd run into in undergrad, so I used that and shared a grep/awk/sort recipe to invert the dictionary, for finding rhymes. It seemed like there was more potential, though.

A little while later, I was looking for gift ideas, and I also wanted to explore Rust with a significant project, so poet was born.

Documentation

Technical notes and decisions are stored with the source in src/.

poet's People

Watchers

 avatar

poet's Issues

Investigate warp instead of Rocket for web server.

Now that poet is kinda working, it's worth checking to see if Rocket is still the best. In particular, check on SSL support, integration / conflicts with other crates, header injection for the AJAX stuff, and how much effort / what would change on the input validation and parsing side.

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.