Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # >>> xapian.version_string()
- # '1.2.5'
- # $ python
- # Python 2.7.2+
- import xapian
- doc = xapian.Document()
- stopper = xapian.SimpleStopper()
- stopper.add('de')
- stopper.add('a')
- gen = xapian.TermGenerator()
- gen.set_document(doc)
- gen.set_stopper(stopper)
- gen.index_text('Atirei o pau no gato de 4 a 8 metros de distancia')
- for t in doc.termlist():
- print t.term
- '''Result:
- 4
- 8
- a
- atirei
- de
- distancia
- gato
- metros
- no
- o
- pau
- '''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement