Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Make QGramIndex use less memory; add docs; fix bug #471

Merged
merged 1 commit into from Feb 8, 2022

Conversation

RagnarGrootKoerkamp
Copy link
Contributor

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.

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.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.08%) to 88.756% when pulling adb363a on RagnarGrootKoerkamp:qgram into 9e8a7ca on rust-bio:master.

@johanneskoester
Copy link
Contributor

Thank you, good catch!

@johanneskoester johanneskoester merged commit 48bac1c into rust-bio:master Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants