コード例 #1
0
        public AnnotatedWord ToAnnotatedWord(int wordIndex)
        {
            AnnotatedWord annotatedWord = new AnnotatedWord(GetTurkishWordAt(wordIndex));

            if (LayerExists(ViewLayerType.INFLECTIONAL_GROUP))
            {
                annotatedWord.SetParse(GetMorphologicalParseAt(wordIndex).ToString());
            }

            if (LayerExists(ViewLayerType.META_MORPHEME))
            {
                annotatedWord.SetMetamorphicParse(GetMetamorphicParseAt(wordIndex).ToString());
            }

            if (LayerExists(ViewLayerType.SEMANTICS))
            {
                annotatedWord.SetSemantic(GetSemanticAt(wordIndex));
            }

            if (LayerExists(ViewLayerType.NER))
            {
                annotatedWord.SetNamedEntityType(GetLayerData(ViewLayerType.NER));
            }

            if (LayerExists(ViewLayerType.PROPBANK))
            {
                annotatedWord.SetArgument(GetArgument().ToString());
            }

            if (LayerExists(ViewLayerType.SHALLOW_PARSE))
            {
                annotatedWord.SetShallowParse(GetShallowParseAt(wordIndex));
            }

            return(annotatedWord);
        }
 /**
  * <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());
 }