<commit_before>package org.waterforpeople.mapping.analytics;

import java.util.logging.Level;
import java.util.logging.Logger;

import org.waterforpeople.mapping.analytics.dao.SurveyInstanceSummaryDao;
import org.waterforpeople.mapping.dao.CommunityDao;
import org.waterforpeople.mapping.dao.SurveyInstanceDAO;
import org.waterforpeople.mapping.domain.Community;
import org.waterforpeople.mapping.domain.QuestionAnswerStore;
import org.waterforpeople.mapping.domain.SurveyInstance;

import com.gallatinsystems.framework.analytics.summarization.DataSummarizer;

/**
 * Populates SurveyInstanceSummary objects (a roll-up that aggregates survey
 * instances by country/region/day)
 * 
 * @author <NAME>
 * 
 */
public class SurveyInstanceSummarizer implements DataSummarizer {

	private static Logger logger = Logger
			.getLogger(SurveyInstanceSummarizer.class.getName());
	// TODO: find a better way of identifying the community?
	private static final String COMMUNITY_QUESTION_ID = "q2";

	/**
	 * looks up a survey instance then finds it's corresponding community (by
	 * looking at the questionAnswerStore until it finds the question with the
	 * ID that matches the configured value. If it finds the community, it will
	 * increment the count for the summary record.
	 */
	@Override<commit_msg>changed questionID for community question in instance summarizer<commit_after>package org.waterforpeople.mapping.analytics;

import java.util.logging.Level;
import java.util.logging.Logger;

import org.waterforpeople.mapping.analytics.dao.SurveyInstanceSummaryDao;
import org.waterforpeople.mapping.dao.CommunityDao;
import org.waterforpeople.mapping.dao.SurveyInstanceDAO;
import org.waterforpeople.mapping.domain.Community;
import org.waterforpeople.mapping.domain.QuestionAnswerStore;
import org.waterforpeople.mapping.domain.SurveyInstance;

import com.gallatinsystems.framework.analytics.summarization.DataSummarizer;

/**
 * Populates SurveyInstanceSummary objects (a roll-up that aggregates survey
 * instances by country/region/day)
 * 
 * @author <NAME>
 * 
 */
public class SurveyInstanceSummarizer implements DataSummarizer {

	private static Logger logger = Logger
			.getLogger(SurveyInstanceSummarizer.class.getName());
	// TODO: find a better way of identifying the community?
	private static final String COMMUNITY_QUESTION_ID = "qm1";

	/**
	 * looks up a survey instance then finds it's corresponding community (by
	 * looking at the questionAnswerStore until it finds the question with the
	 * ID that matches the configured value. If it finds the community, it will
	 * increment the count for the summary record.
	 */
	@Override
{'fraction_non_alphanumeric': 0.07785336356764928, 'fraction_numerical': 0.0007558578987150416, 'mean_word_length': 5.393719806763285, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2406713', 'n_tokens_mistral': 745, 'n_tokens_neox': 712, 'n_words': 210}