use of zemberek.morphology.analysis.WordAnalysis in project zemberek-nlp by ahmetaa.
the class TurkishMorphologyFunctionalTests method testRatio.
@Test
public void testRatio() {
TurkishMorphology morphology = getMorphology("iki [P:Num,Card]");
WordAnalysis result = morphology.analyze("1/2");
Assert.assertEquals(1, result.analysisCount());
Assert.assertEquals(SecondaryPos.Ratio, result.getAnalysisResults().get(0).getDictionaryItem().secondaryPos);
}
use of zemberek.morphology.analysis.WordAnalysis in project zemberek-nlp by ahmetaa.
the class TurkishMorphologyFunctionalTests method testUrl2.
@Test
public void testUrl2() {
TurkishMorphology morphology = getMorphology();
WordAnalysis result = morphology.analyze("www.foo.com'da");
Assert.assertEquals(1, result.analysisCount());
SingleAnalysis analysis = result.getAnalysisResults().get(0);
Assert.assertEquals(SecondaryPos.Url, analysis.getDictionaryItem().secondaryPos);
String lexical = analysis.formatLexical();
Assert.assertTrue(lexical.endsWith("A3sg+Loc"));
Assert.assertEquals("www.foo.com", analysis.getDictionaryItem().lemma);
}
use of zemberek.morphology.analysis.WordAnalysis in project zemberek-nlp by ahmetaa.
the class TurkishMorphologyFunctionalTests method testEmoticon.
@Test
public void testEmoticon() {
TurkishMorphology morphology = getEmptyTurkishMorphology();
WordAnalysis result = morphology.analyze(":)");
Assert.assertEquals(1, result.analysisCount());
Assert.assertEquals(SecondaryPos.Emoticon, result.getAnalysisResults().get(0).getDictionaryItem().secondaryPos);
}
use of zemberek.morphology.analysis.WordAnalysis in project zemberek-nlp by ahmetaa.
the class TurkishMorphologyFunctionalTests method testAbbreviationVoicing_Issue_183.
@Test
public void testAbbreviationVoicing_Issue_183() {
TurkishMorphology morphology = getMorphology("Tübitak [P:Abbrv]");
WordAnalysis result = morphology.analyze("Tübitak'a");
Assert.assertEquals(1, result.analysisCount());
result = morphology.analyze("Tübitaka");
Assert.assertEquals(1, result.analysisCount());
result = morphology.analyze("Tübitağa");
Assert.assertEquals(0, result.analysisCount());
}
use of zemberek.morphology.analysis.WordAnalysis in project zemberek-nlp by ahmetaa.
the class TurkishMorphologyFunctionalTests method testMention.
@Test
public void testMention() {
TurkishMorphology morphology = getMorphology();
WordAnalysis result = morphology.analyze("@haha_ha'ya");
Assert.assertEquals(1, result.analysisCount());
SingleAnalysis analysis = result.getAnalysisResults().get(0);
Assert.assertEquals(SecondaryPos.Mention, analysis.getDictionaryItem().secondaryPos);
String lexical = analysis.formatLexical();
Assert.assertTrue(lexical.endsWith("A3sg+Dat"));
Assert.assertEquals("@haha_ha", analysis.getDictionaryItem().lemma);
Assert.assertTrue(lexical.contains("@haha_ha"));
}
Aggregations