text : TEXT PARBREAK
                | TEXT
                | PARBREAK
323479
def p_text(self, text):
        ''''''
        item = text[1]
        text[0] = item if item[0] != "\n" else u""
        if len(text) > 2:
            text[0] += "\n"
270797
function(text) {
        // Each newline cell data is wrapping double quotes in the text and
        // newline characters should be replaced with substitution characters temporarily
        // before spliting the text by newline characters.
        text = clipboardUtil.replaceNewlineToSubchar(text);

        return _.map(text.split(/\r?\n/), function(row) {
            return _.map(row.split('\t'), function(column) {
                column = clipboardUtil.removeDoubleQuotes(column);

                return column.replace(CUSTOM_LF_REGEXP, LF)
                    .replace(CUSTOM_CR_REGEXP, CR);
            });
        });
    }
777270
function trimLines(text) {
    let linebreak = determineLinebreaks(text);
    if (linebreak === "") return text;

    let lines = [];
    lines = text.split(linebreak);
    text = "";

    for (let i = 0; i < lines.length; i++) {
        let line = lines[i];

        while (true) {
            let lastChar = line.slice(line.length-1, line.length);
            let repeat = false;

            switch (lastChar) {
                case " ":
                case "\t":
                    line = line.slice(0, -1)
                    repeat = true;
            }

            if (!repeat) break;
        }

        text += line + linebreak;
    }

    return text;
}
1332655
def pare(text, size, etc='...'):
    ''''''
    size = int(size)
    text = text.strip()
    if len(text)>size:
        # strip the last word or not
        to_be_stripped = not whitespace_re.findall(text[size-1:size+2])

        text = text[:size]
        if to_be_stripped:
            half = size//2
            last = None
            for mo in whitespace_re.finditer(text[half:]):
                last = mo

            if last is not None:
                text = text[:half+last.start()+1]

        return text.rstrip() + etc
    else:
        return text
887709
def split_text(text_to_split):
        
        assert isinstance(text_to_split, string_types)
        try:
            time, rest = text_to_split.split(': ', 1)
            source, message = rest.split(':', 1)
        except ValueError:
            time = source = ""
            message = text_to_split
        return time.strip(), source.strip(), message.strip()
338920
def _run_split_on_punc(self, text):
        """"""
        chars = list(text)
        i = 0
        start_new_word = True
        output = []
        while i < len(chars):
            char = chars[i]
            if self._is_punctuation(char):
                output.append([char])
                start_new_word = True
            else:
                if start_new_word:
                    output.append([])
                start_new_word = False
                output[-1].append(char)
            i += 1

        return [''.join(x) for x in output]
234068
function parseTextData(text) {
    var data = String(text).replace(/(\r\n|\r|\n)/g, '\n');
    var lines = data.split(/\n/), line;

    var output = '';
    for (var i = 0, l = lines.length; i < l; ++i) {
        line = lines[i];

        output += 'data: ' + line;
        output += (i + 1) === l ? '\n\n' : '\n';
    }

    return output;
}
719240
function resolve ( text ) {
	text = trim(text);
	if ( !resolved[text] ) {
		resolved[text] = {
			called: text === '' ? true : false
		};
	}
	return resolved[text];
}
991777
function ( text ){
		   var out = [text],
			   chars = ['-','+','z','Z'],
			   i = chars.length;

			while (i--) {
			  if(text.indexOf(chars[i]) > -1){
				  out[0] = text.slice( 0, text.indexOf(chars[i]) );
				  out.push( text.slice( text.indexOf(chars[i]) ) );
				  break;
			   }
			}
		   return out;
		}
1261601
def wrap_text(text, width):
        
        out = []
        for paragraph in text.splitlines():
            # Wrap returns an empty list when paragraph is a newline. In order
            # to preserve newlines we substitute a list containing an empty
            # string.
            lines = wrap(paragraph, width=width) or ['']
            out.extend(lines)
        return out
743347
def cleanBlockQuotedText(text, joiner=b' '):
    """"""
    L = filter(truth, map(_lineClean, split(text, '\n')))
    return joiner.join(L)
407502
def unescape(cls, text: str) -> str:
        
        chop = text.split("\\", 1)
        try:
            return (chop[0] if len(chop) == 1
                    else chop[0] + cls.unescape_map[chop[1][0]] +
                    cls.unescape(chop[1][1:]))
        except KeyError:
            raise InvalidArgument(text) from None
1352827
def full_split(text, regex):
    
    while text:
        m = regex.search(text)
        if not m:
            yield text
            break
        left = text[:m.start()]
        middle = text[m.start():m.end()]
        right = text[m.end():]
        if left:
            yield left
        if middle:
            yield middle
        text = right
496665
def with_text(self, text, markdown=None):
        '''
        '''
        self._text = text
        self._markdown = markdown or False

        return self
487270
def text_standardize(text):
    
    text = text.replace('—', '-')
    text = text.replace('–', '-')
    text = text.replace('―', '-')
    text = text.replace('…', '...')
    text = text.replace('´', "'")
    text = re.sub(r'''(-+|~+|!+|"+|;+|\?+|\++|,+|\)+|\(+|\\+|\/+|\*+|\[+|\]+|}+|{+|\|+|_+)''', r' \1 ', text)
    text = re.sub(r'\s*\n\s*', ' \n ', text)
    text = re.sub(r'[^\S\n]+', ' ', text)
    return text.strip()
1049387
def write(self, *text, sep=' '):
        
        self.text += markdown.text(*text, sep)
        return self
619528
def parse(cls, text):
        
        OUTSIDE, IN_DOUBLE, IN_SINGLE = 0, 1, 2

        iterator = enumerate(text)
        state = OUTSIDE
        parts = []
        current_part = ''
        part_start_pos = 0

        for i, c in iterator:  # XXX: correctly handle empty strings.
            if state == OUTSIDE:
                if c.isspace():
                    # New part.
                    if current_part:
                        parts.append(current_part)
                    part_start_pos = i + 1
                    current_part = ''
                elif c == '"':
                    state = IN_DOUBLE
                elif c == "'":
                    state = IN_SINGLE
                else:
                    current_part += c

            elif state == IN_SINGLE:
                if c == "'":
                    state = OUTSIDE
                elif c == "\\":
                    next(iterator)
                    current_part += c
                else:
                    current_part += c

            elif state == IN_DOUBLE:
                if c == '"':
                    state = OUTSIDE
                elif c == "\\":
                    next(iterator)
                    current_part += c
                else:
                    current_part += c

        parts.append(current_part)
        return parts, part_start_pos