Class: Wikipedia::VandalismDetection::Features::RemovedSize

Inherits:
Base
  • Object
show all
Defined in:
lib/wikipedia/vandalism_detection/features/removed_size.rb

Overview

This feature computes the size of removed text in the edit’s new revision.

Instance Method Summary collapse

Methods inherited from Base

#count

Instance Method Details

#calculate(edit) ⇒ Object

Returns the size of removed character in the new revision.



11
12
13
14
15
16
# File 'lib/wikipedia/vandalism_detection/features/removed_size.rb', line 11

def calculate(edit)
  super

  size = edit.removed_text.size
  size >= 0 ? size : 0
end