graemefox / esmre

Automatically exported from code.google.com/p/esmre
GNU Lesser General Public License v2.1
1 stars 0 forks source link

No acceleration when using alternation operator #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The Index won't extract hints from expressions that use the | operator. It
would be better if the object was put into the underlying esm index once
for each term in the alternation. Eg. Index().enter(r'red|green|blue',
'primary') would enter 'primary' under 'red', 'green', and 'blue' in the
esm index.

What steps will reproduce the problem?

>>> import esmre
>>> i = esmre.Index()
>>> i.enter(r"egg|bacon|sausage|spam|tomato|baked beans|lobster thermidor",
...         "ingredients")
>>> i.hintless_objects
['ingredients']
>>> 

What is the expected output? What do you see instead?

>>> import esmre
>>> i = esmre.Index()
>>> i.enter(r"egg|bacon|sausage|spam|tomato|baked beans|lobster thermidor",
...         "ingredients")
>>> i.hintless_objects
[]
>>> 

Original issue reported on code.google.com by whar...@gmail.com on 3 Mar 2008 at 5:04