gkunter / coquery

Coquery is a free corpus query tool for linguists, lexicographers, translators, and anybody who wishes to search and analyse a text corpus.
GNU General Public License v3.0
18 stars 4 forks source link

Query strings with spaces can fail #249

Closed gkunter closed 7 years ago

gkunter commented 7 years ago

Reading malformed query strings with internal spaces from an input file fails.

Test case: COCA, output column Lemma, a file that has #constitute .[v*] in the query column as input. The query fails with an AttributeError:

Type AttributeError
Message 'TokenQuery' object has no attribute '_current_number_of_tokens'

 classes.py, line 83: run
   session.py, line 269: run_queries
     queries.py, line 331: insert_static_data
     > df["coquery_invisible_number_of_tokens"] = self._current_number_of_tokens
gkunter commented 7 years ago

Malformed query strings like this now raise a TokenParseError that is handled gracefully by the program.