Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FrequencyAnalyzer is de-duplicating words #103

Open
uqlel opened this issue May 5, 2021 · 2 comments
Open

FrequencyAnalyzer is de-duplicating words #103

uqlel opened this issue May 5, 2021 · 2 comments

Comments

@uqlel
Copy link

uqlel commented May 5, 2021

files/test.txt:

test1
test1
test1
test2
test2
test2

my function:

final FrequencyAnalyzer frequencyAnalyzer = new FrequencyAnalyzer();
        frequencyAnalyzer.setWordFrequenciesToReturn(600);
        frequencyAnalyzer.setMinWordLength(5);

        final List<WordFrequency> wordFrequencies = frequencyAnalyzer.load("./files/test.txt");
        final Dimension dimension = new Dimension(1024, 1024);
        final WordCloud wordCloud = new WordCloud(dimension, CollisionMode.PIXEL_PERFECT);
        wordCloud.setPadding(1);
        wordCloud.setBackgroundColor(Color.WHITE);
        wordCloud.setBackground(new PixelBoundaryBackground("./files/bg.png"));
        wordCloud.setColorPalette(new ColorPalette(new Color(0x4055F1), new Color(0x408DF1), new Color(0x40AAF1), new Color(0x40C5F1), new Color(0x40D3F1), new Color(0x000000)));
        wordCloud.setFontScalar(new SqrtFontScalar(10, 50));
        wordCloud.build(wordFrequencies);
        wordCloud.writeToFile("./files/out.png");

files/out.png:
obraz
console output:

[main] INFO com.kennycason.kumo.WordCloud - placed: test2 (1/2)
[main] INFO com.kennycason.kumo.WordCloud - placed: test1 (2/2)
[main] INFO com.kennycason.kumo.WordCloud - Saving WordCloud to: ./files/out.png
@uqlel
Copy link
Author

uqlel commented May 5, 2021

wordCloud.getSkipped() is returning []

@Daxunyu
Copy link
Contributor

Daxunyu commented May 19, 2021

Hi uqlel! I like your method of using test cases to improve the performance of the code and function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants