<commit_before>/*
Copyright 2010 <NAME>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

import wordcram.*;

size(700, 400);
background(0);
colorMode(HSB);

WordCram wordcram = new WordCram(this,
  new Word[] {
    new Word("Hello", 1.0),
    new Word("WordCram", 0.6)
  },
  Fonters.alwaysUse(createFont("sans", 1)),
  Sizers.byWeight(4, 60),
  Colorers.twoHuesRandomSats(this),
  Anglers.horiz(),
  Placers.centerClump()
);
 
wordcram.drawAll();
<commit_msg>examples: added notes to helloworld<commit_after>/*
Copyright 2010 <NAME>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

/*
This is as basic as it gets.  If you can't get this running, something is not 
quite right.
*/

import wordcram.*;

size(700, 400);
background(0);

WordCram wordcram = new WordCram(
  this,  // You have to pass the sketch to WordCram, so it can draw to it.
  
  // These are your words. You can use pretty much whatever numbers you like 
  // for their weights, and they can be in any order.
  new Word[] {
    new Word("Hello", 100),
    new Word("WordCram", 60)
  },
  
  // Fonters tell WordCram which PFont to draw your words in.
  // The Processing docs say: "Using createFont() (instead of loadFont) 
  // enables vector data to be used with the JAVA2D (default) renderer 
  // setting. This can be helpful when many font sizes are needed..."
  Fonters.alwaysUse(createFont("sans", 1)),
  
  // Sizers tell WordCram how big to draw your words.
  Sizers.byWeight(4, 60),
  
  // Colorers tell WordCram how to color your words.
  Colorers.pickFrom(color(255)),
  
  // Anglers tell WordCram how to angle, or rotate, your words.
  Anglers.horiz(),
  
  // Placers tell WordCram where (approximately) to draw your words.
  Placers.centerClump()
);

// Now we've created our WordCram, we can draw it:
wordcram.drawAll();

{'fraction_non_alphanumeric': 0.0927536231884058, 'fraction_numerical': 0.01847826086956522, 'mean_word_length': 3.7934027777777777, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1190374', 'n_tokens_mistral': 883, 'n_tokens_neox': 826, 'n_words': 361}