pub fn is_end_of_word(subject: &Text, position: usize) -> bool {
    if position == subject.last_index() {
        return true; // (a)
    }

    let next_position = position + 1;

    let current_grapheme = subject.grapheme_at(position);
    let next_grapheme = subject.grapheme_at(next_position);

    is_word_separator(next_grapheme) // (b)
        || ((current_grapheme == subject.lowercase_grapheme_at(position))
            && (next_grapheme != subject.lowercase_grapheme_at(next_position))) // (c)
}
/// Check whether the grapheme at given the position is an end of word or not
///
/// A grapheme is an end of word if it is either:
///   * (a) in the last position of the subject
///   * (b) followed by a word separator
///   * (c) lowercase letter followed by a capital letter (camelCase rule)
Check whether the grapheme at given the position is an end of word or not
A grapheme is an end of word if it is either:
(a) in the last position of the subject
(b) followed by a word separator
(c) lowercase letter followed by a capital letter (camelCase rule)
Check whether the grapheme at given the position is an end of word or not A grapheme is an end of word if it is either : ( a ) in the last position of the subject ( b ) followed by a word separator ( c ) lowercase letter followed by a capital letter ( camelCase rule )
pub fn is_end_of_word(subject: &Text, position: usize) -> bool {
    if position == subject.last_index() {
        return true; // (a)
    }
    let next_position = position + 1;
    let current_grapheme = subject.grapheme_at(position);
    let next_grapheme = subject.grapheme_at(next_position);
    is_word_separator(next_grapheme) // (b)
        || ((current_grapheme == subject.lowercase_grapheme_at(position))
            && (next_grapheme != subject.lowercase_grapheme_at(next_position))) // (c)
}
pub fn is_end_of_word ( subject : & Text , position : usize ) -> bool { if position == subject . last_index ( ) { return true ; // (a) } let next_position = position + 1 ; let current_grapheme = subject . grapheme_at ( position ) ; let next_grapheme = subject . grapheme_at ( next_position ) ; is_word_separator ( next_grapheme ) // (b) || ( ( current_grapheme == subject . lowercase_grapheme_at ( position ) ) && ( next_grapheme != subject . lowercase_grapheme_at ( next_position ) ) ) // (c) }
Check whether the grapheme at given the position is an end of word or not
A grapheme is an end of word if it is either:
 (a) in the last position of the subject
 (b) followed by a word separator
 (c) lowercase letter followed by a capital letter (camelCase rule)
Check whether the grapheme at given the position is an end of word or not A grapheme is an end of word if it is either : ( a ) in the last position of the subject ( b ) followed by a word separator ( c ) lowercase letter followed by a capital letter ( camelCase rule )
subject
&Text
position
usize