spyglass/src/main/java/com/linkedin/android/spyglass/tokenization/impl/WordTokenizer.java
@Override
    public int findTokenStart(final @NonNull Spanned text, final int cursor) {
        int start = getSearchStartIndex(text, cursor);
        int i = cursor;

        // If it is explicit, return the index of the first explicit character
        if (isExplicit(text, cursor)) {
            i--;
            while (i >= start) {
                char currentChar = text.charAt(i);
                if (isExplicitChar(currentChar)) {
                    if (i == 0 || isWordBreakingChar(text.charAt(i - 1))) {
                        return i;
                    }
                }
                i--;
            }
            // Could not find explicit character before the cursor
            // Note: This case should never happen (means that isExplicit
            // returned true when it should have been false)
            return -1;

        } else {

            // For implicit tokens, we need to go back a certain number of words to find the start
            // of the token (with the max number of words to go back defined in the config)
            int maxNumKeywords = mConfig.MAX_NUM_KEYWORDS;

            // Go back to the start of the word that the cursor is currently in
            while (i > start && !isWordBreakingChar(text.charAt(i - 1))) {
                i--;
            }

            // Cursor is at beginning of current word, go back MaxNumKeywords - 1 now
            for (int j = 0; j < maxNumKeywords - 1; j++) {
                // Decrement through only one word-breaking character, if it exists
                if (i > start && isWordBreakingChar(text.charAt(i - 1))) {
                    i--;
                }
                // If there is more than one word-breaking space, break out now
                // Do not consider queries with words separated by more than one word-breaking char
                if (i > start && isWordBreakingChar(text.charAt(i - 1))) {
                    break;
                }
                // Decrement until the next space
                while (i > start && !isWordBreakingChar(text.charAt(i - 1))) {
                    i--;
                }
            }

            // Ensures that text.char(i) is not a word-breaking or explicit char (i.e. cursor must have a
            // word-breaking char in front of it and a non-word-breaking char behind it)
            while (i < cursor && (isWordBreakingChar(text.charAt(i)) || isExplicitChar(text.charAt(i)))) {
                i++;
            }

            return i;
        }
    }
@Override
    public int findTokenStart(final @NonNull Spanned text, final int cursor) {
        int start = getSearchStartIndex(text, cursor);
        int i = cursor;

        // If it is explicit, return the index of the first explicit character
        if (isExplicit(text, cursor)) {
            i--;
            while (i >= start) {
                char currentChar = text.charAt(i);
                if (isExplicitChar(currentChar)) {
                    if (i == 0 || isWordBreakingChar(text.charAt(i - 1))) {
                        return i;
                    }
                }
                i--;
            }
            // Could not find explicit character before the cursor
            // Note: This case should never happen (means that isExplicit
            // returned true when it should have been false)
            return -1;

        } else {

            // For implicit tokens, we need to go back a certain number of words to find the start
            // of the token (with the max number of words to go back defined in the config)
            int maxNumKeywords = mConfig.MAX_NUM_KEYWORDS;

            // Go back to the start of the word that the cursor is currently in
            while (i > start && !isWordBreakingChar(text.charAt(i - 1))) {
                i--;
            }

            // Cursor is at beginning of current word, go back MaxNumKeywords - 1 now
            for (int j = 0; j < maxNumKeywords - 1; j++) {
                // Decrement through only one word-breaking character, if it exists
                if (i > start && isWordBreakingChar(text.charAt(i - 1))) {
                    i--;
                }
                // If there is more than one word-breaking space, break out now
                // Do not consider queries with words separated by more than one word-breaking char
                if (i > start && isWordBreakingChar(text.charAt(i - 1))) {
                    break;
                }
                // Decrement until the next space
                while (i > start && !isWordBreakingChar(text.charAt(i - 1))) {
                    i--;
                }
            }

            // Ensures that text.char(i) is not a word-breaking or explicit char (i.e. cursor must have a
            // word-breaking char in front of it and a non-word-breaking char behind it)
            while (i < cursor && (isWordBreakingChar(text.charAt(i)) || isExplicitChar(text.charAt(i)))) {
                i++;
            }

            return i;
        }
    }
{@inheritDoc}