kerighan / eldar

Boolean text search in Python
MIT License
44 stars 8 forks source link

local variable 'right_part' referenced before assignment #18

Closed ecsquare closed 2 years ago

ecsquare commented 2 years ago

Traceback: File "C:\Users\guest\eldar\query.py", line 19, in init self.query = parse_query(query, ignore_case, ignore_accent) File "C:\Users\emrec\PycharmProjects\nested_keyword_match\eldar\query.py", line 90, in parse_query parse_query(right_part, ignore_case, ignore_accent) UnboundLocalError: local variable 'right_part' referenced before assignment

A priori verification of the query is required + removal of extra space (if there are space decomposing the query does not work expectedly)

kerighan commented 2 years ago

could you provide an example with this error please

ecsquare commented 2 years ago

could you provide an example of this error, please

It happens when the user passes an unbalanced query or a query that contains white space Example: "cat AND dog" || "(cat OR dog" it would be a nice addition if an evaluation method is added before the search