spyglass/src/main/java/com/linkedin/android/spyglass/tokenization/impl/WordTokenizer.java
protected boolean hasWordBreakingCharBeforeExplicitChar(final @NonNull Spanned text, final int cursor) {
        CharSequence beforeCursor = text.subSequence(0, cursor);
        // Get the explicit character closest before the cursor and make sure it
        // has a word-breaking character in front of it
        int i = cursor - 1;
        while (i >= 0 && i < beforeCursor.length()) {
            char c = beforeCursor.charAt(i);
            if (isExplicitChar(c)) {
                return i == 0 || isWordBreakingChar(beforeCursor.charAt(i - 1));
            }
            i--;
        }
        return false;
    }
protected boolean hasWordBreakingCharBeforeExplicitChar(final @NonNull Spanned text, final int cursor) {
        CharSequence beforeCursor = text.subSequence(0, cursor);
        // Get the explicit character closest before the cursor and make sure it
        // has a word-breaking character in front of it
        int i = cursor - 1;
        while (i >= 0 && i < beforeCursor.length()) {
            char c = beforeCursor.charAt(i);
            if (isExplicitChar(c)) {
                return i == 0 || isWordBreakingChar(beforeCursor.charAt(i - 1));
            }
            i--;
        }
        return false;
    }
Ensure the the character before the explicit character is a word-breaking character.
Note that the function only uses the input string to determine which explicit character was
typed. It uses the complete contents of the {@link EditText} to determine if there is a
word-breaking character before the explicit character, as the input string may start with an
explicit character, i.e. with an input string of "@John Doe" and an {@link EditText} containing
the string "Hello @John Doe", this should return true.

@param text   the {@link Spanned} to check for a word-breaking character before the explicit character
@param cursor position of the cursor in text

@return true if there is a space before the explicit character, false otherwise