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

    let prev_position = position - 1;

    let current_grapheme = subject.grapheme_at(position);
    let prev_grapheme = subject.grapheme_at(prev_position);

    is_word_separator(prev_grapheme) // (b)
        || ((current_grapheme != subject.lowercase_grapheme_at(position))
            && (prev_grapheme == subject.lowercase_grapheme_at(prev_position))) // (c)
}
/// Check whether the grapheme at given the position is a start of word or not
///
/// A grapheme is a start of word if it is either:
///   * (a) in the first position of the subject
///   * (b) following a word separator
///   * (c) capital letter after a lowercase letter (camelCase rule)
Check whether the grapheme at given the position is a start of word or not
A grapheme is a start of word if it is either:
(a) in the first position of the subject
(b) following a word separator
(c) capital letter after a lowercase letter (camelCase rule)
Check whether the grapheme at given the position is a start of word or not A grapheme is a start of word if it is either : ( a ) in the first position of the subject ( b ) following a word separator ( c ) capital letter after a lowercase letter ( camelCase rule )
pub fn is_start_of_word(subject: &Text, position: usize) -> bool {
    if position == 0 {
        return true; // (a)
    }
    let prev_position = position - 1;
    let current_grapheme = subject.grapheme_at(position);
    let prev_grapheme = subject.grapheme_at(prev_position);
    is_word_separator(prev_grapheme) // (b)
        || ((current_grapheme != subject.lowercase_grapheme_at(position))
            && (prev_grapheme == subject.lowercase_grapheme_at(prev_position))) // (c)
}
pub fn is_start_of_word ( subject : & Text , position : usize ) -> bool { if position == 0 { return true ; // (a) } let prev_position = position - 1 ; let current_grapheme = subject . grapheme_at ( position ) ; let prev_grapheme = subject . grapheme_at ( prev_position ) ; is_word_separator ( prev_grapheme ) // (b) || ( ( current_grapheme != subject . lowercase_grapheme_at ( position ) ) && ( prev_grapheme == subject . lowercase_grapheme_at ( prev_position ) ) ) // (c) }
Check whether the grapheme at given the position is a start of word or not
A grapheme is a start of word if it is either:
 (a) in the first position of the subject
 (b) following a word separator
 (c) capital letter after a lowercase letter (camelCase rule)
Check whether the grapheme at given the position is a start of word or not A grapheme is a start of word if it is either : ( a ) in the first position of the subject ( b ) following a word separator ( c ) capital letter after a lowercase letter ( camelCase rule )
subject
&Text
position
usize