When I try to add a new expression to an esmre index, I get an exception:
>>> import esmre
>>> index = esmre.Index()
>>> index.enter("spam", "spam")
>>> index.query("100 tonnes of spam")
['spam']
>>> index.enter("eggs", "eggs")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/e
smre.py",
line 140, in enter
raise TypeError, "enter() cannot be called after query()"
TypeError: enter() cannot be called after query()
>>>
I'd like to be able to add expressions after I've queried:
>>> import esmre
>>> index = esmre.Index()
>>> index.enter("spam", "spam")
>>> index.query("100 tonnes of spam")
['spam']
>>> index.enter("eggs", "eggs")
>>> index.query("Spam, spam, spam, eggs, and spam")
['spam', 'spam', 'spam', 'eggs', 'spam']
>>>
Original issue reported on code.google.com by whar...@gmail.com on 28 Jan 2008 at 2:34
Original issue reported on code.google.com by
whar...@gmail.com
on 28 Jan 2008 at 2:34