I want to make a text scanner for similar words in PHP, but I do not know where to begin. The scanner will have to scan a paragraph and point out matches that are found in a Database or propose specific words that will assist in making this paragraph better.
I thought at first that I could use a database and a search engine script but I have been told that this is not the way to do it.
Can someone please point me to the right direction so I can start working on this?
I just post another answer because my first one was wrong after the OP comment and it had too many comments.
First you need to extrapolate every single word from your paragraph, using for example:
Then you need to remove special characters, slashes, points, commas etc. (maybe using str_replace()).
In the second step you need to build a Database of synonyms like this:
Then do something like (for each word of your paragraph):
And after this you can fetch the results.
But this is only the start. You NEED to optimize this method. Example: you can do that when you search vehicle it returns car. The same for transport. That’s up to you!