public void Setup() { var fsm = new FsmMorphologicalAnalyzer(); parse1 = fsm.MorphologicalAnalysis("açılır").GetFsmParse(0); parse2 = fsm.MorphologicalAnalysis("koparılarak").GetFsmParse(0); parse3 = fsm.MorphologicalAnalysis("toplama").GetFsmParse(0); parse4 = fsm.MorphologicalAnalysis("değerlendirmede").GetFsmParse(0); parse5 = fsm.MorphologicalAnalysis("soruşturmasının").GetFsmParse(0); parse6 = fsm.MorphologicalAnalysis("karşılaştırmalı").GetFsmParse(0); parse7 = fsm.MorphologicalAnalysis("esaslarını").GetFsmParse(0); parse8 = fsm.MorphologicalAnalysis("güçleriyle").GetFsmParse(0); parse9 = fsm.MorphologicalAnalysis("bulmayacakları").GetFsmParse(0); parse10 = fsm.MorphologicalAnalysis("mü").GetFsmParse(0); }
/** * <summary> The getParseWithBestIgProbability gets each {@link FsmParse}'s transition list as a {@link Word} ig. Then, finds the corresponding * probability. At the end returns the parse with the highest ig probability.</summary> * * <param name="parseList"> {@link FsmParseList} is used to get the {@link FsmParse}.</param> * <param name="correctFsmParses">FsmParse is used to get the transition lists.</param> * <param name="index"> Index of FsmParse of which transition list will be used to get the probability.</param> * <returns>The parse with the highest probability.</returns> */ protected FsmParse GetParseWithBestIgProbability(FsmParseList parseList, List <FsmParse> correctFsmParses, int index) { FsmParse bestParse = null; double bestProbability = int.MinValue; for (var j = 0; j < parseList.Size(); j++) { var ig = new Word(parseList.GetFsmParse(j).GetTransitionList()); var probability = GetIgProbability(ig, correctFsmParses, index); if (probability > bestProbability) { bestParse = parseList.GetFsmParse(j); bestProbability = probability; } } return(bestParse); }
/** * <summary> If the words has only single root in its possible parses, the method disambiguates by looking special cases. * The cases are implemented in the caseDisambiguator method.</summary> * <param name="fsmParseList">Morphological parses of the word.</param> * <param name="word">Word to be disambiguated.</param> */ private void SetParseAutomatically(FsmParse disambiguatedParse, AnnotatedWord word) { word.SetParse(disambiguatedParse.TransitionList()); word.SetMetamorphicParse(disambiguatedParse.WithList()); }