I’m working on a project to convert a natural language query like this:
bright red AND green AND “black and blue” NOT “orange”
to syntax I can use with mdfind. It’s not trivial, because one has to distinguish between the words and/or/not and their logical operator counterparts, and preserve quoted text as strings.
As I’m slogging along, I wonder if anyone else has solved parsing problems like this (or if there is some neat shortcut in OS X).