Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            var manager = new MorphologicalManager();
            var word    = new Word("uganda");



            var result = manager.SimilarWords(word);
        }
Ejemplo n.º 2
0
        public NLPEnvironment.Entities.LineCollection Parse()
        {
            if (string.IsNullOrEmpty(BaseText))
            {
                return(null);
            }

            var lineParser     = new Parser.Line();
            var sentenceParser = new Parser.Sentence();
            var wordParser     = new Parser.Word();
            var syllableParser = new Parser.Syllable();
            var morphManager   = new MorphologicalManager();



            var lines = lineParser.Parse(BaseText);

            foreach (var line in lines)
            {
                line.SentenceList = sentenceParser.Parse(line);

                foreach (var sentence in line.SentenceList)
                {
                    sentence.WordList = wordParser.Parse(sentence);

                    foreach (var word in sentence.WordList)
                    {
                        word.Text = word.Text.ToTurkish();
                        var morphList = morphManager.SimilarWords(word);

                        if (morphList != null)
                        {
                            word.SimilarWordList = morphList.WordList;

                            if (morphList.SelectWord != null)
                            {
                                word.SpellWord = morphList.SelectWord;
                            }
                        }



                        word.Syllable = syllableParser.Parse(word);
                    }
                }
            }



            return(lines);
        }