だから私は処理が初めてで、本(私の場合はグレートギャツビー)の単語の使用法を表示し、それを独自の形式で表示するジェネレーティブアート作品を作成しようとしています。今のところ、D. Shiffman によっていじられた古い作品の助けを借りて、データの抽出の部分にたどり着きました。これは以下にあります。現時点では、表示方法を決定していて、どうすればよいかわかりません。
このフォーマットは、「Space is Vast」という人によって決められました。各一意の単語が独自の行である場合にフォーマットすると考えました。ピースの行のように、使用中の値が球軌道の周りの行の長さを決定します。どちらも以下のコードで生成された値です。
誰かがプロセスを開始するためのアイデア (参照、アドバイス、または実際のコード) を持っている場合は、深く感謝します。改めまして、素晴らしい一日をお過ごしください。
Img はここにあります: http://spaceisvast.com/post/102743224728/iterations-on-a-concept-something-very
String[] gatsby;
String delimiters = " .,?!:;[]- ";
IntDict words;
int usage;
int textAmount = 8754;
int myScale;
//int count = words.get(theword);
void setup(){
size(600,600);
background(255);
smooth();
// loading gatsby into the string
String[] rawtext = loadStrings("TXT.rtf");
//create big ass string
String everything = join(rawtext, "");
//create single words array
gatsby = splitTokens(everything, delimiters);
//create my a shinny dictionary of text
words = new IntDict();
for (int i = 0; i < gatsby.length; i++){
String usage = gatsby[i].toLowerCase();
words.increment(usage);
}
//sort by value
//words.sortValuesReverse();
println(words);
}
void draw(){
}