use of zemberek.morphology.analysis.tr.TurkishMorphology in project zemberek-nlp by ahmetaa.
the class AnalyzeWords method main.
public static void main(String[] args) throws IOException {
TurkishMorphology morphology = TurkishMorphology.createWithDefaults();
new AnalyzeWords(morphology).analyze("kalemi");
}
use of zemberek.morphology.analysis.tr.TurkishMorphology in project zemberek-nlp by ahmetaa.
the class ChangeStem method main.
public static void main(String[] args) throws IOException {
TurkishMorphology morphology = TurkishMorphology.createWithDefaults();
DictionaryItem newStem = morphology.getLexicon().getMatchingItems("poğaça").get(0);
new ChangeStem(morphology).regenerate("simidime", newStem);
}
use of zemberek.morphology.analysis.tr.TurkishMorphology in project zemberek-nlp by ahmetaa.
the class DisambiguateSentences method main.
public static void main(String[] args) throws IOException {
TurkishMorphology morphology = TurkishMorphology.createWithDefaults();
Z3MarkovModelDisambiguator disambiguator = new Z3MarkovModelDisambiguator();
TurkishSentenceAnalyzer sentenceAnalyzer = new TurkishSentenceAnalyzer(morphology, disambiguator);
new DisambiguateSentences(sentenceAnalyzer).analyzeAndDisambiguate("86 lira harcardım.");
}
use of zemberek.morphology.analysis.tr.TurkishMorphology in project zemberek-nlp by ahmetaa.
the class SpellingExamples method main.
public static void main(String[] args) throws IOException {
TurkishMorphology morphology = TurkishMorphology.createWithDefaults();
TurkishSpellChecker spellChecker = new TurkishSpellChecker(morphology);
System.out.println("Check if written correctly.");
String[] words = { "Ankara'ya", "Ankar'aya", "yapbileceksen", "yapabileceğinizden" };
for (String word : words) {
System.out.println(word + " -> " + spellChecker.check(word));
}
System.out.println();
System.out.println("Give suggestions.");
String[] toSuggest = { "Kraamanda", "okumuştk", "yapbileceksen", "oukyamıyorum" };
for (String s : toSuggest) {
System.out.println(s + " -> " + spellChecker.suggestForWord(s));
}
}
use of zemberek.morphology.analysis.tr.TurkishMorphology in project zemberek-nlp by ahmetaa.
the class TurkishSpellCheckerTest method apostropheTest.
@Test
public void apostropheTest() throws IOException {
TurkishMorphology morphology = TurkishMorphology.builder().addDictionaryLines("zaman [P:Noun, Time]").build();
TurkishSpellChecker spellChecker = new TurkishSpellChecker(morphology);
String[] inputs = { "zamanda" };
for (String input : inputs) {
Assert.assertTrue("Fail at " + input, spellChecker.check(input));
}
}
Aggregations