<commit_before>package com.thanglequoc.aqicalculator;

import java.util.Optional;

/**
 * A calculator use to calculate AQI from pollutant concentration, support both
 * <b>regular AQI</b> calculation and <b>Nowcast AQI</b> calculation. This
 * object is intended to be a singleton object to avoid perfomance issue.
 * <p>
 * To use the <i>AQICalculator</i> object, get its instance by calling
 * <tt>getAQICalculatorInstance() </tt> method directly
 * 
 * @author ThangLeQuoc
 *
 */

public class AQICalculator {

    private PollutantsBreakpointGenerator breakpointGenerator;

    private AQIMessageGenerator messageGenerator;

    private PollutantsBreakpoint pollutantsBreakpoint;

    private PollutantBreakpoint pollutantBreakpoint;

    private Optional<PollutantConcentration> targetPollutantConcentration;

    private NowcastCalculator nowcastCalculator;

    private PollutantConcentrationTruncator truncator;

    private static AQICalculator uniqueAQICalculatorInstance;

    /**
     * Gets the AQI calculator instance.
     *
     * @return the AQI calculator instance
     */
    public static AQICalculator getAQICalculatorInstance() {
	if (uniqueAQICalculatorInstance == null) {
	    uniqueAQICalculatorInstance = new AQICalculator();
	}
	return uniqueAQICalculatorInstance;
    }

    /**
     * Instantiates a new AQI calculator.
     */
    private AQICalculator() {
	/*
	 * AQI Calculator will generate the following thing
	 * PollutantBreakpointGenerator: Generator to get the breakpoints table
	 * from JSON File PollutantsBreakpoint: Store a list of pollutant
	 * breakpoint Nowcast Calculator: calculator to get avgAQI at present
	 * for PM10, PM2.5, Ozone
	 */
	
	//TODO: Handle this exception
	try {
	    this.breakpointGenerator = new PollutantsBreakpointGenerator();
	    this.messageGenerator = new AQIMessageGenerator();

	} catch (Exception e) {

	    e.printStackTrace();
	}
	this.pollutantsBreakpoint = breakpointGenerator.getPollutantsBreakpoint();<commit_msg>Small File Change To Trigger Travis Build<commit_after>package com.thanglequoc.aqicalculator;

import java.util.Optional;

/**
 * A calculator use to calculate AQI from pollutant concentration, support both
 * <b>regular AQI</b> calculation and <b>Nowcast AQI</b> calculation. This
 * object is intended to be a singleton object to avoid perfomance issue.
 * <p>
 * To use the <i>AQICalculator</i> object, get its instance by calling
 * <tt>getAQICalculatorInstance() </tt> method directly
 * 
 * @author ThangLeQuoc
 *
 */

public class AQICalculator {

    private PollutantsBreakpointGenerator breakpointGenerator;

    private AQIMessageGenerator messageGenerator;

    private PollutantsBreakpoint pollutantsBreakpoint;

    private PollutantBreakpoint pollutantBreakpoint;

    private Optional<PollutantConcentration> targetPollutantConcentration;

    private NowcastCalculator nowcastCalculator;

    private PollutantConcentrationTruncator truncator;

    private static AQICalculator uniqueAQICalculatorInstance;

    /**
     * Gets the AQI calculator instance.
     *
     * @return the AQI calculator instance
     */
    public static AQICalculator getAQICalculatorInstance() {
	if (uniqueAQICalculatorInstance == null) {
	    uniqueAQICalculatorInstance = new AQICalculator();
	}
	return uniqueAQICalculatorInstance;
    }

    /**
     * Instantiates a new AQI calculator.
     */
    private AQICalculator() {
	/*
	 * AQI Calculator will generate the following thing
	 * PollutantBreakpointGenerator: Generator to get the breakpoints table
	 * from JSON File PollutantsBreakpoint: Store a list of pollutant
	 * breakpoint Nowcast Calculator: calculator to get avgAQI at present
	 * for PM10, PM2.5, Ozone
	 */
	
	//TODO: Handle this exception
	try {
	    this.breakpointGenerator = new PollutantsBreakpointGenerator();
	    this.messageGenerator = new AQIMessageGenerator();

	} catch (Exception e) {
	    e.printStackTrace();
	}
	this.pollutantsBreakpoint = breakpointGenerator.getPollutantsBreakpoint();
{'fraction_non_alphanumeric': 0.07066434436426972, 'fraction_numerical': 0.0019905449116695696, 'mean_word_length': 4.234375, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '3138877', 'n_tokens_mistral': 1270, 'n_tokens_neox': 1115, 'n_words': 329}