Ejemplo n.º 1
0
 public NotenizerWord(String pos, int index, String lemma, String ner)
 {
     _pos = new PartOfSpeech(pos);
     _index = index;
     _lemma = lemma;
     _namedEntity = new NamedEntity(ner);
 }
Ejemplo n.º 2
0
        public NotenizerWord(IndexedWord indexedWord)
        {
            _indexedWord = indexedWord;
            _wordString = indexedWord.word();
            _startingPosition = indexedWord.beginPosition();
            _endPosition = indexedWord.endPosition();
            _namedEntity = new NamedEntity(indexedWord.ner());

            Object temp = indexedWord.get(typeof(CoreAnnotations.EndIndexAnnotation));

            if (temp != null)
                _index = temp.ToInt();
            else
                _index = -1;

            temp = indexedWord.get(typeof(CoreAnnotations.PartOfSpeechAnnotation));

            if (temp != null)
                _pos = new PartOfSpeech(temp.ToString());
            else
                _pos = new PartOfSpeech(String.Empty);

            temp = indexedWord.lemma();

            if (temp != null)
                _lemma = temp.ToString();
            else
                _lemma = String.Empty;
        }