Bug Fixes, Minor Changes and Improvements #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes are as follows (also briefly explained in commit messages, review commit history):
--- BUG FIXES ---
-> There was a bug where if the first word of the text was incorrect, program would not detect it. Now, it is fixed.
-> Program now reports less false positives, for example now it doesn't report the word "kar" in the word "Ankara". Namely, it doesn't report false positives when the substring (in this example, "kar") is not in the beginning of the word (ex. anKARa would not be reported after changes.). It still finds and reports the word "yar" in "yardımlaşma" though. The aforementioned proved to be an extremely difficult problem for me. This also effects the case of "ziyankar" which previously was reported by "kar" and due to how "__word_in_text" was constructed, it would produce the context "...kar blah blah...". Now the word "ziyankar" does not get reported by "kar" and proper context gets constructed and subsequently shown to the user.
-> Also fixed bug where if the words "yar" and "yardımlaşma" simultaneously exist in a text, fixing "yar" would produce "yârdımlaşma". Now it asks for each and every single occurance. To get intended results, the function "change_wrong_results" was significantly altered and changes were made to "__word_in_text" in order to insure intended behaviour. The functionality of these functions was not changed, but the internal working was changed.
-> Fixed bug where "yar" would get detected but not "Yar". Wrote a script to include uppercase letters in "wrong_words.txt" and "correct_words.txt".
--- STYLISTIC AND OTHER MINOR CHANGES ---
-> Added type hinting to methods as well as init variables.
-> Slightly altered the way that "correct_words.txt" and "wrong_words.txt" is read.
-> Made output more readable by introducing some new lines.
-> Added a print statement to the function "exit" informing the user about the existence of Booldum_Metin.txt.
More testing has to be done, what I have tested is most likely not enough but I tried my best to test my code versus some edge cases.
It is also possible that I forgot to mention some changes, but I tried to be as thorough as possible.