Class: Wikipedia::VandalismDetection::Features::SexFrequency
- Inherits:
-
FrequencyBase
- Object
- Base
- FrequencyBase
- Wikipedia::VandalismDetection::Features::SexFrequency
- Defined in:
- lib/wikipedia/vandalism_detection/features/sex_frequency.rb
Overview
This feature computes frequency of bad words in the inserted text.
Instance Method Summary collapse
-
#calculate(edit) ⇒ Object
Returns the percentage of biased words in the inserted text.
Methods inherited from FrequencyBase
Methods inherited from Base
Instance Method Details
#calculate(edit) ⇒ Object
Returns the percentage of biased words in the inserted text. Returns 0.0 if inserted clean text is of zero length.
14 15 16 17 18 19 |
# File 'lib/wikipedia/vandalism_detection/features/sex_frequency.rb', line 14 def calculate(edit) super text = Text.new(edit.inserted_words.join("\n")).clean frequency(text, WordLists::SEX) end |