Class: Wikipedia::VandalismDetection::Features::WordsIncrement

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

Overview

This feature computes the increment of the edit’s revisions words.

Instance Method Summary collapse

Methods inherited from Base

#count

Instance Method Details

#calculate(edit) ⇒ Object

computation: |inserted| - |removed|



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

def calculate(edit)
  super

  inserted_count = edit.inserted_words.count
  removed_count = edit.removed_words.count

  inserted_count - removed_count
end