Class: Wikipedia::VandalismDetection::Features::SexImpact

Inherits:
ImpactBase
  • Object
show all
Defined in:
lib/wikipedia/vandalism_detection/features/sex_impact.rb

Overview

This feature computes the percentage by which the edit increases the number of sex words in the text.

Instance Method Summary collapse

Methods inherited from ImpactBase

#impact

Methods inherited from Base

#count

Instance Method Details

#calculate(edit) ⇒ Object



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

def calculate(edit)
  super
  old_text = edit.old_revision.text.clean
  new_text = edit.new_revision.text.clean

  impact(old_text, new_text, WordLists::SEX)
end