コードポイントの配列に変換する。
@param text
@return
184187
private int[] toCodePointArray(final String text) {
        final int length = text.length();
        final int codePointLength = text.codePointCount(0, length);

        int[] array = new int[codePointLength];
        for(int i=0, j=0, codePoint=0; i < length; j++, i+=Character.charCount(codePoint)) {
            codePoint = text.codePointAt(i);
            array[j] = codePoint;
        }

        return array;
    }
1100280
private ArrayList<ArrayList<String>> parseString(String text) {

        ArrayList<ArrayList<String>> result = new ArrayList<ArrayList<String>>();
        StringTokenizer linetoken = new StringTokenizer(text, "\n");
        StringTokenizer token;
        String current;
        while (linetoken.hasMoreTokens()) {
            current = linetoken.nextToken();
            if (current.contains(",")) {
                token = new StringTokenizer(current, ",");
            } else {
                token = new StringTokenizer(current);
            }
            ArrayList<String> line = new ArrayList<String>();
            while (token.hasMoreTokens()) {
                line.add(token.nextToken());
            }
            result.add(line);
        }
        return result;
    }
1230235
public static List<Term> segment(char[] text)
    {
        List<Term> resultList = SEGMENT.seg(text);
        ListIterator<Term> listIterator = resultList.listIterator();
        while (listIterator.hasNext())
        {
            if (!CoreStopWordDictionary.shouldInclude(listIterator.next()))
            {
                listIterator.remove();
            }
        }

        return resultList;
    }
1064245
public Element text(String text) {
        Validate.notNull(text);

        empty();
        TextNode textNode = new TextNode(text);
        appendChild(textNode);

        return this;
    }
1115872
public QRSCT text(String text) {
		if (text != null && text.length() <= 140) {
			this.reference = ""; //$NON-NLS-1$
			this.text = checkValidSigns(text);
			return this;
		}
		throw new IllegalArgumentException("supplied text [" + text //$NON-NLS-1$
				+ "] not valid: has to be not null and of max length 140"); //$NON-NLS-1$
	}
451224
private String normalizeText(String text) {
        String[] tokens = StringUtils.split(text, "\n");
        for (int i = 0; i < tokens.length; i++) {
            tokens[i] = tokens[i].trim();
        }

        return StringUtils.join(tokens, " ").trim();
    }
175398
public String match(String text){
		if(null == text){
			return null;
		}
		List<String> matchAll = matchAll(text, 1);
		if(CollectionUtil.isNotEmpty(matchAll)){
			return matchAll.get(0);
		}
		return null;
	}
248109
private static String buildText(String text) {
    // <JAR><JAR> to PARAGRAPH mark in unicode
    text = doubleLineBreak.matcher(text).replaceAll(PARAGRAPH);
    // <JAR> to " "
    text = lineBreak.matcher(text).replaceAll(" ");
    return text;
  }
946556
@Pure
	public static String toHTML(String text) {
		if (text == null) {
			return null;
		}
		final Map<Character, String> transTbl = getJavaToHTMLTranslationTable();
		assert transTbl != null;
		if (transTbl.isEmpty()) {
			return text;
		}
		final StringBuilder patternStr = new StringBuilder();
		for (final Character c : transTbl.keySet()) {
			if (patternStr.length() > 0) {
				patternStr.append("|"); //$NON-NLS-1$
			}
			patternStr.append(Pattern.quote(c.toString()));
		}
		final Pattern pattern = Pattern.compile(patternStr.toString());
		final Matcher matcher = pattern.matcher(text);
		final StringBuilder result = new StringBuilder();
		String character;
		String entity;
		int lastIndex = 0;
		while (matcher.find()) {
			final int idx = matcher.start();
			result.append(text.substring(lastIndex, idx));
			lastIndex = matcher.end();
			character = matcher.group();
			if (character.length() == 1) {
				entity = transTbl.get(Character.valueOf(character.charAt(0)));
				if (entity != null) {
					entity = "&" + entity + ";"; //$NON-NLS-1$ //$NON-NLS-2$
				} else {
					entity = character;
				}
			} else {
				entity = character;
			}
			result.append(entity);
		}
		if (lastIndex < text.length()) {
			result.append(text.substring(lastIndex));
		}
		return result.toString();
	}
403826
public CAS process(String text) {
        CAS cas = retrieve();
        if (cas == null)
            return null;

        cas.setDocumentText(text);
        try {
            analysisEngine.process(cas);
        } catch (AnalysisEngineProcessException e) {
            log.warn("Unable to process text " + text, e);
        }

        return cas;


    }
213879
@NonNull public static List<EmojiRange> emojis(@Nullable final String text) {
    return EmojiManager.getInstance().findAllEmojis(text);
  }
1319421
public static String getSurname(String text){
        if(is(text)){
            //优先识别复姓
            if(isSurname(text.substring(0, 2))){
                return text.substring(0, 2);
            }
            if(isSurname(text.substring(0, 1))){
                return text.substring(0, 1);
            }
        }
        return "";
    }
420562
public String posTagging(String text){
		String ret = text;
		if (vnPosTagger != null){
			ret = vnPosTagger.tagging(text);			
		}
		
		return ret;
	}
887028
public static final String property(String text)
    {
        CamelSpliterator cs = new CamelSpliterator(text);
        StringBuilder sb = new StringBuilder();
        cs.tryAdvance((s)->sb.append(lower(s)));
        StreamSupport.stream(cs, false).forEach((s)->sb.append(s));
        return sb.toString();
    }
91248
public boolean containsString (String text)
    {
        for (int ii = 0, nn = _lines.size(); ii < nn; ii++) {
            // don't look inside the autogenerated areas
            if (!(ii >= _nstart && ii < _nend) && !(ii >= _mstart && ii < _mend) &&
                    _lines.get(ii).contains(text)) {
                return true;
            }
        }
        return false;
    }
1221172
public List<String> tokenize(String text) {
		List<String> tokens = new ArrayList<String>();
		text = text.toLowerCase();
		char[] array = text.toCharArray();
		
		//convert all apostrophes to 0x27
		for(int i = 0; i < array.length; i++) {
			if(isApostrofe(array[i])) array[i] = 0x27;
		}
		
		int pos = 0;
		
		//term cycle
		while(pos < array.length) {
			//scan to the start of the term
			while(pos < array.length  && !Character.isLetterOrDigit(array[pos])) pos++;
			int start = pos;
			if(start == array.length) break;
			//scan to the end of the term
			while(pos < array.length  && isLetterOrDigitOrApostrofe(array[pos])) pos++;
			int newpos = pos;
			while(newpos > start && isApostrofe(array[newpos - 1])) newpos--;
			if(newpos > start) tokens.add(new String(array, start, newpos - start));
		}
		return tokens;
	}
352587
public String senTokenize(String text){
		String ret = text;
		
		if (isTokenization){
			ret = PennTokenizer.tokenize(text);
		}
		
		return ret.trim();
	}