I need MySQL code to check the percentage of similarity between the text submitted through the form, on several texts stored in the MySQL database.
I am looking for a MySQL stored procedure that will work as a PHP function similar_text(). There is already a MySQL Levenshtein distance procedure, but this is not enough.
When a user sends text, the algorithm should return any record in the database with a given percentage of similarity with the submitted text (it will compare only one column in the database), for example, return all records from the database that have similarity> 40% to text, submitted by the user.
For example, a table
TABLE - Articles
id, article_body, article_title
The code should return all lines that have a similarity percentage> 40% (or other given value) with the text (article_body) that the user sent.
source
share