pub fn match_positions_graphemes(
query: &str,
candidate: &str,
) -> Option<Vec<usize>>Expand description
Returns grapheme indices in candidate that match query in order.
Matching is case-insensitive by Unicode NFKC + lowercase folding.
Case folding may expand a single grapheme into multiple folded units (for
example, ß → ss). Returned positions are still grapheme indices in the
original candidate and collapse multi-unit folds to a single position,
which is suitable for highlighting.
- If
queryis empty, returnsSome(vec![]). - If all graphemes in
querycan be matched in order, returns their positions as grapheme indices incandidate. - Otherwise returns
None.
This function performs no scoring. For a scored matcher that also returns
match positions suitable for highlighting, use
fuzzy_match_positions_graphemes.