private List<Chunk> computeChunks(String inputText) {
        var text = new UnicodeString(inputText);
        List<Chunk> chunks = new ArrayList<>();
        var currentChunk = new StringBuilder();
        boolean currentHasContent = false;
        for (int i = 0; i < text.length(); ) {
            int currentChar = text.codePointAt(i);
            currentChunk.appendCodePoint(currentChar);
            if (currentHasContent && characters.isSentenceEnd(currentChar) && !characters.isSentenceEnd(text.nextCodePoint(i))) {
                chunks.add(new Chunk(currentChunk.toString()));
                currentChunk.setLength(0);
                currentHasContent = false;
            }
            else {
                currentHasContent |= ( characters.isLetterOrDigit(currentChar) || characters.isSymbol(currentChar) );
            }
            i = text.nextIndex(i);
        }
        if ( ! currentChunk.isEmpty())
            chunks.add(new Chunk(currentChunk.toString()));
        return chunks;
    }
A chunker which splits a text into sentences.

@author bratseth
linguistics/src/main/java/ai/vespa/language/chunker/SentenceChunker.java