<commit_before>package org.runetranscriber.core;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;

/**
 * Provides tests for the <code>DefaultTranscriber</code> class.
 */
public class DefaultTranscriberTest
{
    /**
     * @param list List.
     * @param key Key.
     * @param replacement Replacement.
     */
    protected void replaceAll(final PhonemeList list, final Phoneme key, final Phoneme replacement)
    {
        for (int i = 0; i < list.size(); i++)
        {
            if (key == list.get(i))
            {
                list.set(i, replacement);
            }
        }
    }

    /**
     * @param result Result.
     * @param expected Expected.
     * @param isVerbose Flag indicating if the output should be verbose.
     */
    protected void verifyFontLetters(final FontLetterList result, final FontLetterList expected, final boolean isVerbose)
    {
        final String expectedString = expected.toString();
        final String resultString = result.toString();

        if (isVerbose)
        {
            System.out.println("expected = [" + expectedString + "]");
            System.out.println("result   = [" + resultString + "]");
        }

        assertNotNull(result);
        assertThat(resultString, is(expectedString));
    }

    /**
     * @param result Result.
     * @param expected Expected.
     * @param isVerbose Flag indicating if the output should be verbose.
     */
    protected void verifyLanguageLetters(final LanguageLetterList result, final LanguageLetterList expected,
            final boolean isVerbose)
    {
        final String expectedString = expected.toString();
        final String resultString = result.toString();

        if (isVerbose)
        {
            System.out.println("expected = [" + expectedString + "]");
            System.out.println("result   = [" + resultString + "]");<commit_msg>Changed to ignore capital letters and apostrophes in language letter comparison.<commit_after>package org.runetranscriber.core;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;

/**
 * Provides tests for the <code>DefaultTranscriber</code> class.
 */
public class DefaultTranscriberTest
{
    /**
     * @param list List.
     * @param key Key.
     * @param replacement Replacement.
     */
    protected void replaceAll(final PhonemeList list, final Phoneme key, final Phoneme replacement)
    {
        for (int i = 0; i < list.size(); i++)
        {
            if (key == list.get(i))
            {
                list.set(i, replacement);
            }
        }
    }

    /**
     * @param result Result.
     * @param expected Expected.
     * @param isVerbose Flag indicating if the output should be verbose.
     */
    protected void verifyFontLetters(final FontLetterList result, final FontLetterList expected, final boolean isVerbose)
    {
        final String expectedString = expected.toString();
        final String resultString = result.toString();

        if (isVerbose)
        {
            System.out.println("expected = [" + expectedString + "]");
            System.out.println("result   = [" + resultString + "]");
        }

        assertNotNull(result);
        assertThat(resultString, is(expectedString));
    }

    /**
     * @param result Result.
     * @param expected Expected.
     * @param isVerbose Flag indicating if the output should be verbose.
     */
    protected void verifyLanguageLetters(final LanguageLetterList result, final LanguageLetterList expected,
            final boolean isVerbose)
    {
        // Capital letters and apostrophes are lost in transcription.
        String expectedString = expected.toString().toLowerCase();
        expectedString = expectedString.replaceAll("[']", "");
        final String resultString = result.toString();

        if (isVerbose)
        {
            System.out.println("expected = [" + expectedString + "]");
            System.out.println("result   = [" + resultString + "]");
{'fraction_non_alphanumeric': 0.10636231180184555, 'fraction_numerical': 0.00048567265662943174, 'mean_word_length': 2.4182572614107882, 'pattern_counts': {'":': 0, '<': 9, '<?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': '1220383', 'n_tokens_mistral': 1109, 'n_tokens_neox': 1086, 'n_words': 293}