Skip to content

Instantly share code, notes, and snippets.

@edsonsoares
Created November 4, 2014 06:13
Show Gist options
  • Save edsonsoares/fd9691c4ffa55a9160bb to your computer and use it in GitHub Desktop.
Save edsonsoares/fd9691c4ffa55a9160bb to your computer and use it in GitHub Desktop.
Text Visualization
String[] words;
IntDict concordance;
int index = 0;
void setup () {
size (600, 400);
background(0);
String [] lines = loadStrings ("statement.txt");
String allthetxt = join (lines, " ");
printArray(allthetxt);
words = splitTokens (allthetxt, " ,.;!?");
printArray(words);
concordance = new IntDict();
frameRate(5);
}
void draw(){
background(0);
textSize(64);
textAlign(CENTER);
text(words[index], width/2, height/2);
index++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment