displayText = function() {
let oldStanza = RiTa.tokenize(poem1Stanzas[stanzaNumber]);
let newStanza = makeNewPoem(poem1Stanzas[stanzaNumber]);
let tokenizedNewStanza = RiTa.tokenize(newStanza);
//ask user to define new displayed gibberish//
/*if (replacementGibberish.length > 0){ //if there are still words to replace
for(let j=0; j>newStanza.length; j++){ //for every word in new stanza
for(let f=0; f>replacementGibberish.length; f++){ //for every Gibberish left to replace
if (tokenizedNewStanza[j].toLowerCase() == replacementGibberish[f]){ //check each word with every word in replacementGibberish //capitals may be a problem
display2.innerText = "‘" + replacementGibberish[f] + "’ means:";
if (textInput !== "") {
let text = textInput;
Dictionary[oldStanza[j].toLowerCase()].userSynonym = text; //search through Dictionary map using real word from oldStanza, which should output an object. Replace the value in key "userSynonym" with the inputted text
replacementGibberish.splice(f); //remove defined gibberish from replacementGibberish
}
}
}
}
//if not replacementGibberish left to define
} else {
display2.innerText = "Done.";
display3.innerText = "Complete Poem";
}*/
if (stanzaNumber < poem1Stanzas.length){
if(poem1Stanzas[stanzaNumber+1] == "\n") {
mutable stanzaNumber += 2;
mutable txt += "<br>" + makeNewPoem(poem1Stanzas[stanzaNumber]) + "<br>";
} else {
mutable stanzaNumber ++;
mutable txt += "<br>" + makeNewPoem(poem1Stanzas[stanzaNumber]); // add new stanza string to mutable text
}
} else {display3.innerText = "Done.";}
//pause a couple second
//button appears on screen with "Write a poem?" on it
//-->pressing the button causes the current display to fade out and me replaced by the new poem appearring word by shifting word on screen
}