To install via Brew run the following command. The below examples assume you have the jar installed under the name of "kumo". It is not quite as flexible as the programmatic interface yet but should support most of the common needs.
Replaces A-Z,a-z with characters enclosed in Bubbles ⓐ-ⓩⒶ-Ⓩ (requires a supporting font) Trims the text down to an empty string, even if null.Ĭonverts A-Z,a-z,0-9 character to an upside-down variant.Ĭonverts each character to it's hex value and concatenates them.Ĭombines the TrimToEmptyNormalizer, CharacterStrippingNormalizer, and LowerCaseNormalizer. To add set the normalizer, call tNormalizer() or FrequencyAnalyzer.addNormalizer() NormalizersĬonstructed with a Pattern, it will replace all matched occurrences with a configurable 'replaceWith' string.
To add your own just create a class that override the Tokenizer interface and call the tTokenizer() or FrequencyAnalyzer.addTokenizer(). Currently only two tokenizers are built into Kumo.
Tokenizers are the code that splits a sentence/text into a list of words. Order does not matter as the FrequencyFileLoader will automatically sort the pairs. The FrequencyFileLoader can be used to load such files. set up word clouds for ( int i = 0 i yourself, or you can load in a text file containing the word frequency and word pairs. Setup parts for word clouds final Normalizer NORMALIZERS = new Normalizer ParallelLayeredWordCloud parallelLayeredWordCloud = new ParallelLayeredWordCloud( 4, dimension, CollisionMode. NOTE: This will eventually be natively handled along with better internal data structures.įinal Dimension dimension = new Dimension( 2000, 2000) writeToFile( "kumo-core/output/layered_word_cloud.png ") Ĭreate a ParallelLayeredWordCloud using 4 distinct Rectangles.Įvery Rectangle will be processed in a separate thread, thus minimizing build-time significantly setFontScalar( 1, new SqrtFontScalar( 10, 40)) setFontScalar( 0, new SqrtFontScalar( 10, 40)) setColorPalette( 1, new ColorPalette( new Color( 0xFFFFFF), new Color( 0xDCDDDE), new Color( 0xCCCCCC))) setColorPalette( 0, new ColorPalette( new Color( 0xABEDFF), new Color( 0x82E4FF), new Color( 0x55D6FA))) setBackground( 1, new PixelBoundryBackground( "backgrounds/cloud_fg.bmp ")) setBackground( 0, new PixelBoundryBackground( "backgrounds/cloud_bg.bmp ")) setFontOptions( 1, new KumoFont( "Comic Sans MS ", FontWeight.
setFontOptions( 0, new KumoFont( "LICENSE PLATE ", FontWeight. load( "text/new_york_negative.txt ") įinal Dimension dimension = new Dimension( 600, 386) įinal LayeredWordCloud layeredWordCloud = new LayeredWordCloud( 2, dimension, CollisionMode. load( "text/new_york_positive.txt ") įinal List wordFrequencies2 = frequencyAnalyzer. setStopWords(loadStopWords()) įinal List wordFrequencies = frequencyAnalyzer. setWordFrequenciesToReturn( 300) įrequencyAnalyzer.
Please feel free to jump in and help improve Kumo! There are many places for performance optimization in Kumo! Kumo directly generates an image file without the need to create an applet as many other libraries do. Kumo's goal is to create a powerful and user friendly Word Cloud API in Java.