# NLP grouping word categories

Suppose I have a dictionary:

{apple:large apple, apple:red apple, apple:aple, orange:mandarin, orange:orang, orange:blood orange}


and so on...

And then I want to replace a large document of entries with the keys. However, occasionally a new value will come up, i.e. {apple:green apple}

Is there a method where I can replace all values with the corresponding key, but then also replace 'close' values like the one given if they appear?

Example document:

var1
_____
aple
apple
orange
Apple
Red apple
gren Apple
blood Orange
orang

var1_replaced
______________
apple
apple
orange
apple
apple
apple
orange
orange

• Yes there is. Plz just clarify what "replace all values with the corresponding key" means? Can u update with a concrete example of input-output? – Kasra Manshaei Feb 27 '18 at 19:20
• @KasraManshaei yes, like the example I added above – jchaykow Feb 27 '18 at 21:21