Return probability of an input word, according to the spelling dictionary

        :param str word: A word to check its probability of occurrence
336339
def prob(self, word: str) -> float:
        
        return self.__WORDS[word] / self.__WORDS_TOTAL
647245
async def get_random(self) -> Word:
        
        resp = await self._get(random=True)
        return Word(resp['list'][0])
538992
def find_keyword(word_list: List[str], min_len: int = 3) -> Dict[str, int]:
    
    word_list = rank(word_list, exclude_stopwords=True)

    return {k: v for k, v in word_list.items() if v >= min_len}
846829
def words(total)
      (1..interpret_value(total)).map { WORDS[rand(WORDS.size)] }.join(' ')
    end
1200910
def getPattern(self, word):
        
        if word in self.patterns:
            return self.patterns[word]
        else:
            raise ValueError('Unknown pattern in getPattern().', word)
671755
def score(self, text):
        
        occurs = self.count_token_occurrences(self.tokenizer(text))
        scores = {}
        for category in self.categories.get_categories().keys():
            scores[category] = 0

        categories = self.categories.get_categories().items()

        for word, count in occurs.items():
            token_scores = {}

            # Adding up individual token scores
            for category, bayes_category in categories:
                token_scores[category] = \
                    float(bayes_category.get_token_count(word))

            # We use this to get token-in-category probabilities
            token_tally = sum(token_scores.values())

            # If this token isn't found anywhere its probability is 0
            if token_tally == 0.0:
                continue

            # Calculating bayes probabiltity for this token
            # http://en.wikipedia.org/wiki/Naive_Bayes_spam_filtering
            for category, token_score in token_scores.items():
                # Bayes probability * the number of occurances of this token
                scores[category] += count * \
                    self.calculate_bayesian_probability(
                        category,
                        token_score,
                        token_tally
                    )

        # Removing empty categories from the results
        final_scores = {}
        for category, score in scores.items():
            if score > 0:
                final_scores[category] = score

        return final_scores
544088
def generate_anomaly(self, input_word, list_of_dict_words, num):
        

        results = []
        for i in range(0,num):
            index = randint(0,len(list_of_dict_words)-1)
            name = list_of_dict_words[index]
            if name != input_word and name not in results:
                results.append(PataLib().strip_underscore(name))
            else:
                i = i +1
        results = {'input' : input_word, 'results' : results, 'category' : 'anomaly'} 
        return results
846189
def stem_word(self, p, i=0, j=None):
        
        ## --NLTK--
        if j is None and i == 0:
            word = p
        else:
            if j is None:
                j = len(p) - 1
            word = p[i:j+1]

        if word in self.pool:
            return self.pool[word]

        if len(word) <= 2:
            return word # --DEPARTURE--
        # With this line, strings of length 1 or 2 don't go through the
        # stemming process, although no mention is made of this in the
        # published algorithm. Remove the line to match the published
        # algorithm.

        word = self._step1ab(word)
        word = self._step1c(word)
        word = self._step2(word)
        word = self._step3(word)
        word = self._step4(word)
        word = self._step5(word)
        return word
280028
public static int getFrequency(String word)
    {
        CoreDictionary.Attribute attribute = getAttribute(word);
        if (attribute == null) return 0;
        return attribute.totalFrequency;
    }
161587
def words(self, index = None):
        
        if index is None:
            return self.select(Word,None,True,default_ignore_structure)
        else:
            if index < 0:
                index = self.count(Word,None,True,default_ignore_structure) + index
            for i, e in enumerate(self.select(Word,None,True,default_ignore_structure)):
                if i == index:
                    return e
            raise IndexError
559051
def get_matches(self, word):
        
        matches = self.gen_matches(word)
        # defend this against bad user input for regular expression patterns
        try:
            matches = self.exclude_matches(matches)
        except Exception:
            sys.stderr.write(traceback.format_exc())
            return None
        else:
            if self.use_suffix:
                matches = [self.inflect(match) for match in matches]
            return list(matches)
898942
public Prep findWord(String word) {
    
    if (prepsMap.containsKey("*")) {
      word = "*";
    }
    
    return prepsMap.get(word);
  }
876427
def exists(self, word):
		

		node = self.__get_node(word)
		if node:
			return bool(node.output != nil)
		else:
			return False
1260914
public boolean contains(String word) {
		if(word.length()>maxLen)
			return false;
		return dict.contains(word);
	}
1349804
def get_word(byte_iterator):
    
    byte_values = list(itertools.islice(byte_iterator, 2))
    try:
        word = (byte_values[0] << 8) | byte_values[1]
    except TypeError, err:
        raise TypeError("Can't build word from %s: %s" % (repr(byte_values), err))
    return word
1111983
def set_ys(self, word):
        

        if word[0] == 'y':
            word = 'Y' + word[1:]

        for match in re.finditer("[aeiou]y", word):
            y_index = match.end() - 1
            char_list = [x for x in word]
            char_list[y_index] = 'Y'
            word = ''.join(char_list)

        return word
74719
def match_string(self, string, word=0, offset=0):
        
        if word:
            return self.get_string(offset) == string
        return self.get_length(len(string), offset) == string