Homework3
Misused Homophone Correction
Approach used:
Based on natural language parsing to work out the grammatical structure of sentences. Used the PCFG (Probabilistic Context Free Grammar) to produce the most likely grammatical structure of new sentences.
Used Stanford NLP parser (JAVA) licensed under the GNU General Public License (v2 or later) for generating the parse tree for the sentences. Given a sentence, identify the presence of the one/any of the misused homophones: it's vs its to vs too lose vs loose they're vs their you're vs your
If a sentence contains any homophone from the above list , new sentences are generated by replacing the homophone with the word it is confused with. Each of the newly generated sentences is parsed using the Stanford NLP parser and the tree obtained is assigned a score. The tree with the higher score is the most likely grammatical structure for the sentence and hence this sentence is chosen as the corrected sentence.
Steps to compile:
1.javac -classpath