# # Queries as entered by the user with the format as they should be # entered. # # Comments in this file are lines where the first non-whitespace # character is a dash. Empty lines or lines with only whitespace # are ignored. Leading and trailing whitespace characters are # removed before the line is parsed. Also whitespace before and # after the separator is ignored. # # One query per single line of text in this file. # Separate the query and transformed query with the string '-->'. # # Sample: # aaa bbb --> aaa AND bbb # (if the query is 'aaa bbb', it must be transformed into 'aaa AND bbb') # # Replace series of spaces with 'AND': aaa bbb --> aaa AND bbb aaa bbb --> aaa AND bbb # Keep 'AND' and 'OR' intact: aaa AND bbb --> aaa AND bbb aaa AND bbb --> aaa AND bbb aaa AND bbb --> aaa AND bbb aaa OR bbb --> aaa OR bbb # Keep NOT: aaa NOT bbb --> aaa NOT bbb # Trim string within ( AND ): aaa (bbb ccc) --> aaa AND (bbb AND ccc) aaa ( bbb ccc ) --> aaa AND (bbb AND ccc) # Ignore string literals: aaa "bbb ccc" --> aaa AND "bbb ccc" aaa "bbb ccc (ddd OR eee)" --> aaa AND "bbb ccc (ddd OR eee)" # Challenge: aaa AND (bbb OR "ccc (()(" ) --> aaa AND (bbb OR "ccc (()(") # Handle & in queries: mods.relatedItem.titleInfo.title="Ditjes & Datjes" --> mods.relatedItem.titleInfo.title="Ditjes %26 Datjes"