import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.Map; import java.util.concurrent.atomic.AtomicLong; import javafx.collections.FXCollections; import org.junit.Test; import alg.inflectedJOS.WordFormation; import alg.ngram.Ngrams; import data.*; public class WordFormationTest { @Test public void calculationTest() throws UnsupportedEncodingException { Map result = null; Filter filter = new Filter(); filter.setAl(AnalysisLevel.STRING_LEVEL); filter.setNgramValue(1); Corpus testCorpus = new Corpus(); testCorpus.setCorpusType(CorpusType.GIGAFIDA); testCorpus.setDetectedCorpusFiles(new ArrayList<>()); ArrayList taxForCombo = new ArrayList<>(); taxForCombo.add("tisk-periodično-časopis"); testCorpus.setTaxonomy(FXCollections.observableArrayList(taxForCombo)); // tests: // - normal ngrams - word // midCorpus contains 5 words which should make for 3 3-grams filter.setCalculateFor(CalculateFor.MORPHOSYNTACTIC_PROPERTY); StatisticsNew stats = new StatisticsNew(testCorpus, filter, false); Ngrams.calculateForAll(Common.josTest, stats); result = stats.getResult(); WordFormation.calculateStatistics(stats); Object[][] resultArr = stats.getResultCustom(); String debug = ""; } @Test public void testAnything() { String a = "Somei"; String b = "SomeiD"; String c = a.substring(0, 5); String d = b.substring(0, 5); String debug = ""; } }