classify-poetry
v2.0.0
Published
recognize type poetry in a given text excerpt
Downloads
10
Maintainers
Readme
classify-poetry
recognize the type of poetry in a given excerpt
Installation
This package is ESM only:
Node 14+ is needed to use it and it must be import
ed instead of require
d.
npm install classify-poetry
Usage
Classify Poetry
import { classifyPoetry } from "classify-poetry";
const types = classifyPoetry(
"detect a haiku \n pleased to do, says algorithm \n thanks algorithm"
);
console.log(types); // ["haiku"]
Detect Specific Type
ABC
import { abc } from "classify-poetry";
abc(sampleText); // => true or false
http://www.poeticterminology.net/01-abc-poem.htm
Couplet
import { couplet } from "classify-poetry";
couplet(sampleText); // => true or false
https://en.wikipedia.org/wiki/Couplet
Haiku
import { haiku } from "classify-poetry";
haiku(sampleText); // => true or false
https://en.wikipedia.org/wiki/Haiku_in_English
Limerick
import { limerick } from "classify-poetry";
limerick(sampleText); // => true or false
https://en.wikipedia.org/wiki/Limerick_(poetry)
Quatrain
import { quatrain } from "classify-poetry";
quatrain(sampleText); // => true or false
https://en.wikipedia.org/wiki/Quatrain
Sonnet
import { sonnet } from "classify-poetry";
sonnet(sampleText); // => true or false
https://en.wikipedia.org/wiki/Sonnet
Tanka
import { tanka } from "classify-poetry";
tanka(sampleText); // => true or false
https://en.wikipedia.org/wiki/Tanka
Terza Rima
import { terzaRima } from "classify-poetry";
terzaRima(sampleText); // => true or false