<commit_before>package anabalica.github.io.meowletters.metrics;

/**
 * Score class keeps the current user score. User starts from score 0 and keeps
 * gaining more for each correct move. There is no top limit.
 *
 * @author <NAME>
 */
public class Score {
    int points;

    public Score() {
        points = 0;
    }

    public Score(int points) {
        setPoints(points);
    }

    public void setPoints(int points) throws IllegalArgumentException {
        if (points < 0) {
            throw new IllegalArgumentException("Number of points must be a positive number");
        }
        this.points = points;
    }

    public int getPoints() {
        return points;
    }

    /**
     * Add points to the score.
     *
     * @param points int positive amount of points
     * @return int total points
     */
    public int addPoints(int points) {
        if (points > 0) {
            this.points += points;
        }
        return this.points;
    }

    /**
     * Update the score according to the size of the letter chain.
     *
     * @param chainSize int size of letter chain
     * @return int total points
     */
    public int update(int chainSize) {
        if (chainSize > 1) {
            points += (chainSize - 1) * 5;
        }
        return points;
    }

    /**
     * Reset the score.
     */
    public Score reset() {
        points = 0;<commit_msg>update Score.update()<commit_after>package anabalica.github.io.meowletters.metrics;

/**
 * Score class keeps the current user score. User starts from score 0 and keeps
 * gaining more for each correct move. There is no top limit.
 *
 * @author <NAME>
 */
public class Score {
    int points;

    public Score() {
        points = 0;
    }

    public Score(int points) {
        setPoints(points);
    }

    public void setPoints(int points) throws IllegalArgumentException {
        if (points < 0) {
            throw new IllegalArgumentException("Number of points must be a positive number");
        }
        this.points = points;
    }

    public int getPoints() {
        return points;
    }

    /**
     * Add points to the score.
     *
     * @param points int positive amount of points
     * @return int total points
     */
    public int addPoints(int points) {
        if (points > 0) {
            this.points += points;
        }
        return this.points;
    }

    /**
     * Update the score according to the size of the letter chain.
     *
     * @param chainSize int size of letter chain
     * @return int total points
     */
    public int update(int chainSize) {
        if (chainSize > 1) {
            points += (chainSize - 1) * 10;
        }
        return points;
    }

    /**
     * Reset the score.
     */
    public Score reset() {
        points = 0;
{'fraction_non_alphanumeric': 0.09299820466786356, 'fraction_numerical': 0.006104129263913824, 'mean_word_length': 1.8284263959390863, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '6744320', 'n_tokens_mistral': 790, 'n_tokens_neox': 755, 'n_words': 276}