I am working on a search engine using Python from scratch which checks if an expression is present or not in the given dataset. The input contains words, brackets and Operators like &(AND), !(NOT) and |(OR)
Examples: Valid -
- Quick & brown (fox | (tall & ox)) --> should search for "quick brown fox" or "quick brown tall ox"
- hot & (air | balloon) --> should search for "hot air" or "hot balloon"
- quick & brown & !fox & ox --> should search for "quick brown ox" and fox should not me part of the result string.
Not Valid -
- Very & Quick | brown & fox --> "|" is ambiguous and hence invalid.