Returns the first sense.

    :param ambiguous_word: String, a single word.
    :param pos: String, one of 'a', 'r', 's', 'n', 'v', or None.
    :return: The first Synset in the wn.synsets(word) list.
344034
def first_sense(ambiguous_word: str, pos: str = None) -> "wn.Synset":
    

    if pos is None:
        return wn.synsets(ambiguous_word)[0]
    else:
        return wn.synsets(ambiguous_word, pos)[0]
741563
public DependencyTree parse2T(String[] words, String[] pos) {
		if(parser==null)
			return null;
		if(treeCache!=null){
			DependencyTree tree = treeCache.get(words,pos);
			if(tree!=null)
				return tree;
		}
		
		if(words==null||pos==null||words.length==0||pos.length==0||words.length!=pos.length)
			return null;
		return parser.parse2T(words, pos);
	}
1182169
def correction(sentence, pos):
    ""
    word = sentence[pos]
    cands = candidates(word)
    if not cands:
        cands = candidates(word, False)
    if not cands:
        return word
    cands = sorted(cands, key=lambda w: P(w, sentence, pos), reverse=True)
    cands = [c[0] for c in cands]
    return cands
1071961
def disambiguate(self, words):
        
        words = vm.SentenceAnalysis([as_wordanalysis(w) for w in words])
        disambiguated = self._morf.disambiguate(words)
        return [postprocess_result(mr, False, True) for mr in disambiguated]
782919
def pos(self):
        
        pos = self._pos
        if pos is None:
            return self.p0
        # convert to dict
        pos = {param: self._pos[..., k]
               for (k, param) in enumerate(self.sampling_params)}
        return pos
889408
function parseTopDict(reader, start, length, strings) {
            var dict = parseCFFDict(reader, start || 0, length || reader.length);
            return interpretDict(dict, TOP_DICT_META, strings);
        }
1132723
public int[] parse(String[] words, String[] pos){
		if(parser==null)
			return null;
		return parser.parse(words, pos);
	}
1084547
def get_record_pos(self, record):
        
        if self.is_stopword_record(record):
            return '~' + record.pos
        else:
            return record.pos
1121648
def tcc_pos(text: str) -> Set[int]:
    
    if not text or not isinstance(text, str):
        return set()

    p_set = set()
    p = 0
    for w in tcc(text):
        p += len(w)
        p_set.add(p)

    return p_set
1244684
def _commonWordStart(self, words):
        
        if not words:
            return ''

        length = 0
        firstWord = words[0]
        otherWords = words[1:]
        for index, char in enumerate(firstWord):
            if not all([word[index] == char for word in otherWords]):
                break
            length = index + 1

        return firstWord[:length]
499110
public String[] getFeatures(String word, String pos) {
      return lookup(new WordTag(word, pos));
  }
131608
public String getPOS() {
    if (WordForm_Type.featOkTst && ((WordForm_Type)jcasType).casFeat_POS == null)
      jcasType.jcas.throwFeatMissing("POS", "com.digitalpebble.rasp.WordForm");
    return jcasType.ll_cas.ll_getStringValue(addr, ((WordForm_Type)jcasType).casFeatCode_POS);}
119487
def pos(self, element = None):
		'''  '''

		tags = []
		if element:
			if element.startswith(('de ', 'het ', 'het/de', 'de/het')) and not re.search('\[[\w|\s][\w|\s]+\]', element.split('\r\n')[0], re.U):
				tags.append('NN')
			if re.search('[\w|\s|/]+ \| [\w|\s|/]+ - [\w|\s|/]+', element, re.U):
				tags.append('VB')
			if re.search('[\w|\s]+ \| [\w|\s]+', element, re.U):
				tags.append('JJ')
			return tags
		else:
			for element in self.elements:
				if self.word in unicode(element):
					tag = self.pos(element)
					if tag:
						return tag
1165474
public static String first_word(EvaluationContext ctx, Object text) {
        // In Excel this would be IF(ISERR(FIND(" ",A2)),"",LEFT(A2,FIND(" ",A2)-1))
        return word(ctx, text, 1, false);
    }
1245873
def _disambiguate_doc(self, tagged_tokens):
        

        # Group tokens by PoS
        pos_groups = {pos: [] for pos in [wn.NOUN, wn.VERB, wn.ADJ, wn.ADV]}
        for tok, tag in tagged_tokens:
            if tag in pos_groups:
                pos_groups[tag].append(tok)

        #print(pos_groups)

        # Map of final term -> concept mappings
        map = {}
        for tag, toks in pos_groups.items():
            map.update(self._disambiguate_pos(toks, tag))

        #nice_map = {k: map[k].lemma_names() for k in map.keys()}
        #print(json.dumps(nice_map, indent=4, sort_keys=True))

        return map
36371
public DependencyTree parse2T(String[] words, String[] pos){
		return parse2T(new Sentence(words, pos));
	}
737551
def disambiguate(self, word):
        
        matches = re.match(r'^per([bcdfghjklmnpqrstvwxyz])([a-z])er([aiueo])(.*)$', word)
        if matches:
            if matches.group(1) == 'r':
                return
            return matches.group(1) + matches.group(2) + 'er' + matches.group(3) + matches.group(4)