Check spelling pipeline.
515015
def _spelling_pipeline(self, sources, options, personal_dict):
        """"""

        for source in self._pipeline_step(sources, options, personal_dict):
            # Don't waste time on empty strings
            if source._has_error():
                yield Results([], source.context, source.category, source.error)
            elif not source.text or source.text.isspace():
                continue
            else:
                encoding = source.encoding
                if source._is_bytes():
                    text = source.text
                else:
                    # UTF-16 and UTF-32 don't work well with Aspell and Hunspell,
                    # so encode with the compatible UTF-8 instead.
                    if encoding.startswith(('utf-16', 'utf-32')):
                        encoding = 'utf-8'
                    text = source.text.encode(encoding)
                self.log('', 3)
                self.log(text, 3)
                cmd = self.setup_command(encoding, options, personal_dict)
                self.log("Command: " + str(cmd), 4)

                try:
                    wordlist = util.call_spellchecker(cmd, input_text=text, encoding=encoding)
                    yield Results(
                        [w for w in sorted(set(wordlist.replace('\r', '').split('\n'))) if w],
                        source.context,
                        source.category
                    )
                except Exception as e:  # pragma: no cover
                    err = self.get_error(e)
                    yield Results([], source.context, source.category, err)
854195
def hastext(self, cls='current',strict=True, correctionhandling=CorrectionHandling.CURRENT):
        """"""
        if cls == 'original': correctionhandling = CorrectionHandling.ORIGINAL #backward compatibility
        if correctionhandling in (CorrectionHandling.CURRENT, CorrectionHandling.EITHER):
            for e in self:
                if isinstance(e, New) or isinstance(e, Current):
                    return e.hastext(cls,strict, correctionhandling)
        if correctionhandling in (CorrectionHandling.ORIGINAL, CorrectionHandling.EITHER):
            for e in self:
                if isinstance(e, Original):
                    return e.hastext(cls,strict, correctionhandling)
        return False
1286267
def call_spellchecker(cmd, input_text=None, encoding=None):
    """"""

    process = get_process(cmd)

    # A buffer has been provided
    if input_text is not None:
        for line in input_text.splitlines():
            # Hunspell truncates lines at `0x1fff` (at least on Windows this has been observed)
            # Avoid truncation by chunking the line on white space and inserting a new line to break it.
            offset = 0
            end = len(line)
            while True:
                chunk_end = offset + 0x1fff
                m = None if chunk_end >= end else RE_LAST_SPACE_IN_CHUNK.search(line, offset, chunk_end)
                if m:
                    chunk_end = m.start(1)
                    chunk = line[offset:m.start(1)]
                    offset = m.end(1)
                else:
                    chunk = line[offset:chunk_end]
                    offset = chunk_end
                # Avoid wasted calls to empty strings
                if chunk and not chunk.isspace():
                    process.stdin.write(chunk + b'\n')
                if offset >= end:
                    break

    return get_process_output(process, encoding)
551726
def _ite(lexer):
    """"""
    s = _impl(lexer)

    tok = next(lexer)
    # IMPL '?' ITE ':' ITE
    if isinstance(tok, OP_question):
        d1 = _ite(lexer)
        _expect_token(lexer, {OP_colon})
        d0 = _ite(lexer)
        return ('ite', s, d1, d0)
    # IMPL
    else:
        lexer.unpop_token(tok)
        return s
29609
def spellchecker
      language, words, method = params[:params][0], params[:params][1], params[:method] unless params[:params].blank?
      return render(:nothing => true) if language.blank? || words.blank? || method.blank?
      headers["Content-Type"] = "text/plain"
      headers["charset"] = "utf-8"
      suggestions = check_spelling(words, method, language)
      results = {"id" => nil, "result" => suggestions, "error" => nil}
      render :json => results
    end
1092321
def check(self):
        """"""
        has_term = False

        if self.START_STATE not in self.states:
            raise SyntaxError('Undefined start rule')

        for state in self.states:
            for rule in self.states[state]:
                if rule is not None:
                    if rule[2] == self.TERM_STATE:
                        has_term = True
                    elif rule[2] not in self.states:
                        raise SyntaxError('Unexpected state: ' + rule[2])

        if not has_term:
            raise SyntaxError('Missed terminate state')
948684
def set_as_spell_check(self, color=Qt.blue):
        
        self.format.setUnderlineStyle(
            QTextCharFormat.SpellCheckUnderline)
        self.format.setUnderlineColor(color)
992440
def spelling(self):
        
        if not self.is_tagged(WORDS):
            self.tokenize_words()
        return [data[SPELLING] for data in vabamorf.spellcheck(self.word_texts, suggestions=False)]
320610
def _checkremove_que(self, word):
        """"""

        in_que_pass_list = False

        que_pass_list = ['atque',
                        'quoque',
                        'neque',
                        'itaque',
                        'absque',
                        'apsque',
                        'abusque',
                        'adaeque',
                        'adusque',
                        'denique',
                        'deque',
                        'susque',
                        'oblique',
                        'peraeque',
                        'plenisque',
                        'quandoque',
                        'quisque',
                        'quaeque',
                        'cuiusque',
                        'cuique',
                        'quemque',
                        'quamque',
                        'quaque',
                        'quique',
                        'quorumque',
                        'quarumque',
                        'quibusque',
                        'quosque',
                        'quasque',
                        'quotusquisque',
                        'quousque',
                        'ubique',
                        'undique',
                        'usque',
                        'uterque',
                        'utique',
                        'utroque',
                        'utribique',
                        'torque',
                        'coque',
                        'concoque',
                        'contorque',
                        'detorque',
                        'decoque',
                        'excoque',
                        'extorque',
                        'obtorque',
                        'optorque',
                        'retorque',
                        'recoque',
                        'attorque',
                        'incoque',
                        'intorque',
                        'praetorque']

        if word not in que_pass_list:
            word = re.sub(r'que$', '', word)
        else:
            in_que_pass_list = True

        return word, in_que_pass_list
960536
def check(text):
    """"""
    err = "hedging.misc"
    msg = "Hedging. Just say it."

    narcissism = [
        "I would argue that",
        ", so to speak",
        "to a certain degree",
    ]

    return existence_check(text, narcissism, err, msg)
46873
def match(self, context, line):
		""""""
		stripped = line.stripped
		return stripped.startswith('#') and not stripped.startswith('#{')
1206819
def ok(self, text=u"OK", err=False):
        """"""
        # Do not display spin text for ok state
        self._text = None

        _text = to_text(text) if text else u"OK"
        err = err or not self.write_to_stdout
        self._freeze(_text, err=err)
593744
def check(text):
    """"""
    err = "pinker.metadiscourse"
    msg = "Excessive metadiscourse."

    metadiscourse = [
        "The preceeding discussion",
        "The rest of this article",
        "This chapter discusses",
        "The preceding paragraph demonstrated",
        "The previous section analyzed",
    ]

    return existence_check(text, metadiscourse, err, msg)
1350072
def text_has_been_edited(self, text):
        """"""
        self.find(changed=True, forward=True, start_highlight_timer=True)
362375
def _match_state(self, state):
        """"""
        return (self.names == '*'
                or state in self.names
                or state.name in self.names)
627436
def expect(p, prefixes, confidential=False):
    """"""
    resp = p.stdout.readline()
    log.debug('%s -> %r', p.args, resp if not confidential else '********')
    for prefix in prefixes:
        if resp.startswith(prefix):
            return resp[len(prefix):]
    raise UnexpectedError(resp)
412948
function spellingFix(content, fontType){
  if (!content) {
    if (!globalOptions.isSilentMode()) console.warn('Content must be specified on knayi.spellingFix.');
    return '';
  }

	if (content === '' || !mmCharacterRange.test(content))
		return content;

	if (!fontType)
		fontType = fontDetect(content);

	content = content.trim().replace(/\u200B/g, '');

	switch (fontType) {
		case 'zawgyi':
			for (var i = 0; i < library.spellingFix.zawgyi.length; i++) {
				var rule = library.spellingFix.zawgyi[i];
				content = content.replace(rule[0], rule[1]);
			}
			return content;
		case 'unicode':
		default:
			for (var i = 0; i < library.spellingFix.unicode.length; i++) {
				var rule = library.spellingFix.unicode[i];
				content = content.replace(rule[0], rule[1]);
			}
			return content;
	}
}