This project is a text editor with all the features like spelling check, auto-complete, text generation and spelling suggestion.
A few other features have also been added to this project. It can calculate the Flesch score, Markov text generation model has been added, and word paths(game - described at the end of the document) have also been implemented.
Benchmarking is used for performance analysis of different implementations.
(Opens in Youtube)
The number of words, number of sentences and number of syllables are calculated using Lists. This process is then made efficient by storing all the details in instance variables in Efficientdocument in one pass instead of calculating it in every call to the Flesch score.
Linked List is implemented from scratch with all the methods and tests.
Markov Text Generation is implemented using a linked list(Java Collections framework). An inner class stores a word and all the words following it.
Spell checking is implemented using linked lists and BST. Dictionaries are implemented to store all the words in the text using linked lists and BST. Written text is checked against these dictionaries for spell-checking.
AutoComplete is implemented using the Trie data structure. BFS is used to generate all the completions. Autocomplete can distinguish between upper case and lower case letters; the words generated will be different based on the case of the letters.
Spelling Suggestion is implemented using a linked list and BFS algorithm. Spelling suggestions are based on string mutations of the original word. A threshold of 1000 words is enforced to look for spelling suggestions so as not to deviate too far from the original word.
Some aspects of the project are implemented in different ways, and performance is measured with the help of benchmarking.
Flesch score is calculated in two different ways and is benchmarked for performance analysis. Results are plotted and shown below.
Spell checking is implemented in two different ways and is then benchmarked for performance analysis. Results are plotted and shown below.
Flesch Sore is implemented, which determines how readable the text is! Flesch score is calculated using the following formula
It is a game where we'll try to find a path from one word to another with the restriction that we can only make one change at a time (letter permutation, letter insertion, letter deletion) and that whatever change we make has to result in a real word.
For example, I can create a path from the word "time" to "theme" through 4 changes (or 5 total words including "time" and "theme"):
time -> tie -> tee -> thee -> theme
The changes below you'll recognise from spelling suggestions:
time -> tie results from a character deletion (m)
tie -> tee results from a character modification (i to e)
tee -> thee results from a character addition (e)
thee -> theme results from a character addition (m)
document.Document.java
document.BasicDocument.java
document.EfficientDocument.java
textgen.MyLinkedList*.java
textgen.MarkovTextGenerator.java
textgen.MarkovTextGenerator*.java
spelling.SpellingSuggest.java
spelling.AutoComplete.java
spelling.Dictionary.java
spelling.Dictionary*.java
spelling.AutoCompleteDictionaryTrie.java
spelling.TrieNode.java
spelling.WordPath.java
spelling.NearbyWords.java
spelling.WPTree.java
This is the course project for Course 2 in the Java Programming: Object-Oriented Design of Data Structures Specialization
Starter Code and GUI Application for has been provided along with grading previews and testing files to be used in completing the course programming assignments.