Or do the opposite of Dominik and save the list of phrases that you want to match, spaces and all. Write them as regular expression strings. For each row in the database (file, sql table, whatever), process the regular expression, find the score.
It depends on how you want to do this trivially: everything is what is common, thereby discovering what is really trending, or search for a phrase. In one case, you will find a lot that may not interest you, and you will need an extensive list of locks - in the other case, you will need a huge whitelist.
To go beyond this, you will need natural language processing tools to determine the meaning of what is said.
user257111
source share