<commit_before>/**
 * 
 */
package xpress;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import xpress.graphtags.GraphTagsResource;
import xpress.graphtags.TagRetriever;
import xpress.retrieve.TagCloudRetriever;
import xpress.storage.InMemoryRepository;
import xpress.storage.Repository;

import com.yammer.dropwizard.Service;
import com.yammer.dropwizard.assets.AssetsBundle;
import com.yammer.dropwizard.config.Bootstrap;
import com.yammer.dropwizard.config.Environment;

/**
 * @author mcq
 * 
 */
public class XpressService extends Service<XpressConfiguration> {

    public static void main(String[] args) throws Exception {
        new XpressService().run(args);
    }

    @Override
    public void initialize(Bootstrap<XpressConfiguration> bootstrap) {
        bootstrap.setName("Xpress");
        bootstrap.addBundle(new AssetsBundle("/assets/", "/"));
    }

    @Override
    public void run(XpressConfiguration configuration, Environment environment) {
        ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext("classpath:applicationContext.xml");
        Repository repository = ac.getBean(Repository.class);
        TagRetriever tagRetriever = ac.getBean(TagRetriever.class);

        TagCloudRetriever tagCloudRetriever = new TagCloudRetriever(repository);
        environment.addResource(new TagCloudResource(tagCloudRetriever));
        final VoteResource voteResource = new VoteResource(InMemoryRepository.getInstance());
        voteResource.setRepository(repository);
        environment.addResource(voteResource);
        environment.addResource(new MoodGraphResource(new MoodGraphGenerator(InMemoryRepository.getInstance())));
        final GraphTagsResource resource = new GraphTagsResource();
        resource.setTagRetriever(tagRetriever);
        environment.addResource(resource);

    }

}<commit_msg>simplify all to use db repo<commit_after>/**
 * 
 */
package xpress;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import xpress.graphtags.GraphTagsResource;
import xpress.graphtags.TagRetriever;
import xpress.retrieve.TagCloudRetriever;
import xpress.storage.InMemoryRepository;
import xpress.storage.Repository;

import com.yammer.dropwizard.Service;
import com.yammer.dropwizard.assets.AssetsBundle;
import com.yammer.dropwizard.config.Bootstrap;
import com.yammer.dropwizard.config.Environment;

/**
 * @author mcq
 * 
 */
public class XpressService extends Service<XpressConfiguration> {

    public static void main(String[] args) throws Exception {
        new XpressService().run(args);
    }

    @Override
    public void initialize(Bootstrap<XpressConfiguration> bootstrap) {
        bootstrap.setName("Xpress");
        bootstrap.addBundle(new AssetsBundle("/assets/", "/"));
    }

    @Override
    public void run(XpressConfiguration configuration, Environment environment) {
        ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext("classpath:applicationContext.xml");
        Repository repository = ac.getBean(Repository.class);
        TagRetriever tagRetriever = ac.getBean(TagRetriever.class);

        environment.addResource(new TagCloudResource(new TagCloudRetriever(repository)));
        environment.addResource(new VoteResource(repository));
        environment.addResource(new MoodGraphResource(new MoodGraphGenerator(repository)));
        final GraphTagsResource resource = new GraphTagsResource();
        resource.setTagRetriever(tagRetriever);
        environment.addResource(resource);

    }

}
{'fraction_non_alphanumeric': 0.09374122930115071, 'fraction_numerical': 0.0, 'mean_word_length': 4.7024, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '6946495', 'n_tokens_mistral': 978, 'n_tokens_neox': 948, 'n_words': 171}