You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
list/src/test/java/WordFormationTest.java

56 lines
1.5 KiB

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<String, AtomicLong> 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<String> 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 = "";
}
}