<commit_before>package de.unistuttgart.quadrama.io.tei.textgrid;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import org.apache.uima.fit.util.JCasUtil;
import org.apache.uima.jcas.JCas;

import de.unistuttgart.ims.drama.api.Act;
import de.unistuttgart.ims.drama.api.ActHeading;
import de.unistuttgart.ims.drama.api.Author;
import de.unistuttgart.ims.drama.api.Drama;
import de.unistuttgart.ims.drama.api.DramatisPersonae;
import de.unistuttgart.ims.drama.api.Figure;
import de.unistuttgart.ims.drama.api.Person;
import de.unistuttgart.ims.drama.api.Scene;
import de.unistuttgart.ims.drama.api.Speaker;
import de.unistuttgart.ims.drama.api.Speech;
import de.unistuttgart.ims.drama.api.Utterance;

public class TestGenerics {
	public static boolean debug = false;

	public static void checkMinimalStructure(JCas jcas) {
		assertTrue(JCasUtil.exists(jcas, Speaker.class));
		assertTrue(JCasUtil.exists(jcas, Utterance.class));
		assertTrue(JCasUtil.exists(jcas, Speech.class));

		for (Speaker speaker : JCasUtil.select(jcas, Speaker.class)) {
			assertNotNull(speaker.getCastFigure());
			assertFalse(speaker.getCastFigure().size() == 0);
			assertNotNull(speaker.getCoveredText(), speaker.getCastFigure(0));<commit_msg>minimal requirement that castFigures have ids, names and a displayname<commit_after>package de.unistuttgart.quadrama.io.tei.textgrid;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import org.apache.uima.fit.util.JCasUtil;
import org.apache.uima.jcas.JCas;

import de.unistuttgart.ims.drama.api.Act;
import de.unistuttgart.ims.drama.api.ActHeading;
import de.unistuttgart.ims.drama.api.Author;
import de.unistuttgart.ims.drama.api.CastFigure;
import de.unistuttgart.ims.drama.api.Drama;
import de.unistuttgart.ims.drama.api.DramatisPersonae;
import de.unistuttgart.ims.drama.api.Figure;
import de.unistuttgart.ims.drama.api.Person;
import de.unistuttgart.ims.drama.api.Scene;
import de.unistuttgart.ims.drama.api.Speaker;
import de.unistuttgart.ims.drama.api.Speech;
import de.unistuttgart.ims.drama.api.Utterance;

public class TestGenerics {
	public static boolean debug = false;

	public static void checkMinimalStructure(JCas jcas) {
		assertTrue(JCasUtil.exists(jcas, Speaker.class));
		assertTrue(JCasUtil.exists(jcas, Utterance.class));
		assertTrue(JCasUtil.exists(jcas, Speech.class));

		for (Speaker speaker : JCasUtil.select(jcas, Speaker.class)) {
			assertNotNull(speaker.getCastFigure());
			assertFalse(speaker.getCastFigure().size() == 0);
			assertNotNull(speaker.getCoveredText(), speaker.getCastFigure(0));
		}

		for (CastFigure cf : JCasUtil.select(jcas, CastFigure.class)) {
			assertNotNull(cf.getXmlId());
			assertNotNull(cf.getNames());
			assertNotNull(cf.getDisplayName());
{'fraction_non_alphanumeric': 0.1228923476005188, 'fraction_numerical': 0.0012970168612191958, 'mean_word_length': 5.932584269662922, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5457713', 'n_tokens_mistral': 1126, 'n_tokens_neox': 1077, 'n_words': 162}