Skip to content
New issue

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

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

Already on GitHub? # to your account

LPM Question #157

Open
davegreeko2023 opened this issue Apr 13, 2023 · 1 comment
Open

LPM Question #157

davegreeko2023 opened this issue Apr 13, 2023 · 1 comment

Comments

@davegreeko2023
Copy link

Hi there, I apologize in advance if I am asking at the wrong place. I have a very large lookup table (this table can be sorted) and I wanted to find the longest prefix match of an input string.

let lookup_table :Vec<(&str,u32,u8)> = vec![("+96171",1001,1),("+9617",1002,2),("+961",1003,3)];

If I have an input string like "+961712345678" I must return ("+96171",1001,1) tuple only. Is this something I can do with fst crate? and if so, an example is very much appreciated.
Regards,
Dave

@Kerollmops
Copy link
Contributor

Hey @dave-greeko,

You can probably look that this PR and copy/paste the code until it is merged.

Have a nice day 💎

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants