use of org.languagetool.tagging.ManualTagger in project languagetool by languagetool-org.
the class MatchTest method setUp.
//-- setup
@Before
public void setUp() throws Exception {
tagger = new ManualTaggerAdapter(new ManualTagger(new ByteArrayInputStream(TEST_DATA.getBytes("UTF-8"))));
synthesizer = new ManualSynthesizerAdapter(new ManualSynthesizer(new ByteArrayInputStream(TEST_DATA.getBytes("UTF-8"))));
languageTool = new JLanguageTool(new Demo() {
@Override
public String getName() {
return "TEST";
}
@Override
public Synthesizer getSynthesizer() {
return MatchTest.this.synthesizer;
}
@Override
public Tagger getTagger() {
return MatchTest.this.tagger;
}
});
}
use of org.languagetool.tagging.ManualTagger in project languagetool by languagetool-org.
the class EsperantoTagger method lazyInit.
private void lazyInit() throws IOException {
if (manualTagger != null) {
return;
}
// strict rules for their suffixes.
try (InputStream stream = JLanguageTool.getDataBroker().getFromResourceDirAsStream("/eo/manual-tagger.txt")) {
manualTagger = new ManualTagger(stream);
}
// Load set of transitive and intransitive verbs. Files don't contain
// verbs with suffix -iĝ or -ig since transitivity is obvious for those verbs.
// They also don't contain verbs with prefixes mal-, ek-, re-, mis- fi- and
// suffixes -ad, -aĉ, -et, -eg since these affixes never alter transitivity.
setTransitiveVerbs = loadWords(JLanguageTool.getDataBroker().getFromRulesDirAsStream("/eo/verb-tr.txt"));
setIntransitiveVerbs = loadWords(JLanguageTool.getDataBroker().getFromRulesDirAsStream("/eo/verb-ntr.txt"));
setNonParticiple = loadWords(JLanguageTool.getDataBroker().getFromRulesDirAsStream("/eo/root-ant-at.txt"));
}
Aggregations