Hi all. So right now, this code generates a paragraph of random sentences taken from the dataset.rtf file by using the rita library. Is there a way to assign random words to print out as bold or a different color? So, for example.. example text A would be example text B instead:
Text A: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor.
Text B: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor.
Thanks!!
import rita.*;
RiMarkov markov; String line = "click to (re)generate!"; String[] files = { "dataset.rtf" }; int x = 160, y = 240;
void setup() { size(500, 500);
fill(0); textFont(createFont("times", 16));
// create a markov model w' n=3 from the files markov = new RiMarkov(6); markov.loadFrom(files, this); }
void draw() { background(250); text(line, x, y, 400, 400); }
void mouseClicked() { if (!markov.ready()) return;
x = y = 50; String[] lines = markov.generateSentences(2); line = RiTa.join(lines, " "); }