Class: Wikipedia::VandalismDetection::Features::AllWordlistsFrequency

Inherits:
FrequencyBase
  • Object
show all
Defined in:
lib/wikipedia/vandalism_detection/features/all_wordlists_frequency.rb

Overview

This feature computes frequency of all wordlists words in the inserted text.

Instance Method Summary collapse

Methods inherited from FrequencyBase

#frequency

Methods inherited from Base

#count

Instance Method Details

#calculate(edit) ⇒ Object

Returns the percentage of wordlists 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/all_wordlists_frequency.rb', line 14

def calculate(edit)
  super

  text = Text.new(edit.inserted_words.join("\n")).clean
  frequency(text, WordLists.all)
end