Its a bit vague, I am not sure what this is being called technically.
But basically I have a word called "text field", which a user can enter as "textfield", "Text Field" etc. So I should be able to find out what he is entering.
But I list of words that the user will enter is fixed but the combinations are something I am not sure how to sort out.
The application is in node.js and angular. There is no database and I am just using plain json files for data storage.
Shreyansh Pandey
node, coffee and everything in between
Hey!
That's something we call fuzzy string matching and is based on fuzzy logic (hehe). One approach is to take the string, strip all of the special characters, whitespaces and then match it with something from you database. Simple, easy, effective. The problem with this method, however, is that as the data grows, the time complexity will increase by
nfor n number of records. I wouldn't really recommend this if you have unsorted records.If you have sorted, this, along with binary search should do the trick.
The mantra here is to normalise the text to its base form: something universal. Like:
Should all come to:
hello.Feel free to ask more; I am happy to help! :)