summaryrefslogtreecommitdiff
path: root/examples/booleansearchparser.py
Commit message (Collapse)AuthorAgeFilesLines
* Fixing Unicode block range in examples/booleansearchparser.py (#342)tc-yu2021-12-151-25/+59
| | | | | * Updated range for unicode blocks, updated add char logic to include last character in each block, update some function names * Test case for CJK block and last character in block
* Fix misc. documentation typos (#280)luzpaz2021-05-141-5/+5
| | | Found via `codespell -q 3 -L ba,fourty,halp,inout,strng`
* Blacken the project (#141)Jon Dufresne2019-10-311-135/+211
|
* Use pyupgrade to upgrade the code to use Python3 conventions (#138)Jon Dufresne2019-10-241-11/+8
| | | | | | | | | | | | The pyupgrade project is available at https://github.com/asottile/pyupgrade and can be installed through pip. The pyupgrade tool automatically upgrades syntax for newer versions of the language. As pyparsing is now Python 3 only, can apply some cleanups and simplifications. Ran the tool using the following command: $ find . -name \*.py -exec pyupgrade --py3-plus {} \; For now, pyparsing.py was skipped while it is refactored to a package.
* Py3 cleanup: Remove workaround from Python3 unichr() (#144)Jon Dufresne2019-10-171-6/+1
| | | On Python3, always use chr().
* Add Py2 compat code at submitter's request; add non-Western test case; more ↵Paul McGuire2019-08-181-98/+109
| | | | helpful message when tests fail; exit with exit code to include with package tests; trim trailing whitespace
* Boolean Search query parser: allows to perform searches with the common ↵xecgr2019-08-131-0/+394
boolean search syntax against a text (#21) * Add files via upload Boolean Search query parser, based on searchparser, that allows to perform searches with the common boolean search syntax against a text (western + non-western alphabets) SAMPLE USAGE: from booleansearchparser import BooleanSearchParser bsp = BooleanSearchParser() text = u"wildcards at the begining of a search term " exprs= [ u"*cards and term", #True u"wild* and term", #True u"not terms", #True u"terms or begin", #False ] for expr in exprs: print bsp.match(text,expr) #non-western samples text = u"안녕하세요, 당신은 어떠세요?" exprs= [ u"*신은 and 어떠세요", #True u"not 당신은", #False u"당신 or 당", #False ] for expr in exprs: print bsp.match(text,expr) * from __future__ import print_function and changing this over to be Python 2/3 compatible * ptmcg conversation issues