kennycason / kumo Goto Github PK
View Code? Open in Web Editor NEWKumo - Java Word Cloud
Home Page: http://kennycason.com/posts/2014-07-03-kumo-wordcloud.html
License: MIT License
Kumo - Java Word Cloud
Home Page: http://kennycason.com/posts/2014-07-03-kumo-wordcloud.html
License: MIT License
I have 500 text files of the word frequency, and I have to build a wordcloud for each of them.
However, the text files are vary in word number, I want to build a wordcloud which fit their size most. How can I do this smartly? Hope you can answer my fool question, haha
I would like to use an image as a background on a wordcloud of different sizes / dimensions without creating an individual image for each size.
For example, I would like to use the whale.png image with 990x618 pixel on a Wordcloud with 4000x4000 pixel and need to scale the whale image roughly 4 times (in both dimensions to keep the proportions).
I couldn't find a way to do this using the setBackground method or the PixelBoundryBackground Class. It would be great if you could implement a method to add a scale/resize factor or absolute dimensions.
So I built the .jar, added to my project, and then did a:
import wordcloud.*;
However, none of your examples are working, with a copy and paste - appears as though classes are missing or misspelled.
What I have is a list of words and their integer weights (the generation of the weights was a separate function) - how can I pass those to kumo and return a circular or rectangular wordcloud?
Thanks for your help!
I have set FrequencyAnalyzer with my set of stop words using frequencyAnalyzer.setStopWords(stopWords);
. stopWords is a simple Set<String>
.
After that the word cloud is rendered, some words that are present into stopWords are included into the cloud image. I debugged the code I can see that the StopWordFilter was properly initialized with my list.
The second problem is that WordSizeFilter is also not working properly. I'm using the default minWordLength (3), but my rendered image cloud contains words with 1 and 2 characters...
I didn't managed to get inside Lambda, but as far as I understood, Kumo delegates to it applying the filters (Lambda.filter(compositeFilter, words);
).
Probably it has a problem, or I'm missing something. Please, could you help me? I attached the text file from which I'm trying to generate a cloud (it's in portuguese).
profiler.txt
Is there
Hi,
I am hitting this exception:
java.lang.IllegalArgumentException: Width (0) and height (25) cannot be <= 0
at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1016)
at java.awt.image.BufferedImage.(BufferedImage.java:340)
at wordcloud.Word.(Word.java:39)
at wordcloud.WordCloud.buildWord(WordCloud.java:260)
at wordcloud.WordCloud.buildwords(WordCloud.java:247)
at wordcloud.WordCloud.build(WordCloud.java:107)
I've the empty string in the stop word set and also a minimum length of 3 but apparently the empty string is in the word frequency list. Need to remove that entry by hand from the list
I've been trying to implement this myself to help you out, but have been struggling. Emoji support would be great, have been attempting to create a word cloud of all my conversations with my other half, to be printed on a canvas. We use emojis a lot, and to see their frequency turn up too would be great.
I deploy my app on centos6, but the chinese chars can not displayed in picture which generated by kumo。
I used following code to make sure that my linux has the font "Comic Sans" .
GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
So I tried some other fonts (songti \AR PL UMing CN ..), they worked well。
I guess there is something wrong with "Comic Sans"。
btw:
After some search work.. I found a website :http://bancomicsans.com/main/
Hi,
Is there a way to write to svg (or any other vector graphic)?
Andreas
Guava's HashMultiset class would make it much faster to preprocess text. I'd suggest converting the raw tokens from languagetool to a HashMultiset before any further processing, and using the entrySet() method to process each distinct token only once during normalization, filtering etc.
specifically the double for loop
Hey Kenny,
Love this library and look forward to using it. One question - what license are you operating this under?
Thanks!
Thanks for your project. I was trying to build a wrapper around this Java library in Clojure since there were no native word cloud solutions in Clojure. The README examples were missing the import statements that made me search the examples for relevant classes. Improving examples on the README by adding import statements will be great so that the developer can copy paste and run the examples easily to initiate development.
Please point me to links if any that I might be missing.
Thanks
Hi,
When I was trying to produce a wordcloud based on a chinese txt file, the output image only contains blocks instead of correct Chinese words.
I've tried to encode the input file into "UTF-8" and "GBK". Both of the encoding couldn't fix the problem.
I'm using the sample code from the Github page with Kumo-1.4.jar to produce Chinese circle wordcloud through Eclipse.
Here is my code piece:
public static void chineseCloud() {
try {
final FrequencyAnalizer frequencyAnalizer = new FrequencyAnalizer();
frequencyAnalizer.setWordFrequencesToReturn(600);
frequencyAnalizer.setMinWordLength(2);
frequencyAnalizer.setWordTokenizer(new ChineseWordTokenizer());
File initialFile = new File("D:/Clavis/TopicMining/Dataset/chinese.txt");
final List<WordFrequency> wordFrequencies = frequencyAnalizer.load(new FileInputStream(initialFile));
final WordCloud wordCloud = new WordCloud(600, 600, CollisionMode.PIXEL_PERFECT);
wordCloud.setPadding(2);
wordCloud.setBackground(new CircleBackground(300));
wordCloud.setColorPalette(new ColorPalette(new Color(0xD5CFFA), new Color(0xBBB1FA), new Color(0x9A8CF5),
new Color(0x806EF5)));
wordCloud.setFontScalar(new SqrtFontScalar(12, 45));
wordCloud.build(wordFrequencies);
wordCloud.writeToFile("D:/Clavis/TopicMining/Dataset/chinese_language_circle.jpg");
} catch (Exception e) {
e.printStackTrace();
}
}
Thanks,
George
This will speed up placement code by removing unnecessary collision detections. It will not help the fact that the WordCloud.place function has a more and more difficult time placing words as the cloud fills up.
I am using the latest 1.13 release.
The FrequencyAnalyze default constructor adds the following normalizers:
public FrequencyAnalyzer() {
this.normalizers.add(new TrimToEmptyNormalizer());
this.normalizers.add(new CharacterStrippingNormalizer());
this.normalizers.add(new LowerCaseNormalizer());
}
And this seems correct, but it does not work properly. It leaves whitespace, so the trim is not working correct for some reason. Here is the log file.
Notice the first line, that is just white space that is most frequent.
Also notice how many times the word "crack" appears below with and without trailing spaces.
2018-07-19 09:42:44,639 [main] INFO com.kennycason.kumo.WordCloud - placed: (1/300)
2018-07-19 09:42:44,642 [main] INFO com.kennycason.kumo.WordCloud - placed: the (2/300)
2018-07-19 09:42:44,643 [main] INFO com.kennycason.kumo.WordCloud - placed: music (3/300)
2018-07-19 09:42:44,644 [main] INFO com.kennycason.kumo.WordCloud - placed: and (4/300)
2018-07-19 09:42:44,644 [main] INFO com.kennycason.kumo.WordCloud - placed: user (5/300)
2018-07-19 09:42:44,645 [main] INFO com.kennycason.kumo.WordCloud - placed: crack (6/300)
2018-07-19 09:42:44,646 [main] INFO com.kennycason.kumo.WordCloud - placed: this (7/300)
2018-07-19 09:42:44,646 [main] INFO com.kennycason.kumo.WordCloud - placed: you (8/300)
2018-07-19 09:42:44,647 [main] INFO com.kennycason.kumo.WordCloud - placed: csdb (9/300)
2018-07-19 09:42:44,689 [main] INFO com.kennycason.kumo.WordCloud - placed: comment (10/300)
2018-07-19 09:42:44,689 [main] INFO com.kennycason.kumo.WordCloud - placed: submitted (11/300)
2018-07-19 09:42:44,689 [main] INFO com.kennycason.kumo.WordCloud - placed: for (12/300)
2018-07-19 09:42:44,690 [main] INFO com.kennycason.kumo.WordCloud - placed: graphics (13/300)
2018-07-19 09:42:44,690 [main] INFO com.kennycason.kumo.WordCloud - placed: scene (14/300)
2018-07-19 09:42:44,691 [main] INFO com.kennycason.kumo.WordCloud - placed: demo (15/300)
2018-07-19 09:42:44,702 [main] INFO com.kennycason.kumo.WordCloud - placed: crack (16/300)
2018-07-19 09:42:44,702 [main] INFO com.kennycason.kumo.WordCloud - placed: c64 (17/300)
2018-07-19 09:42:44,702 [main] INFO com.kennycason.kumo.WordCloud - placed: crack (18/300)
2018-07-19 09:42:44,710 [main] INFO com.kennycason.kumo.WordCloud - placed: demo (19/300)
2018-07-19 09:42:44,711 [main] INFO com.kennycason.kumo.WordCloud - placed: can (20/300)
2018-07-19 09:42:44,713 [main] INFO com.kennycason.kumo.WordCloud - placed: made (21/300)
2018-07-19 09:42:44,714 [main] INFO com.kennycason.kumo.WordCloud - placed: commodore (22/300)
2018-07-19 09:42:44,714 [main] INFO com.kennycason.kumo.WordCloud - placed: find (23/300)
2018-07-19 09:42:44,715 [main] INFO com.kennycason.kumo.WordCloud - placed: all (24/300)
2018-07-19 09:42:44,719 [main] INFO com.kennycason.kumo.WordCloud - placed: one-file (25/300)
2018-07-19 09:42:44,721 [main] INFO com.kennycason.kumo.WordCloud - placed: intro (26/300)
2018-07-19 09:42:44,721 [main] INFO com.kennycason.kumo.WordCloud - placed: 1990 (27/300)
2018-07-19 09:42:44,723 [main] INFO com.kennycason.kumo.WordCloud - placed: about (28/300)
2018-07-19 09:42:44,723 [main] INFO com.kennycason.kumo.WordCloud - placed: out (29/300)
Currently the code is baked into the main draw loop.
I'm failing on the build...
Tests run: 17, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 329.036 sec <<< FAILURE!
matchOnlineExample(wordcloud.TestWordCloud) Time elapsed: 0.004 sec <<< ERROR!
java.io.FileNotFoundException: \tmp\code.txt (The system cannot find the path specified)
Does kumo provide a mechanism to handle clicking on words in the cloud widget? Ideally, I'd like the user to be able to click on, say, "Apple" and be able to register a listener that gets the string "Apple".
Hello Kenny,
I stumbled upon your project and decided to build the jar file, which went successful. But I wasn't able to get any of the examples nor the testfiles to work. BuildWordFrequences() seems to cause issues, as it can't find a reference to it.
If you have any pointers on how to resolve this issue, I'd be very grateful.
Kind Regards,
Mirabis
Characters commonly used in languages like Spanish or French are not stored nor shown properly because the use of a deprecated method in IOUtils.
The fix is rather simple, just change the following line from nlp/FrequencyAnalizer.java
:
public List<WordFrequency> load(InputStream fileInputStream) throws IOException {
return load(IOUtils.readLines(fileInputStream));
}
}
to
public List<WordFrequency> load(InputStream fileInputStream) throws IOException {
return load(IOUtils.readLines(fileInputStream,"utf-8"));
}
or add an overload method which let you choose your encoding.
for (final String word : words) {
final String normalized = normalize(word);
if (!wordFrequencies.containsKey(normalized)) {
wordFrequencies.put(normalized, 1);
}
wordFrequencies.put(normalized, wordFrequencies.get(normalized) + 1);
Since there is no else, each frequency is counted as frequency + 1.
https://github.com/kennycason/kumo/blob/master/src/main/java/com/kennycason/kumo/nlp/FrequencyAnalyzer.java#L103
I think that you should normalize words BEFORE filter(). Filter by stop-word "apple" misses "apple," (with comma).
e.g.
100: frog
94: dog
43: cog
20: bog
3: fog
1: log
1: pog
I am trying to build this on Windows 7, but I am getting several errors due the encoding of the system (Cp1252)
The first of which is:
INFO wordcloud.nlp.tokenizer.TestChineseWordTokenizer - Õ, ╝, ╣, Ú, ?, ô, Õ, », ╝, Õ, ╝, ╣
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 2.829 sec <<< FAILURE!
test(wordcloud.nlp.tokenizer.TestChineseWordTokenizer) Time elapsed: 2.727 sec <<< FAILURE!
java.lang.AssertionError: expected:<1> but was:<12>
and the second (when building ignoring tests):
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.2:jar (attach-javadocs) on project kumo: MavenReportException: Error while creating archive:
[ERROR] Exit code: 1 - C:\Users\Richard Jones\Downloads\kumo-master\src\main\java\wordcloud\nlp\normalize\BubbleTextNormalizer.java:4: error: unmappable character for encoding Cp1252
[ERROR] * Replaces the characters a-zA-Z with their bubble pendants â??-â?©â?¶-â??
[ERROR] ^
[ERROR] C:\Users\Richard Jones\Downloads\kumo-master\src\main\java\wordcloud\nlp\normalize\BubbleTextNormalizer.java:4: error: unmappable character for encoding Cp1252
[ERROR] * Replaces the characters a-zA-Z with their bubble pendants â??-â?©â?¶-â??
[ERROR] ^
[ERROR] C:\Users\Richard Jones\Downloads\kumo-master\src\main\java\wordcloud\nlp\normalize\BubbleTextNormalizer.java:12: error: unmappable character for encoding Cp1252
[ERROR] private static String bubbles = "â??â??â??â??â??â??â??â??â??â??â??â??â??â??â??â??â? â?¡â?¢â?£â?¤â?¥â?¦â?§â?¨â?©â?¶â?·â?¸â?¹â?ºâ?»â?¼â?½â?¾â?¿â??â??â??â?ƒâ??â??â??â??â??â??â??â??â??â??â??â??";
[ERROR] ^
[ERROR] C:\Users\Richard Jones\Downloads\kumo-master\src\main\java\wordcloud\nlp\normalize\BubbleTextNormalizer.java:12: error: unmappable character for encoding Cp1252
[ERROR] private static String bubbles = "â??â??â??â??â??â??â??â??â??â??â??â??â??â??â??â??â? â?¡â?¢â?£â?¤â?¥â?¦â?§â?¨â?©â?¶â?·â?¸â?¹â?ºâ?»â?¼â?½â?¾â?¿â??â??â??â?ƒâ??â??â??â??â??â??â??â??â??â??â??â??";
[ERROR] ^
[ERROR] C:\Users\Richard Jones\Downloads\kumo-master\src\main\java\wordcloud\nlp\normalize\BubbleTextNormalizer.java:12: error: unmappable character for encoding Cp1252
[ERROR] private static String bubbles = "â??â??â??â??â??â??â??â??â??â??â??â??â??â??â??â??â? â?¡â?¢â?£â?¤â?¥â?¦â?§â?¨â?©â?¶â?·â?¸â?¹â?ºâ?»â?¼â?½â?¾â?¿â??â??â??â?ƒâ??â??â??â??â??â??â??â??â??â??â??â??";
[ERROR] ^
[ERROR] C:\Users\Richard Jones\Downloads\kumo-master\src\main\java\wordcloud\nlp\normalize\BubbleTextNormalizer.java:12: error: unmappable character for encoding Cp1252
[ERROR] private static String bubbles = "â??â??â??â??â??â??â??â??â??â??â??â??â??â??â??â??â? â?¡â?¢â?£â?¤â?¥â?¦â?§â?¨â?©â?¶â?·â?¸â?¹â?ºâ?»â?¼â?½â?¾â?¿â??â??â??â?ƒâ??â??â??â??â??â??â??â??â??â??â??â??";
[ERROR] ^
[ERROR] C:\Users\Richard Jones\Downloads\kumo-master\src\main\java\wordcloud\nlp\normalize\BubbleTextNormalizer.java:12: error: unmappable character for encoding Cp1252
[ERROR] private static String bubbles = "â??â??â??â??â??â??â??â??â??â??â??â??â??â??â??â??â? â?¡â?¢â?£â?¤â?¥â?¦â?§â?¨â?©â?¶â?·â?¸â?¹â?ºâ?»â?¼â?½â?¾â?¿â??â??â??â?ƒâ??â??â??â??â??â??â??â??â??â??â??â??";
[ERROR] ^
[ERROR] C:\Users\Richard Jones\Downloads\kumo-master\src\main\java\wordcloud\nlp\normalize\UpsideDownNormalizer.java:9: error: unmappable character for encoding Cp1252
[ERROR] private static final String split = "É?qÉ?pÇ?É?bɥıظÊ?×?ɯuodbɹsÊ?nÊ?Ê?xÊ?zâ?¾'Ø?Ë?¿¡/\\," + "â??qϽá?¡Æ?â?²ÆƒHIÅ¿Ê?Ë¥WNOÔ?á½?á´?Sâ?¥â?©Î?MXÊ?Z" + "0Æ?á??Æ?ã?£Ï?9ã?¥86";
[ERROR] ^
[ERROR] C:\Users\Richard Jones\Downloads\kumo-master\src\main\java\wordcloud\nlp\normalize\UpsideDownNormalizer.java:9: error: unmappable character for encoding Cp1252
[ERROR] private static final String split = "É?qÉ?pÇ?É?bɥıظÊ?×?ɯuodbɹsÊ?nÊ?Ê?xÊ?zâ?¾'Ø?Ë?¿¡/\\," + "â??qϽá?¡Æ?â?²ÆƒHIÅ¿Ê?Ë¥WNOÔ?á½?á´?Sâ?¥â?©Î?MXÊ?Z" + "0Æ?á??Æ?ã?£Ï?9ã?¥86";
[ERROR] ^
[ERROR] C:\Users\Richard Jones\Downloads\kumo-master\src\main\java\wordcloud\nlp\normalize\UpsideDownNormalizer.java:9: error: unmappable character for encoding Cp1252
[ERROR] private static final String split = "É?qÉ?pÇ?É?bɥıظÊ?×?ɯuodbɹsÊ?nÊ?Ê?xÊ?zâ?¾'Ø?Ë?¿¡/\\," + "â??qϽá?¡Æ?â?²ÆƒHIÅ¿Ê?Ë¥WNOÔ?á½?á´?Sâ?¥â?©Î?MXÊ?Z" + "0Æ?á??Æ?ã?£Ï?9ã?¥86";
[ERROR] ^
[ERROR] C:\Users\Richard Jones\Downloads\kumo-master\src\main\java\wordcloud\nlp\normalize\UpsideDownNormalizer.java:9: error: unmappable character for encoding Cp1252
[ERROR] private static final String split = "É?qÉ?pÇ?É?bɥıظÊ?×?ɯuodbɹsÊ?nÊ?Ê?xÊ?zâ?¾'Ø?Ë?¿¡/\\," + "â??qϽá?¡Æ?â?²ÆƒHIÅ¿Ê?Ë¥WNOÔ?á½?á´?Sâ?¥â?©Î?MXÊ?Z" + "0Æ?á??Æ?ã?£Ï?9ã?¥86";
[ERROR] ^
[ERROR] C:\Users\Richard Jones\Downloads\kumo-master\src\main\java\wordcloud\nlp\tokenizer\ChineseWordTokenizer.java:20: error: unmappable character for encoding Cp1252
[ERROR] for(String rawToken : rawTokens) { // parse parts-of-speech tags away (��/n, ��/p, ��/n, �/ng, 使/v, ��/vn)
[ERROR] ^
[ERROR]
[ERROR] Command line was: "C:\Program Files\Java\jdk1.8.0_45\jre\..\bin\javadoc.exe" "-J-Dhttp.nonProxyHosts=\"localhost\"" @options @packages
[ERROR]
[ERROR] Refer to the generated Javadoc files in 'C:\Users\Richard Jones\Downloads\kumo-master\target\apidocs' dir.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
It would be great if you could add maven into a centralized maven repo. I'm just waiting that to start using this wonderful library at work :)
Hi Kenny,
I’m working in NLP for French https://github.com/oeuvres/Alix
I’m providing WordClouds with morpho-syntactic infos (nouns, names, verbs…).
http://obvil.lip6.fr/alix/wordcloud.jsp?bibcode=hugo_miserables&frantext=on
This javascript lib provide a nice result, but is client side and do not allow caching.
I have started a java implementation with an HTML output.
https://github.com/oeuvres/Alix/blob/master/java/alix/viz/Cloud.java
Your result is far more nicer but your code do more than I need.
HTML rendering will not be pixel perfect compared to PNG but offers other advantages.
An HTML renderer needs only the collision result as a tuple (x, y, angle).
I will try to understand your code and find the central core, all your advice is welcome.
Hi @kennycason ,
just recognized, that you released 1.10
.
However, I think, that this release on mvn-central is broken.
I cannot find the "father-pom" for 1.9 / 1.10: http://repo1.maven.org/maven2/com/kennycason/kumo/
Modules are available in 1.9 and 1.10: http://repo1.maven.org/maven2/com/kennycason/
Maybe you can take a look at it :) - for now, it is not useable via mvn central and one have to install it locally.
hi,
is there a way to center the word cloud in the image?
Hey again, was still having a couple of issues with some of the emojis when using the Open Sans Emoji font as you were. I wasn't sure if you saw this on the closed issue so I've opened another.
Also, do you think it'd be possible to support Apple's default emoji collection with the Apple Color Emoji font? In a way so that they don't use the given colour scheme and just use the normal apple colours? Would be so fantastic to have the cute monkey and lion faces dotted around. Would genuinely like to lend a helping hand, I've a week of not much to do. If you were to point me in the right direction, I'm sure I could help out :)
Hey, nice library.
I loaded some text into it and settings frequencyAnalyzer.setMinWordLength(2);
for words such as "ok" and "gg", but this gives me an exception:
java.lang.IllegalArgumentException: Width (0) and height (14) cannot be <= 0
at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1016)
at java.awt.image.BufferedImage.<init>(BufferedImage.java:340)
at wordcloud.Word.<init>(Word.java:39)
at wordcloud.WordCloud.buildWord(WordCloud.java:260)
at wordcloud.WordCloud.buildwords(WordCloud.java:247)
at wordcloud.WordCloud.build(WordCloud.java:107)
at CloudCreator.main(CloudCreator.java:56)
where line 56 is wordCloud.build(wordFrequencies);
In example 3:
buildRandomColorPalette()
is not defined
In example 4: according to
https://github.com/kennycason/kumo/blob/master/src/main/java/com/kennycason/kumo/palette/LinearGradientColorPalette.java
constructor of LinearGradientColorPalette()
has colors first, then steps...
Hi.
I am new to Java and Eclipse.
I tried to run your project and it's all fine - does not have any bugs/missing libraries, but it does not have the getInputStream method. What does this function return if I have a text file of say tweets separated by new line ?
Hi,
I use Kumo to create a cloud of all used flickr tags of a user. flickr "normalizes" tags in some way by removing spaces between words of one tag set by the user, so the resulting word could be very long.
Now, if I define a too big max-size for the font like for example:
wordCloud.setFontScalar(new LinearFontScalar(10, 150));
so that a long tag with a high frequency would result in a too big rectangle to fit on the given cloud size.
In that case it seems, this tag is simply not rendered within the resulting cloud without any message.
Is it possible to auto-downsize the max font size in such case? Or throw a WordTooLongForCloudSizeException or something similar at least?
here is an example cloud of my used flickr tags.
Hello,
the usage of slf4j is nice to make a logger agnostic software. But the binding of log4j destroyed the agnostic.
Please set the scope of log4j bindings to "test". I have done this for you at pull request #61.
(Very thanks for your nice software)
I'm trying to run "rectangle" example (nb 3) from:
https://github.com/kennycason/kumo
but I get:
Exception in thread "main" java.lang.VerifyError: class net.sf.cglib.core.DebuggingClassWriter overrides final method visit.(IILjava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)V
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at net.sf.cglib.core.AbstractClassGenerator.<init>(AbstractClassGenerator.java:38)
at net.sf.cglib.core.KeyFactory$Generator.<init>(KeyFactory.java:127)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:112)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:108)
at net.sf.cglib.core.KeyFactory.create(KeyFactory.java:104)
at net.sf.cglib.proxy.Enhancer.<clinit>(Enhancer.java:69)
at ch.lambdaj.proxy.ProxyUtil.createEnhancer(ProxyUtil.java:89)
at ch.lambdaj.proxy.ProxyUtil.createProxy(ProxyUtil.java:49)
at ch.lambdaj.function.argument.ArgumentsFactory.createPlaceholder(ArgumentsFactory.java:52)
at ch.lambdaj.function.argument.ArgumentsFactory.registerNewArgument(ArgumentsFactory.java:45)
at ch.lambdaj.function.argument.ArgumentsFactory.createArgument(ArgumentsFactory.java:39)
at ch.lambdaj.function.argument.ArgumentsFactory.createArgument(ArgumentsFactory.java:31)
at ch.lambdaj.Lambda.on(Lambda.java:44)
at com.kennycason.kumo.WordCloud.maxFrequency(WordCloud.java:259)
at com.kennycason.kumo.WordCloud.buildWords(WordCloud.java:228)
at com.kennycason.kumo.WordCloud.build(WordCloud.java:90)
...
Can it support hyperlinking on each phrase/word we use
When generating word clouds, we are noticing that for some words the right hand edge is cut off.
This doesn't happen to all the words - roughly 50% appear perfectly:
And it can happen even when there is plenty of whitespace around the word:
Have you seen this issue before and do you have any views on the cause?
Below are some more details:
We are using the built in San Serif font:
private static final KumoFont WORD_CLOUD_KUMO_FONT = new KumoFont(new Font(Font.SANS_SERIF, Font.PLAIN, 12));
We are setting up the word cloud as follows:
final Dimension dimension = new Dimension(imageSize, imageSize);
final WordCloud wordCloud = new WordCloud(dimension, CollisionMode.RECTANGLE);
wordCloud.setPadding(0);
wordCloud.setBackground(new CircleBackground(imageSize / 2));
wordCloud.setBackgroundColor(Color.WHITE);
wordCloud.setColorPalette(new ColorPalette(style.getWordCloudColours()));
wordCloud.setFontScalar(new SqrtFontScalar(1, 40));
wordCloud.setAngleGenerator(new AngleGenerator(0));
wordCloud.setWordPlacer(new RTreeWordPlacer());
wordCloud.setKumoFont(WORD_CLOUD_KUMO_FONT);
Any thoughts on the cause would be received with gratitude and happy to provide further details as needed.
Hi, I see many of your example using getInputStream method, but the method was not in your code. Do you have a demo.java that can run some example? Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.