Class: Wikipedia::VandalismDetection::Features::SizeIncrement

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

Overview

This feature computes the increment of the edit’s revisions text length.

Instance Method Summary collapse

Methods inherited from Base

#count

Instance Method Details

#calculate(edit) ⇒ Object

computation: |new| - |old|



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

def calculate(edit)
  super

  old_size = edit.old_revision.text.size
  new_size = edit.new_revision.text.size

  new_size - old_size
end