fn delete_in_suggestion_prefix(&self, delete: &str, suggestion: &str) -> bool {
        let delete_gc = GraphemeClusters::new(delete);
        let suggestion_gc = GraphemeClusters::new(suggestion);

        let delete_len = delete_gc.len();
        if delete_len == 0 {
            return true;
        }

        let suggestion_len = suggestion_gc.len().min(self.prefix_length);

        let mut j = 0;
        for (delete_char, _) in delete_gc {
            while j < suggestion_len && delete_char != &suggestion_gc[j] {
                j += 1;
            }
            if j == suggestion_len {
                return false;
            }
        }
        true
    }
// check whether all delete chars are present in the suggestion prefix in correct order, otherwise this is just a hash collision
check whether all delete chars are present in the suggestion prefix in correct order, otherwise this is just a hash collision
check whether all delete chars are present in the suggestion prefix in correct order otherwise this is just a hash collision
fn delete_in_suggestion_prefix(&self, delete: &str, suggestion: &str) -> bool {
        let delete_gc = GraphemeClusters::new(delete);
        let suggestion_gc = GraphemeClusters::new(suggestion);
        let delete_len = delete_gc.len();
        if delete_len == 0 {
            return true;
        }
        let suggestion_len = suggestion_gc.len().min(self.prefix_length);
        let mut j = 0;
        for (delete_char, _) in delete_gc {
            while j < suggestion_len && delete_char != &suggestion_gc[j] {
                j += 1;
            }
            if j == suggestion_len {
                return false;
            }
        }
        true
    }
fn delete_in_suggestion_prefix ( & self , delete : & str , suggestion : & str ) -> bool { let delete_gc = GraphemeClusters :: new ( delete ) ; let suggestion_gc = GraphemeClusters :: new ( suggestion ) ; let delete_len = delete_gc . len ( ) ; if delete_len == 0 { return true ; } let suggestion_len = suggestion_gc . len ( ) . min ( self . prefix_length ) ; let mut j = 0 ; for ( delete_char , _ ) in delete_gc { while j < suggestion_len && delete_char != & suggestion_gc [ j ] { j += 1 ; } if j == suggestion_len { return false ; } } true }
check whether all delete chars are present in the suggestion prefix in correct order, otherwise this is just a hash collision
check whether all delete chars are present in the suggestion prefix in correct order otherwise this is just a hash collision
&self
delete
&str
suggestion
&str