I'm looking for suffix tree implementation having this friendly API that mimics python dictionary:
import SubstringDict
d = SubstringDict.SubstringDict()
d['foobar'] = 1
d['barfoo'] = 2
d['forget'] = 3
d['arfbag'] = 4
d['a']
>>> [1, 2, 4]
d['arf']
>>> [2, 4]
d['oo']
>>> [1, 2]
d['food']
>>> []
I took this example from this website: Suffix Trees in Python You may ask: "Why don't you use the implementation from the website?" Well, apparently it has some memory leaks in python bindings so I can't using it with my large (1.2 million strings, about 200 MB) data set.
I would be even happy with C++ implementation (I can write python bindings on my own) with the following API:
SuffixTree<int> sf = SuffixTrie<int>();
sf['foobar'] = 1;
sf['barfoo'] = 2;
sf['forget'] = 3;
assetTrue(sf.find('a')==std::vector<int>({1,2}))
Any hints?