package com.formulasearchengine.mathosphere.mlp.text;

import com.formulasearchengine.mathosphere.mlp.PatternMatchingRelationFinder;
import com.formulasearchengine.mathosphere.mlp.cli.FlinkMlpCommandConfig;
import com.formulasearchengine.mathosphere.mlp.contracts.TextAnnotatorMapper;
import com.formulasearchengine.mathosphere.mlp.pojos.Formula;
import com.formulasearchengine.mathosphere.mlp.pojos.MathTag;
import com.formulasearchengine.mathosphere.mlp.pojos.Sentence;
import com.formulasearchengine.mathosphere.mlp.pojos.Word;
import org.apache.commons.io.IOUtils;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.List;

import static org.junit.Assert.assertEquals;

public class PosTaggerTestGer {

  private static final Logger LOGGER = LoggerFactory.getLogger(PosTaggerTestGer.class);
	/**
	 * other models
	 * "edu/stanford/nlp/models/pos-tagger/german/german-fast.tagger",
	 * "edu/stanford/nlp/models/pos-tagger/german/german-fast-caseless.tagger",
	 * "edu/stanford/nlp/models/pos-tagger/german/german-hgc.tagger"
	 */
	private static final String GER = "edu/stanford/nlp/models/pos-tagger/german/german-hgc.tagger";
// other models
  @Test
  public void simpleGermanTest() throws Exception {
    FlinkMlpCommandConfig cfg = FlinkMlpCommandConfig.test();
    PosTagger nlpProcessor = PosTagger.create(cfg.getLanguage(), GER);
    String text = "Dies ist ein simpler Beispieltext.";

    List<MathTag> mathTags = WikiTextUtils.findMathTags(text);
    List<Formula> formulas = TextAnnotatorMapper.toFormulas(mathTags, false);

    String newText = WikiTextUtils.replaceAllFormulas(text, mathTags);
    String cleanText = WikiTextUtils.extractPlainText(newText);

    List<Sentence> result = nlpProcessor.process(cleanText, formulas);

    List<Word> expected = Arrays.asList(w("Dies", "PDS"), w("ist", "VAFIN"), w("ein", "ART"), w("simpler","ADJA"), w("Beispieltext", "NN"),
      w(".", "$."));

    List<Word> sentence = result.get(0).getWords();
    assertEquals(expected, sentence.subList(0, expected.size()));
    LOGGER.debug("full result: {}", result);
  }

  public static Word w(String word, String tag) {
    return new Word(word, tag);
  }

  public static String readText(String name) throws IOException {
    InputStream inputStream = PatternMatchingRelationFinder.class.getResourceAsStream(name);
    return IOUtils.toString(inputStream);
  }

}

@@ -2191,24 +2191,667 @@
 result);%0A  %7D
+%0A%09@Test%0A  public void mediumGermanTest() throws Exception %7B%0A%09%09final String text = IOUtils.toString(PosTaggerTest.class.getResourceAsStream(%22deText.txt%22));%0A%0A    FlinkMlpCommandConfig cfg = FlinkMlpCommandConfig.test();%0A    PosTagger nlpProcessor = PosTagger.create(cfg.getLanguage(), GER);%0A%0A%0A    List%3CMathTag%3E mathTags = WikiTextUtils.findMathTags(text);%0A    List%3CFormula%3E formulas = TextAnnotatorMapper.toFormulas(mathTags, false);%0A%0A    String newText = WikiTextUtils.replaceAllFormulas(text, mathTags);%0A    String cleanText = WikiTextUtils.extractPlainText(newText);%0A%0A    List%3CSentence%3E result = nlpProcessor.process(cleanText, formulas);%0A  %7D
 %0A%0A  public s

Extend german tests