开发者

How to Parse Boolean Search Queries

开发者 https://www.devze.com 2023-02-10 23:08 出处:网络
I need开发者_如何学Python to parse a search query with boolean parameters.For example, if I have the query

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

精彩评论

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