scoder / acora

Fast multi-keyword search engine for text strings
http://pypi.python.org/pypi/acora
BSD 3-Clause "New" or "Revised" License
247 stars 17 forks source link

Implement Mapping : Add a value to each sequence stored in the automaton #8

Open pombredanne opened 8 years ago

pombredanne commented 8 years ago

This would essentially turn this in a dictionary. Most AC implementation do that and this makes Acora a tad hard to use or useless .... Having a simple numeric id returned and assigned to each string added would go a long way.

scoder commented 8 years ago

acora currently stores the keywords as Python string objects, so id() should work on them.

pombredanne commented 8 years ago

Sorry if I was not clear: what I am looking for is for the automaton to behave as a dict-like mapping: for each key, (which in my case may be anywhere between 1 and 60K long) I would like to store the corresponding value.

pombredanne commented 8 years ago

@scoder What I really mean is to make this a dictionary-like. Such that you can get a value from a search and not only the key. In particular when you store long sequences, getting the key back is not useful.