/* (non-Javadoc)
@see edu.jhu.hltcoe.sp.data.depparse.AgigaSentence#getParseText()
492063
public String getParseText() {

		if(parseTextFixedCache != null)
			return parseTextFixedCache;

		// check for leaves that have a space in them
		// replace any spaces with non-breaking spaces 0xa0
		final String nbsp = "\u00A0";

		// want to find terminals with more than one token
		// leaves are not recursive, so its ok to use a regular expression
		Matcher m = multiWordTerminalPat.matcher(parseText);
		int ptr = 0;
		StringBuilder sb = null;
		while(m.find()) {
			if(sb == null) sb = new StringBuilder();
			int s = m.start();
			int e = m.end();
			
			// before match
			sb.append(parseText.substring(ptr, s));
			
			// match itself
			String mid = parseText.substring(s, e);
			int mid_space = mid.indexOf(" ");
			sb.append(mid.substring(0, mid_space+1));
			sb.append(mid.substring(mid_space+1).replaceAll("\\s+", nbsp));

			ptr = e;
		}
		if(sb == null) {
			parseTextFixedCache = parseText;
		} else {
			sb.append(parseText.substring(ptr));
			parseTextFixedCache = sb.toString();
		}
		return parseTextFixedCache;
    }
1357466
public String getAsText() {
        LocalDate value = (LocalDate) getValue();
        return (value != null ? value.toString(this.formatter) : "");
    }
330764
public void setAsText(String text) throws IllegalArgumentException {
        if (this.allowEmpty && !StringUtils.hasText(text)) {
            // Treat empty String as null value.
            setValue(null);
        } else {
            setValue(new LocalDate(this.formatter.parseDateTime(text)));
        }
    }
903707
public Object parseText(String text) {
        if (text == null || text.length() == 0) {
            throw new IllegalArgumentException("The JSON input text should neither be null nor empty.");
        }

        return parse(new LineColumnReader(new StringReader(text)));
    }
755060
private String getString() throws MtasParserException {
    String text = null;
    BufferedReader bufferedReader = new BufferedReader(reader, 2048);
    try {
      text = IOUtils.toString(bufferedReader);
      bufferedReader.close();
      return text;
    } catch (IOException e) {
      log.debug(e);
      throw new MtasParserException("couldn't read text");
    }
  }
318931
@Override
    public void setAsText(String text) throws IllegalArgumentException {
        if(text == null){
            setValue(null);
            return;
        }
        setValue(tokenize(text));
    }
673906
public void setAsText(String text) throws IllegalArgumentException {
		for (int i = 0; i < length; i++)
			if (text.equals(locales[i].getDisplayName())) {
				locale = locales[i];
				setValue(locale);

				break;
			}
	}
547811
public String whenAsText() {
        if (whenAsText == null) {
            whenAsText = DateTimeFormatter.ISO_INSTANT.format(Instant.ofEpochMilli(when()));
        }
        return whenAsText;
    }
845846
@Override
    public Geldbetrag parse(CharSequence text) throws MonetaryParseException {
        return parse(Objects.toString(text));
    }
1110914
@Override
    protected IIOMetadataNode getStandardTextNode() {
        if (!header.getComments().isEmpty()) {
            IIOMetadataNode text = new IIOMetadataNode("Text");

            for (String comment : header.getComments()) {
                IIOMetadataNode textEntry = new IIOMetadataNode("TextEntry");
                textEntry.setAttribute("keyword", "comment");
                textEntry.setAttribute("value", comment);
                text.appendChild(textEntry);
            }

            return text;
        }

        return null;
    }
435186
public static void parseText(String text, AhoCorasickDoubleArrayTrie.IHit<CoreDictionary.Attribute> processor)
    {
        if (trie != null)
        {
            BaseSearcher searcher = CustomDictionary.getSearcher(text);
            int offset;
            Map.Entry<String, CoreDictionary.Attribute> entry;
            while ((entry = searcher.next()) != null)
            {
                offset = searcher.getOffset();
                processor.hit(offset, offset + entry.getKey().length(), entry.getValue());
            }
        }
        DoubleArrayTrie<CoreDictionary.Attribute>.Searcher searcher = dat.getSearcher(text, 0);
        while (searcher.next())
        {
            processor.hit(searcher.begin, searcher.begin + searcher.length, searcher.value);
        }
    }
541361
protected String getTextEx(int position, int len)
    {
        try {
            return getDocument().getText(position, len);
        } catch (BadLocationException e) {
            e.printStackTrace();
            return "";
        }
    }
1295128
public String getAsText(int fieldValue, Locale locale) {
        return GJLocaleSymbols.forLocale(locale).monthOfYearValueToText(fieldValue);
    }
816940
public Object parseText(String text) {
        if (text == null || "".equals(text)) {
            throw new IllegalArgumentException("Text must not be null");
        }
        return createParser().parse(text);
    }
217269
public String getAsText(int fieldValue, Locale locale) {
        return GJLocaleSymbols.forLocale(locale).dayOfWeekValueToText(fieldValue);
    }
311593
private int loadSparseTextOffsets(RandomAccessBufferedReader textSSpace) 
            throws IOException {
        String line = textSSpace.readLine();
        if (line == null)
            throw new IOError(new Throwable(
                        "An empty file has been passed in"));

        // Strip off the 4-byte (2 char) header
        if (containsHeader) {
            line = line.substring(4);
            System.out.println(line);
        }        

        String[] dimensions = line.split("\\s");
        int columns = Integer.parseInt(dimensions[1]);
        int rows = Integer.parseInt(dimensions[0]);
        int row = 1;
        
        while ((line = textSSpace.readLine()) != null) {
            String[] termVectorPair = line.split("\\|");
            termToOffset.put(termVectorPair[0], Long.valueOf(row));
            row++;
        }
        if ((row - 1) != rows)
            throw new IOException(String.format(
                "Different number of rows than specified (%d): %d", rows, row));
        return columns;    
    }
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;
}