-
Notifications
You must be signed in to change notification settings - Fork 6
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
Efficient range operations over multiple Set objects #8
Comments
It does indeed! Ping me if anyone needs help with this. |
@BurntSushi : can you give me an example of doing this in Rust? I can probably figure out how to translate it to Python/cffi. I'm wondering if we'd to add something to the C layer for this. |
@davidblewett I believe this is what you're after? https://docs.rs/fst/0.3.0/fst/#example-searching-multiple-sets-efficiently |
(That example does a little more than what you're asking, by applying a regex search. But you can just remove that bit.) |
@BurntSushi : I was looking at that, but the regex bit did indeed throw me off. I was looking more closely at |
For example: I don't see a corresponding |
@davidblewett You have to apply the range to each set, e.g., let (set1, set2, set3) = ...;
let mut stream = OpBuilder::new()
.add(set1.range().ge("b").lt("e"))
.add(set2.range().ge("b").lt("e"))
.add(set3.range().ge("b").lt("e"))
.union(); |
Got it. Will fiddle with it. |
@jbaiter : it seems the C interface could be simplified a lot if instead of functions specifically for Are there some sort of safety guarantees in retaining the more specific versions? |
@BurntSushi : I tried in #10 , but hit a probably dumb Rust mistake on my part. |
@BurntSushi would you mind taking a look at #10 ? I'm not sure how to fix that compiler error. |
@davidblewett Ah yup! Apologies. I missed your previous ping. :-) |
I am building an application that generates new FST objects every hour. I would like to be able to do efficient range operations over a group of these FST files. Conceptually, something like combining the
__getitem__
implementation with theOpBuilder
. Basically, returning aKeyStreamIterator
for multipleSet
objects' range operation (pseudo code:The existing API seems cumbersome for doing operations across multiple. You have to pick a (possibly arbitrary) instance, then call
.union
/.intersection
etc with the rest of the objects. Would it be possible to have some sort ofMultiSet
class that could perform efficient calls across multipleSet
objects?I can take a crack at implementing it; it appears the underlying Rust API would support this.
The text was updated successfully, but these errors were encountered: