kris-kaspersky / esmre

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

Can't enter expressions after query #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
Changed type to enhancement.

Original comment by whar...@gmail.com on 28 Jan 2008 at 5:48