Get a set of technical words from :shadow_contents:.

    :shadow_contents: is an array of shadow contents, as returned by
    spellcheckable_and_shadow_contents.
556923
def technical_words_from_shadow_contents(shadow_contents):
    
    technical_words = set()
    for line in shadow_contents:
        # "Fix up" the shadow line by replacing zeros with spaces.
        line = "".join([(lambda c: " " if c == 0 else c)(c) for c in line])
        for sym in _split_into_symbol_words(line):
            if len(sym) and re.compile(_VALID_SYMBOL_WORDS).match(sym):
                technical_words |= set([sym])

    return technical_words
893690
def iswhat(o):
    
    import inspect
    isfs = {n: f for n, f in inspect.getmembers(inspect) if n[0:2] == "is"}
    return {n: f(o) for n, f in isfs.items()}
231857
def get_contents(self, el, no_iframe=False):
        """"""
        if not no_iframe or not self.is_iframe(el):
            for content in el.contents:
                yield content
765836
def get_current_word(self, completion=False):
        """"""
        ret = self.get_current_word_and_position(completion)
        if ret is not None:
            return ret[0]
492798
def get_squeezed_contents(contents):
    
    line_between_example_code = substitute.Substitution(
        '\n\n    ',
        '\n    ',
        True
    )
    lines_between_examples = substitute.Substitution('\n\n\n', '\n\n', True)
    lines_between_sections = substitute.Substitution(
        '\n\n\n\n', '\n\n\n', True
    )

    result = contents
    result = line_between_example_code.apply_and_get_result(result)
    result = lines_between_examples.apply_and_get_result(result)
    result = lines_between_sections.apply_and_get_result(result)
    return result
301366
def words(total)
      if total.class == Range
        (1..interpret_value(total)).map { WORDS[random_number(total.min, total.max)] }.join(' ')
      else
        (1..interpret_value(total)).map { WORDS[random_number(0, total)] }.join(' ')
      end
    end
653566
def contains(self, sub):
        
        sub = sub.lower()
        found_words = set()

        res = cgaddag.gdg_contains(self.gdg, sub.encode(encoding="ascii"))
        tmp = res

        while tmp:
            word = tmp.contents.str.decode("ascii")
            found_words.add(word)
            tmp = tmp.contents.next

        cgaddag.gdg_destroy_result(res)
        return list(found_words)
1009817
def word(self):
        """"""
        try:
            output = ensure_unicode(self.git.diff(
                '--no-color',
                '--word-diff=plain',
                'HEAD~1:content',
                'HEAD:content',
            ).stdout)
        except sh.ErrorReturnCode_128:
            result = ensure_unicode(self.git.show(
                "HEAD:content"
            ).stdout)
        else:
            ago = ensure_unicode(self.git.log(
                '-2',
                '--pretty=format:last change was %cr',
                'content'
            ).stdout).splitlines()
            lines = output.splitlines()
            result = u'\n'.join(
                itertools.chain(
                    itertools.islice(
                        itertools.dropwhile(
                            lambda x: not x.startswith('@@'),
                            lines[1:],
                        ),
                        1,
                        None,
                    ),
                    itertools.islice(ago, 1, None),
                )
            )
        return result
527686
def get_shared_data(component):
    
    if component:
        return (copy.deepcopy(component.data)
                if 'content' not in component.data
                else copy.deepcopy(component.data['content']))
    else:
        return []
762902
def _find_spelling_errors_in_chunks(chunks,
                                    contents,
                                    valid_words_dictionary=None,
                                    technical_words_dictionary=None,
                                    user_dictionary_words=None):
    """"""
    for chunk in chunks:
        for error in spellcheck_region(chunk.data,
                                       valid_words_dictionary,
                                       technical_words_dictionary,
                                       user_dictionary_words):
            col_offset = _determine_character_offset(error.line_offset,
                                                     error.column_offset,
                                                     chunk.column)
            msg = _SPELLCHECK_MESSAGES[error.error_type].format(error.word)
            yield _populate_spelling_error(error.word,
                                           error.suggestions,
                                           contents,
                                           error.line_offset +
                                           chunk.line,
                                           col_offset,
                                           msg)
1133185
def get_grammatically_correct_vocabulary_subset(self, text,
                                                    sent_filter='combined'):
        
        tokens = word_tokenize(text)
        sent_tokens = get_partial_sentence(tokens)

        if not sent_tokens:
            return self.vocabulary

        if sent_filter == 'combined':
            if len(sent_tokens) < 2:
                return self.get_bigram_filtered_vocab(sent_tokens)

            combined_filters = self.get_pos_filtered_vocab(sent_tokens) + \
                self.get_trigram_filtered_vocab(sent_tokens) + \
                self.get_bigram_filtered_vocab(sent_tokens)
            return combined_filters

        if sent_filter == 'pos' and len(sent_tokens) > 1:
            return self.get_pos_filtered_vocab(sent_tokens)
        elif sent_filter == 'bigram' or len(sent_tokens) < 2:
            return self.get_bigram_filtered_vocab(sent_tokens)
        elif sent_filter == 'trigram':
            return self.get_trigram_filtered_vocab(sent_tokens)
1291836
public static function fetchSpacheWordList()
    {
        if (is_array(self::$arrSpache)) {
            return self::$arrSpache;
        }

        // Fetch Spache Words
        $arrSpacheWordList = array();
        include_once('resources/SpacheWordList.php');
        self::$arrSpache = $arrSpacheWordList;

        return $arrSpacheWordList;
    }
173838
def extract_mentions(self):
        
        if not hasattr(self, "raw_content"):
            return set()
        mentions = re.findall(r'@{[^;]+; [\w.-]+@[^}]+}', self.raw_content)
        if not mentions:
            return set()
        mentions = {s.split(';')[1].strip(' }') for s in mentions}
        mentions = {s for s in mentions}
        return mentions
902807
def word_spans(self):
        """"""
        if not self.is_tagged(WORDS):
            self.tokenize_words()
        return self.spans(WORDS)
569008
def _get_contents_between(string, opener, closer):
    
    opener_location = string.index(opener)
    closer_location = string.index(closer)
    content = string[opener_location + 1:closer_location]
    return content
1157804
def create(technical_terms_filename, spellchecker_cache_path):
    """"""
    user_dictionary = os.path.join(os.getcwd(), "DICTIONARY")
    user_words = read_dictionary_file(user_dictionary)

    technical_terms_set = set(user_words)

    if technical_terms_filename:
        with open(technical_terms_filename) as tech_tf:
            technical_terms_set |= set(tech_tf.read().splitlines())

    return Dictionary(technical_terms_set,
                      "technical_words",
                      dictionary_sources=[technical_terms_filename,
                                          user_dictionary],
                      cache=spellchecker_cache_path)
990572
def _get_words(data_dir):
    
    words_file = data_dir.joinpath("words.txt")
    word_list = []
    if not words_file.is_file():
        return word_list
    with open(words_file, mode="r") as f:
        for l in f:
            line = l.rstrip()
            word_list.append(line)
    return word_list