private boolean endOfChunk(int currentLength) {
            if (currentLength < targetLength) return false;
            if (isCjk) return true;
            if (currentLength < softMaxLength) return !isLetter(index) && !isLetter(nextIndex());
            if (currentLength < hardMaxLength) return !isLetter(index);
            return true;
        }
Computer with the scope of chunking a single input text.
linguistics/src/main/java/ai/vespa/language/chunker/FixedLengthChunker.java