text: public int lookup(char[] text, int offset, int len) {if(!characterDefinition.isGroup(text[offset])) {return 1;}byte characterIdOfFirstCharacter = characterDefinition.getCharacterClass(text[offset]);int length = 1;for (int i = 1; i < len; i++) {if (characterIdOfFirstCharacter == characterDefinition.getCharacterClass(text[offset+i])){length++;} else {break;}}return length;}