<commit_before>package org.nick.wwwjdic.test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

import org.junit.Test;
import org.nick.wwwjdic.DictionaryEntry;
import org.nick.wwwjdic.history.FavoritesEntryParser;

public class DictionaryEntryTest {

    @Test
    public void testParse() {
        String edictStr = "搶 [񂹂] /(n) doctors/teachers/";
        DictionaryEntry entry = DictionaryEntry.parseEdict(edictStr);

        assertEquals("搶", entry.getWord());
        assertEquals("񂹂", entry.getReading());
        assertEquals(2, entry.getMeanings().size());
        assertEquals("(n) doctors", entry.getMeanings().get(0));
        assertEquals("teachers", entry.getMeanings().get(1));
        assertEquals("[񂹂]  (n) doctors teachers", entry
                .getTranslationString());
    }

    @Test
    public void testNoReading() {
        String edictStr = "\eBhbO /(n) salty dog (cocktail)/";
        DictionaryEntry entry = DictionaryEntry.parseEdict(edictStr);

        assertEquals("\eBhbO", entry.getWord());
        assertNull(entry.getReading());
        assertEquals("(n) salty dog (cocktail)", entry.getTranslationString());
        assertEquals(1, entry.getMeanings().size());
        assertEquals("(n) salty dog (cocktail)", entry.getMeanings().get(0));

    }

    @Test
    public void testEdict() throws Exception {
        System.out.println("Testing EDICT...");
        testEdictFile("/home/nick/android/wwwjdic/wwwjdic-test/dict/edict");
    }

    @Test
    public void testEdiclsd() throws Exception {
        testEdictFile("/home/nick/android/wwwjdic/wwwjdic-test/dict/ediclsd4");
    }

    @Test
    public void testLawgledt() throws Exception {
        testEdictFile("/home/nick/android/wwwjdic/wwwjdic-test/dict/lawgledt");
    }

    @Test
    public void testCompdic() throws Exception {
        testEdictFile("/home/nick/android/wwwjdic/wwwjdic-test/dict/compdic");
    }

    @Test
    public void testEngscidic() throws Exception {
        testEdictFile("/home/nick/android/wwwjdic/wwwjdic-test/dict/engscidic");
    }

    @Test
    public void testRiverwater() throws Exception {
        testEdictFile("/home/nick/android/wwwjdic/wwwjdic-test/dict/riverwater");
    }
<commit_msg>added EDICT2 test<commit_after>package org.nick.wwwjdic.test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

import org.junit.Test;
import org.nick.wwwjdic.DictionaryEntry;
import org.nick.wwwjdic.history.FavoritesEntryParser;

public class DictionaryEntryTest {

    @Test
    public void testParse() {
        String edictStr = "搶 [񂹂] /(n) doctors/teachers/";
        DictionaryEntry entry = DictionaryEntry.parseEdict(edictStr);

        assertEquals("搶", entry.getWord());
        assertEquals("񂹂", entry.getReading());
        assertEquals(2, entry.getMeanings().size());
        assertEquals("(n) doctors", entry.getMeanings().get(0));
        assertEquals("teachers", entry.getMeanings().get(1));
        assertEquals("[񂹂]  (n) doctors teachers", entry
                .getTranslationString());
    }

    @Test
    public void testNoReading() {
        String edictStr = "\eBhbO /(n) salty dog (cocktail)/";
        DictionaryEntry entry = DictionaryEntry.parseEdict(edictStr);

        assertEquals("\eBhbO", entry.getWord());
        assertNull(entry.getReading());
        assertEquals("(n) salty dog (cocktail)", entry.getTranslationString());
        assertEquals(1, entry.getMeanings().size());
        assertEquals("(n) salty dog (cocktail)", entry.getMeanings().get(0));

    }

    @Test
    public void testEdict() throws Exception {
        System.out.println("Testing EDICT...");
        testEdictFile("/home/nick/android/wwwjdic/wwwjdic-test/dict/edict");
    }

    @Test
    public void testEdict2() throws Exception {
        System.out.println("Testing EDICT2...");
        testEdictFile("/home/nick/android/wwwjdic/wwwjdic-test/dict/edict2");
    }

    @Test
    public void testEdiclsd() throws Exception {
        testEdictFile("/home/nick/android/wwwjdic/wwwjdic-test/dict/ediclsd4");
    }

    @Test
    public void testLawgledt() throws Exception {
        testEdictFile("/home/nick/android/wwwjdic/wwwjdic-test/dict/lawgledt");
    }

    @Test
    public void testCompdic() throws Exception {
        testEdictFile("/home/nick/android/wwwjdic/wwwjdic-test/dict/compdic");
    }

    @Test
    public void testEngscidic() throws Exception {
        testEdictFile("/home/nick/android/wwwjdic/wwwjdic-test/dict/engscidic");
    }

    @Test
    public void testRiverwater() throws Exception {
        testEdictFile("/home/nick/android/wwwjdic/wwwjdic-test/dict/riverwater");
    }

{'fraction_non_alphanumeric': 0.1355268311790051, 'fraction_numerical': 0.003133568350959655, 'mean_word_length': 3.291596638655462, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 32, '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': '2142388', 'n_tokens_mistral': 1624, 'n_tokens_neox': 1568, 'n_words': 277}