Skip to content

Narigo/reimemonster

Repository files navigation

Reimemonster

Build Status Coverage Status

This repository contains helpers for making poems. For example it counts syllables and helps you find rhyming words.

Currently only usable in German. See it in action on the Reimemonster demonstration page. It saves your last poem to the localstorage, lets you search for rhymes by selecting a word and shows the amount of syllables in the lines on the side.

Usage

You can either use the API or use the npm commands from the command line.

API usage

First, install the module via npm.

npm install reimemonster

findRhyme

findRhyme(word: string): string[]

findRhyme will present you a list of Strings that may rhyme on your word by checking their ending. For example, findRhyme("anleiern") results in a list like this:

[
  "Aasgeiern",
  "Abschiedsfeiern",
  "Abschlussfeiern",
  "Befreiern",
  "Brautschleiern",
  ...
]

countSyllables

countSyllables(text: string): integer

This will count the number of syllables in a text by using a custom splitter with regular expressions. There are some words for which this approach does not work, because they can be split up in several ways. For example "Millionen" could be divided as "Mil-li-o-nen" or "Mil-lio-nen", depending on how you would pronounce it.

Command line usage

You can use the command line tools by cloning this repository and run the npm commands.

To count syllables in verses, you can use this command for example:

pnpm run start

To get out of this mode, press CTRL+D.

To find a rhyming word, use this command:

pnpm run rhyme <your-word>

Acknowledgements