⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.118
Server IP:
191.101.228.93
Server:
Linux sg-nme-web1518.main-hosting.eu 5.14.0-611.16.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Dec 22 03:40:39 EST 2025 x86_64
Server Software:
LiteSpeed
PHP Version:
8.3.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
opt
/
gsutil
/
third_party
/
pyparsing
/
examples
/
View File Name :
searchParserAppDemo.py
from searchparser import SearchQueryParser products = [ "grape juice", "grape jelly", "orange juice", "orange jujubees", "strawberry jam", "prune juice", "prune butter", "orange marmalade", "grapefruit juice", ] class FruitSearchParser(SearchQueryParser): def GetWord(self, word): return {p for p in products if p.startswith(word + " ")} def GetWordWildcard(self, word): return {p for p in products if p.startswith(word[:-1])} def GetQuotes(self, search_string, tmp_result): result = set() # I have no idea how to use this feature... return result def GetNot(self, not_set): return set(products) - not_set parser = FruitSearchParser() tests = """\ grape or orange grape* not(grape*) prune and grape""".splitlines() for t in tests: print(t.strip()) print(parser.Parse(t)) print("")