React if user's text changes in existing node are major I would like to ask about some ideas about following issue:
I have a content type - answer, that can be created and edited (not deleted) by users. From time to time, for any reason an user can delete all text inside node, thus completely destroying it.

I do not want to be informed about every subtle change in node, but I certainly want to be alerted and possibly approve, if there is a major change in node's content. 
So the requirements are:


detect negative change + restrict user to publish changes + alert admin for approval



Solutions?:
1) Count words in node and compare it to word count in node's revision. The word count may be saved inside a field in node and after compared by rules. 

2) As suggested by @T-34, use custom module 
I found some modules but none of them gives the ability to figure out the difference percentage and use it with rules:
https://drupal.org/project/diff
https://drupal.org/project/rules_diff
https://drupal.org/project/trevi - suggested by @T-34 gives me an error + it seem s to work only on node edit page.
Thank you for ideas.
I would use Diff and implement hook_entity_diff() (see diff.api.php), which allows modules to provide a comparison about entity properties.

Here you go:

function MYMODULE_entity_diff($old_entity, $new_entity, $context) {
  if ($context['entity_type'] == 'node') {
    $old_body = $old_entity-&gt;body[LANGUAGE_NONE][0]['value'];
    $new_body = $new_entity-&gt;body[LANGUAGE_NONE][0]['value'];
    $matching = similar_text($old_body, $new_body, $percent);
    $results['line'] = array(
      '#name' =&gt; t('Body'),
      '#old' =&gt; 'Number of matching chars: ' . $matching,
      '#new' =&gt; 'Percentage difference: ' . $percent,
    );
    return $results;
  }
}