-
Notifications
You must be signed in to change notification settings - Fork 7
/
SimpleParsing.java
26 lines (19 loc) · 1020 Bytes
/
SimpleParsing.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package org.trnltk.doc.simpleparsing;
import org.trnltk.model.morpheme.MorphemeContainer;
import org.trnltk.morphology.contextless.parser.MorphologicParser;
import org.trnltk.morphology.contextless.parser.ContextlessMorphologicParserBuilder;
import org.trnltk.util.MorphemeContainerFormatter;
import java.util.List;
public class SimpleParsing {
public static void main(String[] args) {
// create a morphologic parser with simplest suffix graph and numeral suffix graph, roots from bundled dictionary
MorphologicParser parser = ContextlessMorphologicParserBuilder.createSimple();
// parse surface
List<MorphemeContainer> morphemeContainers = parser.parseStr("eti");
// print results
for (MorphemeContainer morphemeContainer : morphemeContainers) {
// printing format is the simplest one : no suffix form applications, no grouping
System.out.println(MorphemeContainerFormatter.formatMorphemeContainer(morphemeContainer));
}
}
}