Structure
Pickle files contain correct case dependencies in following format:
'verb': {'preposition(optional)': {'case': {'complement': frequency}
for collocations of type verb + noun and noun + noun.
When the program is given a text:
- some case errors are generated by randomly replacing one case in a sentence (the word form is also changed in order to match new, incorrect case)
- new sentences are then parsed with spacy dependency matcher to find all collocations of a certain syntactic dependency type
- by comparing parsed dependencies with corresponding data in pickle files, the number of identified and missed errors is counted, writing the results in a new file.