sylb

2.5.4 • Public • Published

sylb

The Syllable Sorter for the Modern Age. ( without haiku generation. )

What does it do?

sylb sorts your words by syllable, and lets you work your magic. sylb also powers this Twitter bot.

Installation

npm install --save sylb

Then, in your code:

var sylb = require('sylb')

Now you're good to go.


Functions

.massSort(array)

  • Sorts a lot of words into their respective arrays.

.singleSort(string)

  • Sorts a single word into its respective array.

.count(string)

  • Returns the syllable count of a string.

.printDBWords()

  • Shows you the words in each syllable array.

printDBCount()

  • Shows you how many words you have in each syllable array.

In sylb-haiku :

If you'd like access to these, please install sylb-haiku instead.

haiku()

  • Generates a potentially incomplete haiku using words from your database. Used for testing.

trueHaiku()

  • Generates a complete haiku using words from your database, no matter what.

##Variable Exports

var sylb = require('sylb');
	
console.log(sylb.I) 	// one syllable array
console.log(sylb.II) 	// two syllable array
console.log(sylb.III) 	// three syllable array
console.log(sylb.IV) 	// four syllable array
console.log(sylb.V) 	// five syllable array
console.log(sylb.VI) 	// six syllable array
console.log(sylb.VII) 	// seven syllable array
console.log(sylb.VIII) 	// eight syllable array
console.log(sylb.IX) 	// nine syllable array
console.log(sylb.X) 	// ten syllable array
console.log(sylb.XI) 	// eleven syllable array

console.log(sylb.unsortable) // things sylb couldn't sort. things with no vowels go in here.

console.log(sylb.sylbArrays) // all of the above

Mass Sort Example

const sylb = require('sylb')
const fs = require('fs')

var corpus = fs.readFileSync('words.txt', 'utf8')
corpus = corpus.split(' ')
	
sylb.massSort(corpus)

sylb.printDBCount()

Fun Fact

Did you know? In old Sylb Packages, around 200 lines were dedicated to haiku generation.

Readme

Keywords

none

Package Sidebar

Install

npm i sylb

Weekly Downloads

3

Version

2.5.4

License

ISC

Last publish

Collaborators

  • gummus.froggus