Given a stemmed term, get the most common unstemmed variant.

        Args:
            term (str): A stemmed term.

        Returns:
            str: The unstemmed token.
488523
def unstem(self, term):

        

        originals = []
        for i in self.terms[term]:
            originals.append(self.tokens[i]['unstemmed'])

        mode = Counter(originals).most_common(1)
        return mode[0][0]
1361793
def get(self, word, default=nil):
		

		node = self.__get_node(word)
		output = nil
		if node:
			output = node.output

		if output is nil:
			if default is nil:
				raise KeyError("no key '%s'" % word)
			else:
				return default
		else:
			return output
546245
def _rule_value(self):
        

        terms = [self._get_token()]

        # consume additional terms if available
        while self._lookahead_token() == ',':
            self._get_token()  # chomp the comma
            terms.append(self._get_token())

        return terms
573049
def obtain_term_type
      return nil if params[:slug].blank?
      segments = params[:slug].split('/')

      if !segments[1].blank?
        term = TermAnatomy.where(:taxonomy => segments[1]).last
        term.taxonomy if !term.blank?
      else
        nil
      end

    end
1123884
def most_frequent_terms(self, count=0):
        
        # sort terms by number of occurrences in descending order
        terms = sorted(self._terms.items(), key=lambda i: -i[1])

        terms = tuple(i[0] for i in terms)
        if count == 0:
            return terms
        elif count > 0:
            return terms[:count]
        else:
            raise ValueError(
                "Only non-negative values are allowed for count of terms.")
559596
def getNym(self, nym, role=None, isCommitted=True):
        
        try:
            seqNo, txnTime, ta, actual_role, verkey = self.get(nym, isCommitted)
        except KeyError:
            return None
        if role and role != actual_role:
            return None
        return {
            ROLE: actual_role or None,
            VERKEY: verkey or None,
            f.IDENTIFIER.nm: ta or None,
            f.SEQ_NO.nm: seqNo or None,
            TXN_TIME: txnTime or None,
        }
328099
def stem(self, word):
        

        if len(word) <= 2:
            return word
        else:
            word = self.remove_initial_apostrophe(word)
            word = self.set_ys(word)
            self.find_regions(word)

            word = self.strip_possessives(word)
            word = self.replace_suffixes_1(word)
            word = self.replace_suffixes_2(word)
            word = self.replace_ys(word)
            word = self.replace_suffixes_3(word)
            word = self.replace_suffixes_4(word)
            word = self.delete_suffixes(word)
            word = self.process_terminals(word)

            return word
260226
def untrain_token(self, word, count):
        
        if word not in self.tokens:
            return

        # If we're trying to untrain more tokens than we have, we end at 0
        count = min(count, self.tokens[word])

        self.tokens[word] -= count
        self.tally -= count
271281
def stem(self, word):
        
        word = word.lower()

        r1 = self._r1_scandinavian(word, self.__vowels)

        # STEP 1
        for suffix in self.__step1_suffixes:
            if r1.endswith(suffix):
                if suffix == "s":
                    if word[-2] in self.__s_ending:
                        word = word[:-1]
                        r1 = r1[:-1]
                else:
                    word = word[:-len(suffix)]
                    r1 = r1[:-len(suffix)]
                break

        # STEP 2
        for suffix in self.__step2_suffixes:
            if r1.endswith(suffix):
                word = word[:-1]
                r1 = r1[:-1]
                break

        # STEP 3
        for suffix in self.__step3_suffixes:
            if r1.endswith(suffix):
                if suffix in ("els", "lig", "ig"):
                    word = word[:-len(suffix)]
                elif suffix in ("fullt", "l\xF6st"):
                    word = word[:-1]
                break


        return word
55771
def stem_word(self, word):
        """"""
        if self.is_plural(word):
            return self.stem_plural_word(word)
        else:
            return self.stem_singular_word(word)
647851
def get_stoplisted_unigram_corpus(self, stoplist=None):
        '''
        
        '''
        if stoplist is None:
            stoplist = self.get_default_stoplist()
        else:
            stoplist = [w.lower() for w in stoplist]
        return self._remove_terms_from_list(stoplist)
355390
def get_word(self, word=None):
        '''  '''
        word = word if not word == None else self.initial
        if not self.terminal in word:
            if len(word) > self.average_word_length and \
                    self.terminal in self.links[word[-self.chunk_size:]] \
                    and random.randint(0, 1):
                addon = self.terminal
            else:
                options = self.links[word[-self.chunk_size:]]
                addon = random.choice(options)

            word = word + addon
            return self.get_word(word)
        return word[1:-1]
742257
def tag_crf(self, untagged_string: str):
        
        untagged_tokens = wordpunct_tokenize(untagged_string)
        pickle_path = self.available_taggers['crf']
        tagger = CRFTagger()
        tagger.set_model_file(pickle_path)
        tagged_text = tagger.tag(untagged_tokens)
        return tagged_text
771424
def get_value(self, term, default=None, section=None):
        """"""
        term = self.find_first(term, value=False, section=section)

        if term is None:
            return default
        else:
            return term.value
776656
def get_wordlist(stanzas):
    
    return sorted(list(set().union(*[stanza.words for stanza in stanzas])))
721189
def get_X(self):
		'''
		
		'''
		if self._use_non_text_features:
			return self._term_doc_matrix._mX
		else:
			return self._term_doc_matrix._X
375720
def parseSearchTerm(term):
    
    terms = []
    keywords = {}
    for word in term.split():
        if word.count(':') == 1:
            k, v = word.split(u':')
            if k and v:
                keywords[k] = v
            elif k or v:
                terms.append(k or v)
        else:
            terms.append(word)
    term = u' '.join(terms)
    if keywords:
        return term, keywords
    return term, None