process quoted text
162619
private Token quotedText(char quote) throws ScanException {
        nextChar(); // eat the '"'
        text = new StringBuilder();
        while (c != quote) {
            if (c == '\n') {
                throw new ScanException("Unclosed quoted text, reached end of line.");
            }
            text.append(c);
            nextChar();
        }
        nextChar(); // eat the '"'
        return TEXT;
    }
647192
def quote(text):
    """"""
    text = unicode(text)
    return text.translate({
        ord('&'): u'&amp;',
        ord('<'): u'&lt;',
        ord('"'): u'&quot;',
        ord('>'): u'&gt;',
        ord('@'): u'&#64;',
        0xa0: u'&nbsp;'})
331179
def consume_quoted_regions
        text = ""
        loop do
          match = @scanner.scan_until(/['"<>]/) or break

          delim = @scanner.matched
          if delim == "<"
            match = match.chop
            @scanner.pos -= 1
          end

          text << match
          break if delim == "<" || delim == ">"

          # consume the quoted region
          while match = @scanner.scan_until(/[\\#{delim}]/)
            text << match
            break if @scanner.matched == delim
            text << @scanner.getch # skip the escaped character
          end
        end
        text
      end
93088
def unquote(s):
    """"""
    res = s.split('%')
    # fastpath
    if len(res) == 1:
        return s
    s = res[0]
    for item in res[1:]:
        try:
            s += _hextochr[item[:2]] + item[2:]
        except KeyError:
            s += '%' + item
        except UnicodeDecodeError:
            s += chr(int(item[:2], 16)) + item[2:]
    return s
1000494
def fix_text_escapes(self, txt: str, quote_char: str) -> str:
        
        def _subf(matchobj):
            return matchobj.group(0).translate(self.re_trans_table)
        if quote_char:
            txt = re.sub(r'\\'+quote_char, quote_char, txt)
        return re.sub(r'\\.', _subf, txt, flags=re.MULTILINE + re.DOTALL + re.UNICODE)
107936
def coerce_quotes(quotes):
        """"""
        orig, quotes = quotes, str(quotes) if quotes else None
        if quotes not in [None, '"', "'"]:
            raise ValueError("{!r} is not a valid quote type".format(orig))
        return quotes
415920
def process(inputLines: List[str]) -> str:
    """"""
    lines = separate_trailing_comments(inputLines)
    merge_continued_lines(lines)
    (lines, comments) = extract_comments(lines)
    actual_lines = [
        line[1]
        for line in lines
        if line[1] is not None and "i_g_n_o_r_e___m_e_" not in line[1]
    ]
    return "".join(actual_lines)
18356
@SuppressWarnings("fallthrough")
    protected void quotedString() {
        int pos = bp;
        nextChar();

        loop:
        while (bp < buflen) {
            switch (ch) {
                case '\n': case '\r': case '\f':
                    newline = true;
                    break;

                case ' ': case '\t':
                    break;

                case '"':
                    nextChar();
                    // trim trailing white-space?
                    return;

                case '@':
                    if (newline)
                        break loop;

            }
            nextChar();
        }
    }
499923
def is_quoted(s):
    
    return (s.startswith("'") and s.endswith("'")) or (s.startswith('"') and s.endswith('"'))
876299
def _parse_quoted_key(self):  # type: () -> Key
        
        quote_style = self._current
        key_type = None
        dotted = False
        for t in KeyType:
            if t.value == quote_style:
                key_type = t
                break

        if key_type is None:
            raise RuntimeError("Should not have entered _parse_quoted_key()")

        self.inc()
        self.mark()

        while self._current != quote_style and self.inc():
            pass

        key = self.extract()

        if self._current == ".":
            self.inc()
            dotted = True
            key += "." + self._parse_key().as_string()
            key_type = KeyType.Bare
        else:
            self.inc()

        return Key(key, key_type, "", dotted)
1126023
function quotedPair() {
        var qp = wrap('quoted-pair',
        or(
            and(literal('\\'), or(vchar, wsp)),
            obsQP
        )());
        if (qp === null) { return null; }
        // a quoted pair will be two characters, and the "\" character
        // should be semantically "invisible" (RFC 5322 3.2.1)
        qp.semantic = qp.semantic[1];
        return qp;
    }
454550
def unquote(s):
  """"""
  # Ignore the left- and rightmost chars (which should be quotes).
  # Use the Python engine to decode the escape sequence
  i, N = 1, len(s) - 1
  ret = []
  while i < N:
    if s[i] == '\\' and i < N - 1:
      ret.append(UNQUOTE_MAP.get(s[i+1], s[i+1]))
      i += 2
    else:
      ret.append(s[i])
      i += 1
  return ''.join(ret)
885106
function quotedString() {
        return wrap('quoted-string', and(
            invis(opt(cfws)),
            invis(dquote), star(and(opt(colwsp(fws)), qcontent)), opt(invis(fws)), invis(dquote),
            invis(opt(cfws))
        )());
    }
26694
private function processBlockquote($text, $inline = false)
    {
        if ($inline) {
            $length = 0;
            $text = str_replace(self::BLOCKQUOTE_INLINE_START, '', $text); // remove bq.
        } else {
            $length = strlen(self::BLOCKQUOTE_BLOCK_START);
            $text = mb_substr($text, $length); // remove first {quote}
        }

        $end = $this->findBlockquoteEnd($text, $inline);
        $blockquote = mb_substr($text, 0, $end);
        $this->wrapInNode(self::NODE_BLOCKQUOTE, function () use ($blockquote) {
            $this->processInline($blockquote);
        });

        return mb_substr($text, $end + $length);
    }
251713
function processInline(tokens) {
  if (tokens[0] && (tokens[0].type === 'header' ||
      tokens[0].type === 'list' || tokens[0].type === 'ordered-list' ||
      tokens[0].type === 'blockquote')) {
    tokens[0].content = processEmphasis(tokens[0].content);
    tokens[0].length = getTokensLength(tokens[0].content);
    delete tokens[0].markup;
  } else if (Array.isArray(tokens)) {
    tokens = processEmphasis(tokens);
  }

  return tokens;
}
551663
function processKeywords (text) {
  // for some reason retext is not filtering "it's" out
  const cleanText = text.replace(/'t/g, '')
                        .replace(/'s/g, '')
                        .replace(/'ll/g, '')
                        .replace(/'re/g, '')
                        .replace(/'ve/g, '');

  return new Promise(function (resolve, reject) {
    processor.process(cleanText, function (err, file) {
      if (err) {
        reject(err);
      }
      const space = file.namespace('retext');
      const words = space.keywords.map((w) => ({
        value: nlcstToString(w.matches[0].node),
        score: w.score
      }));
      const phrases = space.keyphrases.map((p) => ({
        value: p.matches[0].nodes.map(nlcstToString).join(''),
        score: p.score
      }));

      resolve({words, phrases});
    });
  });
}
682495
def try_process_text(self, text):
        
        if not text:
            return text
        try:
            return self.process_text(text)
        except (socket.gaierror, socket.timeout, xml.parsers.expat.ExpatError):
            return text