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
feat: Backward search api #457
Conversation
There were some issues that came up because I didn't modify the examples in the docs to use the new result type. I've fixed those now and |
May I ask you to format with the latest stable rust version? |
Done! |
let positions = match sai { | ||
BackwardSearchResult::Complete(saint) => saint.occ(&sa), | ||
BackwardSearchResult::Partial(saint, l) => { | ||
partial_match_len = l; | ||
saint.occ(&sa) | ||
} | ||
BackwardSearchResult::Absent => Vec::<usize>::new(), | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're expecting a partial match here, I think having only the corresponding Partial match arm and a panic/unreachable/... for the other two should make this (and also the other) testcase(s) clearer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, github showed this too late to me (after merging actually). Can you (when you find the time), modify this in a separate PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
Improve the backward_search API to inform the user if there was a complete match, a partial (suffix) match, or no match during the search.