5
I’m using PHP in an application I’m developing, where I have a text editor.
In this text editor, with each change made, before saving, I create a record with the original data (i.e., how they are before the change is completed).
In addition, I now have a demand where I need to calculate the percentage of text changes, as well as find out which excerpt each user edited.
I think I’m halfway through knowing every snippet edited through that question: Compare php texts
But I need to know: Is there any way to calculate the percentage difference (or similarity) between two PHP texts?
How can I do that?
A doubt, you record this 'original' text somewhere? Because if you save in a column in a table, when edited, you would save in another column, then you could make the comparison between both texts.
– Willian Lima
No. I use the Laravel framework. In this, it is possible to create polymorphic relationships. So I do this using a table called
registro_atividades
, where save in formatJSON
all data in that table. That is, for each change, I create a record of that text in another table.– Wallace Maxters
Much more or less related https://answall.com/q/1828/101
– Maniero
I have a PL/SQL function that calculates the similarity between two texts. Want to translate it?
– Reginaldo Rigo
Send to bro @Reginaldorigo
– Wallace Maxters