use of zemberek.morphology.analysis.WordAnalysis in project zemberek-nlp by ahmetaa.
the class TurkishMorphologyFunctionalTests method testTime2.
@Test
public void testTime2() {
TurkishMorphology morphology = getMorphology("dört [P:Num,Card;A:Voicing]");
WordAnalysis result = morphology.analyze("10:24'te");
Assert.assertEquals(1, result.analysisCount());
SingleAnalysis analysis = result.getAnalysisResults().get(0);
Assert.assertEquals(SecondaryPos.Clock, analysis.getDictionaryItem().secondaryPos);
String lexical = analysis.formatLexical();
Assert.assertTrue(lexical.endsWith("A3sg+Loc"));
}
use of zemberek.morphology.analysis.WordAnalysis in project zemberek-nlp by ahmetaa.
the class TurkishMorphologyFunctionalTests method testEmail.
@Test
public void testEmail() {
TurkishMorphology morphology = getMorphology();
WordAnalysis result = morphology.analyze("foo@bar.com'a");
Assert.assertEquals(1, result.analysisCount());
SingleAnalysis analysis = result.getAnalysisResults().get(0);
Assert.assertEquals(SecondaryPos.Email, analysis.getDictionaryItem().secondaryPos);
String lexical = analysis.formatLexical();
Assert.assertTrue(lexical.endsWith("A3sg+Dat"));
Assert.assertEquals("foo@bar.com", analysis.getDictionaryItem().lemma);
}
use of zemberek.morphology.analysis.WordAnalysis in project zemberek-nlp by ahmetaa.
the class TurkishMorphologyFunctionalTests method testAbbreviationShouldNotGetBecomeOrAcquire_Issue218.
@Test
public void testAbbreviationShouldNotGetBecomeOrAcquire_Issue218() {
TurkishMorphology morphology = getMorphology("aa [P:Abbrv]");
WordAnalysis result = morphology.analyze("aalaş");
Assert.assertEquals(0, result.analysisCount());
result = morphology.analyze("aalan");
Assert.assertEquals(0, result.analysisCount());
}
use of zemberek.morphology.analysis.WordAnalysis in project zemberek-nlp by ahmetaa.
the class TurkishMorphologyFunctionalTests method testWordsWithDot.
@Test
public void testWordsWithDot() {
TurkishMorphology morphology = getMorphology("Dr [P:Abbrv]");
WordAnalysis result = morphology.analyze("Dr.");
Assert.assertEquals(1, result.analysisCount());
}
use of zemberek.morphology.analysis.WordAnalysis in project zemberek-nlp by ahmetaa.
the class TurkishMorphologyFunctionalTests method testUrl.
@Test
public void testUrl() {
TurkishMorphology morphology = getMorphology();
WordAnalysis result = morphology.analyze("www.foo.com");
Assert.assertEquals(1, result.analysisCount());
Assert.assertEquals(SecondaryPos.Url, result.getAnalysisResults().get(0).getDictionaryItem().secondaryPos);
String lexical = result.getAnalysisResults().get(0).formatLexical();
Assert.assertTrue(lexical.endsWith("A3sg"));
}
Aggregations