feat: Introduce a WordArea struct

Useful to highlight matching areas in the original text.
This commit is contained in:
Clément Renault
2018-12-23 16:46:49 +01:00
parent 62521262e8
commit b32c96cdc9
14 changed files with 373 additions and 136 deletions

View File

@ -14,7 +14,7 @@ fn sum_matches_attribute_index(matches: &[Match]) -> u32 {
// note that GroupBy will never return an empty group
// so we can do this assumption safely
GroupBy::new(matches, match_query_index).map(|group| unsafe {
group.get_unchecked(0).attribute_index
group.get_unchecked(0).attribute.word_index()
}).sum()
}