The Following code when provided with the Corpora and mis-spelled word. This code takes the corpus that you are planning to use on and at the end based on the words present in the corpora it will make the suggestions.
- Project Gutenberg
- nltk's inbuilt Ngram creator
- re's character match
- nltk's Frequency Distribution table
- nltk's word tokenizer
- punctuations from string
- itemgetter from operator
- islice from itertools
- plot from matplotlib
- To use the IPYNB file First download the IPYNB file along with the project_gutenberg file.
- (NOTE : You can use any corpora, just make sure to change the name of file in the program accordingly.)
- Now if you are using Google colab then you need to upload the IPYNB file and open it where you can then upload the project_gutenberg.txt or whichever text corpora you chose.
- If you happen to be using VSCode or some other IDLE then make sure to change the file directory to the place where you placed your file.
Once all that have been done. That's it you can now run this program to suggest the mis-spelled words correctly by just using the corpora texts.