Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
89 lines (60 sloc) 1.34 KB
add the current stream sentence to the queue
split s into array of words with syllable counts
"hello world tomato foobar"
split words
count syllables
pass into object, list
var split_up_sentence = [{
word: "hello",
syllables: 2
word: "world",
syllables: 1
word: "tomato",
syllables: 3
word: "foobar",
syllables: 2
for each word w in the split_up_sentence
we start at line_syl_coun
if 0 + the syl of w < 5
we have 2
if 0 + the ssf of w < 5
d we have 2
if 0 + the syl of w < 5
we have 3
three = {"tomatoes"}
1 "hello world foobar"
"bla bla foobarbazbat craziness one love"
popped: foobarbazbat, append fours
1 "bla bla craziness"
look into threes, and append
or two and one
if still no match
put into ones
2 "one love"
void function storeSyl (wordObj a)
check syllables, match to array
append correct words to array
switch or if statement
wordObj function getSyl (len)
find the array len
choose a random string from the array with length len
remove that string from the array
format the string into wordObj form { word:"tomato", syl: 3}
return that wordObj
var ones = ["abc", "is", "foo"];
var twos = ["foobar"]
var threes...
var sixes