Last active
August 29, 2015 14:03
-
-
Save zopyx/30de75cf3ae46110653e to your computer and use it in GitHub Desktop.
prefix matching lexicon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> lexicon = app.eteaching.portal_catalog.plone_lexicon | |
>>> words = lexicon.words() | |
>>> result = [w for w in words if w.startswith('foerd')] | |
>>> print result | |
['foerderbedingungen', 'foerderinstitutionen', 'foerdern', 'foerderpgm', 'foerderphasen', 'foerderprogramm', 'foerderprogramme', 'foerderprogrammen', 'foerderprojekte', 'foerderung', 'foerderung_uebersicht', 'foerderungen', 'foerderungsprogramm', 'foerderverein'] | |
# | |
ODER | |
>>> lexicon.globToWordIds('foerd*') | |
[54911476, 54913403, 54921693, 54910745, 54879248, 54909358, 54879428, 54878516, 54925856, 54909333, 54913416, 54879648, 54878821, 54913251] | |
>>> for wid in lexicon.globToWordIds('foerd*'): print lexicon.get_word(wid) | |
... | |
foerderbedingungen | |
foerderinstitutionen | |
foerdern | |
foerderpgm | |
foerderphasen | |
foerderprogramm | |
foerderprogramme | |
foerderprogrammen | |
foerderprojekte | |
foerderung | |
foerderung_uebersicht | |
foerderungen | |
foerderungsprogramm | |
foerderverein |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment