<commit_before>package com.github.kristofa.wickettagcloud.example;

import java.util.Arrays;
import java.util.Collection;

import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.link.AbstractLink;
import org.apache.wicket.markup.html.link.ExternalLink;
import org.apache.wicket.markup.html.link.PopupSettings;
import org.apache.wicket.model.IModel;

import com.github.kristofa.wickettagcloud.TagCloudPanel;
import com.github.kristofa.wickettagcloud.TagCloudTag;

/**
 * The tag cloud example app home page.
 * 
 * @author kristof
 */
public class HomePage extends WebPage {

    private static final long serialVersionUID = 1119127679504030126L;

    /**
     * {@inheritDoc}
     */
    @Override
    protected void onInitialize() {
        super.onInitialize();

        add(new TagCloudPanel("tagcloud", new TagCloudModel(), 12, 48, "Today's popular websites"));
    }

    /**
     * The model that provides the tags. This example simply provides a fixed list of tags but by using a model you can get
     * tags from anywhere...
     * 
     * @author kristof
     */
    private class TagCloudModel implements IModel<Collection<TagCloudTag>> {

        private static final long serialVersionUID = 936449833892290813L;

        @Override
        public void detach() {

        }

        @Override
        public Collection<TagCloudTag> getObject() {
            return Arrays.<TagCloudTag>asList(new TagCloudTagImpl("google", "http://www.google.com", 18),
                new TagCloudTagImpl("facebook", "http://www.facebook.com", 20), new TagCloudTagImpl("github",
                    "http://www.github.com", 4), new TagCloudTagImpl("twitter", "http://www.twitter.com", 16),
                new TagCloudTagImpl("flickr", "http://www.flickr.com", 14), new TagCloudTagImpl("linkedin",
                    "http:/www.linkedin.com", 12), new TagCloudTagImpl("foursquare", "http://www.foursquare.com", 6),
                new TagCloudTagImpl("stackoverflow", "http://www.stackoverflow.com", 6), new TagCloudTagImpl("delicious",
                    "http://www.delicious.com", 8));
        }

        @Override
        public void setObject(final Collection<TagCloudTag> object) {

        }

    }

    /**
     * {@link TagCloudTag} implementation.
     * 
     * @author kristof
     */
    private class TagCloudTagImpl implements TagCloudTag {

        private static final long serialVersionUID = 2080387471025248720L;
        private final String name;
        private final String url;
        private final int weight;
<commit_msg>Fix example app. Linkedin url only had 1 slash.<commit_after>package com.github.kristofa.wickettagcloud.example;

import java.util.Arrays;
import java.util.Collection;

import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.link.AbstractLink;
import org.apache.wicket.markup.html.link.ExternalLink;
import org.apache.wicket.markup.html.link.PopupSettings;
import org.apache.wicket.model.IModel;

import com.github.kristofa.wickettagcloud.TagCloudPanel;
import com.github.kristofa.wickettagcloud.TagCloudTag;

/**
 * The tag cloud example app home page.
 * 
 * @author kristof
 */
public class HomePage extends WebPage {

    private static final long serialVersionUID = 1119127679504030126L;

    /**
     * {@inheritDoc}
     */
    @Override
    protected void onInitialize() {
        super.onInitialize();

        add(new TagCloudPanel("tagcloud", new TagCloudModel(), 12, 48, "Today's popular websites"));
    }

    /**
     * The model that provides the tags. This example simply provides a fixed list of tags but by using a model you can get
     * tags from anywhere...
     * 
     * @author kristof
     */
    private class TagCloudModel implements IModel<Collection<TagCloudTag>> {

        private static final long serialVersionUID = 936449833892290813L;

        @Override
        public void detach() {

        }

        @Override
        public Collection<TagCloudTag> getObject() {
            return Arrays.<TagCloudTag>asList(new TagCloudTagImpl("google", "http://www.google.com", 18),
                new TagCloudTagImpl("facebook", "http://www.facebook.com", 20), new TagCloudTagImpl("github",
                    "http://www.github.com", 4), new TagCloudTagImpl("twitter", "http://www.twitter.com", 16),
                new TagCloudTagImpl("flickr", "http://www.flickr.com", 14), new TagCloudTagImpl("linkedin",
                    "http://www.linkedin.com", 12), new TagCloudTagImpl("foursquare", "http://www.foursquare.com", 6),
                new TagCloudTagImpl("stackoverflow", "http://www.stackoverflow.com", 6), new TagCloudTagImpl("delicious",
                    "http://www.delicious.com", 8));
        }

        @Override
        public void setObject(final Collection<TagCloudTag> object) {

        }

    }

    /**
     * {@link TagCloudTag} implementation.
     * 
     * @author kristof
     */
    private class TagCloudTagImpl implements TagCloudTag {

        private static final long serialVersionUID = 2080387471025248720L;
        private final String name;
        private final String url;
        private final int weight;

{'fraction_non_alphanumeric': 0.11372851901911565, 'fraction_numerical': 0.028770032824869667, 'mean_word_length': 2.8427299703264093, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 18, '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': '5630122', 'n_tokens_mistral': 1630, 'n_tokens_neox': 1476, 'n_words': 354}