spyglass/src/main/java/com/linkedin/android/spyglass/ui/MentionsEditText.java
private int findStartOfWord(@NonNull CharSequence text, int index) {
        int wordStart = index;
        while (wordStart > 0 && mTokenizer != null && !mTokenizer.isWordBreakingChar(text.charAt(wordStart - 1))) {
            wordStart--;
        }
        return wordStart;
    }
private int findStartOfWord(@NonNull CharSequence text, int index) {
        int wordStart = index;
        while (wordStart > 0 && mTokenizer != null && !mTokenizer.isWordBreakingChar(text.charAt(wordStart - 1))) {
            wordStart--;
        }
        return wordStart;
    }
Helper utility to determine the beginning of a word using the current tokenizer.

@param text  the text to examine
@param index index of the cursor in the text
@return  index of the beginning of the word in text (will be less than or equal to index)