Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
fix: Make QGramIndex use less memory; fix bug; improve tests&docs (#471)
I've added some more documentation and clarifying tests to `QGramIndex`, so that the implementation is more clear without looking at the code. I found one small bug: q-grams of value `0` (i.e. `AAA`) wouldn't be filtered by `max_count`. I've added a test that would fail if the `.skip(1)` was still there. The size of the `pos` vector was always `|text|`, but it's sufficient to only allocate memory for the number of unfiltered q-grams. Please verify this. I've added a `text="AAAAA"`, `pattern="AAA"` test that should show that things are still working.
- Loading branch information
1 parent
b244a21
commit 48bac1c
Showing
1 changed file
with
90 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters