<commit_before>package com.nigorojr.typebest;

import java.awt.Color;
import java.util.ArrayList;

import javax.swing.JLabel;

public class Word {
    private ArrayList<Letter> word = new ArrayList<Letter>();
    private String rawWord;

    /**
     * Accepts a String which is what will be shown in this JLabel.
     * The constructor will then split the word into letters and create a Letter
     * object for each letter.
     * 
     * @param word
     *            The word that will be shown as a collection of "Letter" class.
     */
    public Word(String word) {
        rawWord = word;

        split();
    }

    /**
     * Splits up the word into letters and add them to an ArrayList.
     */
    private void split() {
        for (int i = 0; i < rawWord.length(); i++) {
            Letter letter = new Letter(rawWord.charAt(i));
            word.add(letter);
        }
    }

    /**
     * Returns the width of the word by adding the width of all the letters
     * consisting the word.
     * 
     * @return The width of the word.
     */
    public int getWidth() {
        int width = 0;
        for (int i = 0; i < word.size(); i++)
            width += word.get(i).getWidth();
        return width;
    }
}<commit_msg>Change Word class to extend JPanel<commit_after>package com.nigorojr.typebest;

import java.util.ArrayList;

import javax.swing.JPanel;

public class Word extends JPanel {
    private ArrayList<Letter> word = new ArrayList<Letter>();
    private String rawWord;

    /**
     * Accepts a String which is what will be shown in this JPanel.
     * The constructor will then split the word into letters and create a Letter
     * object for each letter. After that, Letter objects are added to the
     * this JPanel.
     * 
     * @param word
     *            The word that will be shown as a collection of "Letter" class.
     */
    public Word(String word) {
        rawWord = word;

        split();
        for (int i = 0; i < this.word.size(); i++)
            this.add(this.word.get(i));
    }

    /**
     * Splits up the word into letters and add them to an ArrayList.
     */
    private void split() {
        for (int i = 0; i < rawWord.length(); i++) {
            Letter letter = new Letter(rawWord.charAt(i));
            word.add(letter);
        }
    }
}
{'fraction_non_alphanumeric': 0.10064794816414686, 'fraction_numerical': 0.0021598272138228943, 'mean_word_length': 2.023498694516971, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, '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': '230533', 'n_tokens_mistral': 679, 'n_tokens_neox': 654, 'n_words': 253}