I'm a new Processing user. I've managed to make simple changes to a few examples like adding "saveStrings" to save text output to a file. I would like to modify "ReplaceWriting.pde" from the RiTa toolkit but I'm not sure how.
This is what I would like to do in four simple steps:
1 Remove all realtime screen output and timing options. Application progress via the console is sufficient.
2. Load a text file (instead of just processing a "String test" written into the original pde code)
3. Process every word in text file and replace with random synonym from Wordnet (if available) except those common words contained in a "stopwords.txt" file. This file would contain one word per line, for example, the, and, a, etc.
If it is too difficult to use a "stopwords" file then every word should be processed.
4. Save Wordnet processed output to a text file.
I would appreciate any modifications to the code below that will achieve this result or if you know of any other Processing code that will accomplish the same task.
// Requires: RiTa.WordNet
import rita.*;
import rita.wordnet.*;
RiText[] rts;
RiWordnet wordnet;
int charsPerLine = 60;
String test = "Last Wednesday we decided to visit the zoo. We arrived the next morning after we breakfasted, cashed in our passes and entered. We walked toward the first exhibits. I looked up at a giraffe as it stared back at me. I stepped nervously to the next area. One of the lions gazed at me as he lazed in the shade while the others napped. One of my friends first knocked then banged on the tempered glass in front of the monkey's cage. They howled and screamed at us as we hurried to another exhibit where we stopped and gawked at plumed birds. After we rested, we headed for the petting zoo where we petted wooly sheep who only glanced at us but the goats butted each other and nipped our clothes when we ventured too near their closed pen. Later, our tired group nudged their way through the crowded paths and exited the turnstiled gate. Our car bumped, jerked and swayed as we dozed during the relaxed ride home.";