natural language query parser

To perform a NL query, all you need to do is:
attribute: "myattr" (generally 'contents')
operator: "?="
value: "your NL query"

Natural language queries are very simple:

word word2 word3
will be interpreted as word AND word2 AND word3

word2 or word4
will be interpreted as word2 OR word4

word*
will be interpreted as word* (pattern match)

word near otherword
will be interpreted as word needing to be at most 5 words distance from otherword, word/otherword excluded from the word count distance (or so it seems)

with this you can construct arbitrarily complex queries against all text fields.  Exact matches are supported by the default = operator


AndNode
(
	(
		WordNode(u'gnu'), OrNode
			(
				(
				WordNode(u'lesser'), AndNode
					(
						(
						WordNode(u'general'), AndNode
							(
								(
								WordNode(u'public'),
								SubstringNode
									(
									u'icens'
									)
								)
							)
						)
					)
				)
			)
	)
)