word pos

@return
166669
public String[][] toWordTagArray()
    {
        List<Word> wordList = toSimpleWordList();
        String[][] pair = new String[2][wordList.size()];
        Iterator<Word> iterator = wordList.iterator();
        for (int i = 0; i < pair[0].length; i++)
        {
            Word word = iterator.next();
            pair[0][i] = word.value;
            pair[1][i] = word.label;
        }
        return pair;
    }
613461
private String getPart(int pos) {
    String value = this.getValue();
    if (value == null) {
      return null;
    }
    String[] parts = value.split("/");
    return parts.length >= pos + 1 ? parts[pos] : null;
  }
1109841
protected IWord getNextLatinWord(int c, int pos) throws IOException
    {
        /*
         * clear or just return the English punctuation as
         * a single word with PUNCTUATION type and part of speech 
        */
        if ( StringUtil.isEnPunctuation( c ) ) {
            String str = String.valueOf((char)c);
            if ( config.CLEAR_STOPWORD 
                    && dic.match(ILexicon.STOP_WORD, str) ) {
                return null;
            }
            
            IWord w = new Word(str, IWord.T_PUNCTUATION);
            w.setPosition(pos);
            w.setPartSpeech(IWord.PUNCTUATION);
            return w;
        }
        
        IWord w = nextLatinWord(c, pos);
        w.setPosition(pos);
        
        /* @added: 2013-12-16
         * check and do the secondary segmentation work.
         * This will split 'qq2013' to 'qq, 2013'.
        */
        if ( config.EN_SECOND_SEG
                && (ctrlMask & ISegment.START_SS_MASK) != 0 ) {
            enSecondSeg(w, false);
        }
        
        if ( config.CLEAR_STOPWORD 
                && dic.match(ILexicon.STOP_WORD, w.getValue()) ) {
            w = null;    //Let gc do its work
            return null;
        }
        
        if ( config.APPEND_CJK_SYN ) {
            appendLatinSyn(w);
        }
        
        return w;
    }
830465
public List<WordLemmaTag> getStanfordWordLemmaTags() {
        List<AgigaToken> tokens = getTokens();
        List<WordLemmaTag> labels = new ArrayList<WordLemmaTag>();
        for (int i = 0; i < tokens.size(); i++) {
            AgigaToken at = tokens.get(i);
            WordLemmaTag curToken;
            require(prefs.readWord, "AgigaPrefs.readWord must be true for getStanfordWordLemmaTags()");
            if (prefs.readWord && prefs.readLemma && prefs.readPos) {
                curToken = new WordLemmaTag(at.getWord(), at.getLemma(), at.getPosTag());
            } else if (prefs.readWord && prefs.readPos) {
                curToken = new WordLemmaTag(at.getWord(), at.getPosTag());
            } else { // if (prefs.readWord) {
                curToken = new WordLemmaTag(at.getWord());
            }
            labels.add(curToken);
        }
        return labels;
    }
145549
def cursor_pos(self):
        """"""
        if len(self) == 0:
            return self.left + self.default_text.get_width()

        papy = self._surface.get_width()
        if papy > self.w:
            shift = papy - self.width
        else:
            shift = 0

        return self.left + self.font.size(self.shawn_text[:self.cursor])[0] - shift
838269
public String getContext(int wordsLeft, int wordsRight){
		final String text = home_cc.getText();
		int temp;

		// get the left start position
		int posLeft = pos.getStart();
		temp = posLeft-1;
		while( posLeft != 0 && wordsLeft > 0 ){
			while( temp > 0 && text.charAt( temp ) < 48  ) {
				temp--;
			}
			while( temp > 0 && text.charAt( temp ) >= 48 ) {
				temp--;
			}
			posLeft = ( temp>0 ? temp+1 : 0 );
			wordsLeft--;
		}

		// get the right end position
		int posRight = pos.getEnd();
		temp = posRight;
		while( posRight != text.length() && wordsRight > 0 ){
			while( temp < text.length() && text.charAt( temp ) < 48 ) {
				temp++;
			}
			while( temp < text.length() && text.charAt( temp ) >= 48 ) {
				temp++;
			}
			posRight = temp;
			wordsRight--;
		}

		// retrun a string...
		return
			text.substring(posLeft, pos.getStart() ) +
			text.substring(pos.getEnd(), posRight);
	}
175428
@Override
    public Collection<String> wordsNearestSum(String word, int n) {
        //INDArray vec = Transforms.unitVec(this.lookupTable.vector(word));
        INDArray vec = this.lookupTable.vector(word);
        return wordsNearestSum(vec, n);
    }
603252
public Optional<Sense> getSense(@NonNull String word, @NonNull POS pos, int senseNum, @NonNull Language language) {
        for (String lemma : Lemmatizers
                                .getLemmatizer(language)
                                .allPossibleLemmas(word, pos)) {
            for (Sense sense : db.getSenses(lemma.toLowerCase())) {
                if ((pos == POS.ANY || pos.isInstance(
                    sense.getPOS())) && sense.getSenseNumber() == senseNum && sense.getLanguage() == language) {
                    return Optional.of(sense);
                }
            }
        }
        return Optional.empty();
    }
1091397
def _get_text_pos(self, charno, lineno):
        
        return self._get_char_x(charno), self._get_line_y(lineno)
1094274
@Override
    public Collection<String> wordsNearestSum(INDArray words, int top) {

        if (lookupTable instanceof InMemoryLookupTable) {
            InMemoryLookupTable l = (InMemoryLookupTable) lookupTable;
            INDArray syn0 = l.getSyn0();
            INDArray weights = syn0.norm2(0).rdivi(1).muli(words);
            INDArray distances = syn0.mulRowVector(weights).sum(1);
            INDArray[] sorted = Nd4j.sortWithIndices(distances, 0, false);
            INDArray sort = sorted[0];
            List<String> ret = new ArrayList<>();

            // FIXME: int cast
            if (top > sort.length())
                top = (int) sort.length();
            //there will be a redundant word
            int end = top;
            for (int i = 0; i < end; i++) {
                String add = vocabCache.wordAtIndex(sort.getInt(i));
                if (add == null || add.equals("UNK") || add.equals("STOP")) {
                    end++;
                    if (end >= sort.length())
                        break;
                    continue;
                }
                ret.add(vocabCache.wordAtIndex(sort.getInt(i)));
            }
            return ret;
        }

        Counter<String> distances = new Counter<>();

        for (String s : vocabCache.words()) {
            INDArray otherVec = lookupTable.vector(s);
            double sim = Transforms.cosineSim(words, otherVec);
            distances.incrementCount(s, (float) sim);
        }

        distances.keepTopNElements(top);
        return distances.keySet();
    }
323994
public ParsedWord pollParsedWord() {
        if(hasNextWord()) {
            //set correct next char
            if(parsedLine.words().size() > (word+1))
                character = parsedLine.words().get(word+1).lineIndex();
            else
                character = -1;
            return parsedLine.words().get(word++);
        }
        else
            return new ParsedWord(null, -1);
    }
61759
public String tag(final String word, final String posTag) {
    final List<WordData> wdList = this.dictLookup.lookup(word.toLowerCase());
    String newPosTag = null;
    for (final WordData wd : wdList) {
      newPosTag = wd.getTag().toString();
    }
    if (newPosTag == null) {
      newPosTag = posTag;
    }
    return newPosTag;
  }
1208873
public List<String> getWords() {
        List<String> result = new ArrayList<>();
        List<Word> words = WordParser.parse(question.replace("?", "").replace("？", ""));
        for (Word word : words) {
            result.add(word.getText());
        }
        return result;
    }
1084547
def get_record_pos(self, record):
        
        if self.is_stopword_record(record):
            return '~' + record.pos
        else:
            return record.pos
462086
public String getPos() {
    if (Token_Type.featOkTst && ((Token_Type)jcasType).casFeat_pos == null)
      jcasType.jcas.throwFeatMissing("pos", "de.unihd.dbs.uima.types.heideltime.Token");
    return jcasType.ll_cas.ll_getStringValue(addr, ((Token_Type)jcasType).casFeatCode_pos);}
898942
public Prep findWord(String word) {
    
    if (prepsMap.containsKey("*")) {
      word = "*";
    }
    
    return prepsMap.get(word);
  }
526712
def pos_tags(self):
        
        return [(Word(word, pos_tag=t), unicode(t))
                for word, t in self.pos_tagger.tag(self.raw)
                # new keyword PatternTagger(include_punc=False)
                # if not PUNCTUATION_REGEX.match(unicode(t))
                ]