Search in sources :

Example 1 with InformalAnalysisConverter

use of zemberek.morphology.analysis.InformalAnalysisConverter in project zemberek-nlp by ahmetaa.

the class AnalyzeAndConvertInformalWords method main.

public static void main(String[] args) {
    TurkishMorphology morphology = TurkishMorphology.builder().setLexicon(RootLexicon.getDefault()).useInformalAnalysis().build();
    List<SingleAnalysis> analyses = morphology.analyzeAndDisambiguate("okuycam diyo").bestAnalysis();
    for (SingleAnalysis a : analyses) {
        System.out.println(a.surfaceForm() + "-" + a);
    }
    System.out.println("Converting formal surface form:");
    InformalAnalysisConverter converter = new InformalAnalysisConverter(morphology.getWordGenerator());
    for (SingleAnalysis a : analyses) {
        System.out.println(converter.convert(a.surfaceForm(), a));
    }
}
Also used : SingleAnalysis(zemberek.morphology.analysis.SingleAnalysis) InformalAnalysisConverter(zemberek.morphology.analysis.InformalAnalysisConverter) TurkishMorphology(zemberek.morphology.TurkishMorphology)

Aggregations

TurkishMorphology (zemberek.morphology.TurkishMorphology)1 InformalAnalysisConverter (zemberek.morphology.analysis.InformalAnalysisConverter)1 SingleAnalysis (zemberek.morphology.analysis.SingleAnalysis)1