public NotenizerWord(String pos, int index, String lemma, String ner) { _pos = new PartOfSpeech(pos); _index = index; _lemma = lemma; _namedEntity = new NamedEntity(ner); }
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; }