MarkBaker / Tries

Trie and RadixTrie Datastructure Implementations in PHP, with a couple of working examples showing their use
MIT License
21 stars 4 forks source link

Experimenting with it, need some heads up #6

Open rvencu opened 4 years ago

rvencu commented 4 years ago

Hi, I have this problem at hand: given a text that is stripped of punctuation, basically a long series of words separated by spaces, I need to identify all items present in the trie, with the longest ones starting first.

As an example: if in trie I entered these terms 1 lorem ipsum dolor 2 lorem ipsum 3 dolor

If my text contains 'lorem ipsum dolor' I would like to confirm key 1 as a match and ignore 2 and 3. I need to extract this way all possible matched against the given trie.

I would appreciate a little heads up, maybe some relevant docs about how to manipulate these objects towards my goal.