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