I need开发者_如何学Python to parse a search query with boolean parameters. For example, if I have the query
(Mexico or Peru) and ((Air and Wind) or (Big and Little))
I want to create several sub-queries based on the operators. So, this query will give me the following sub queries
Mexico , Air, Wind
Mexico , Big , Little Peru, Air , Wind Peru, Big , LittleDoes anyone have an idea about an algorithm I could use or maybe a library that would help me with that?
Thank you!
精彩评论