开发者

How to Parse Boolean Search Queries

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 , Little

Does anyone have an idea about an algorithm I could use or maybe a library that would help me with that?

Thank you!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜