Class: Wikipedia::VandalismDetection::Features::CommentPronounFrequency

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

Overview

This feature computes the frequency of pronouns in the comment of the new revision.

Instance Method Summary collapse

Methods inherited from FrequencyBase

#frequency

Methods inherited from Base

#count

Instance Method Details

#calculate(edit) ⇒ Object

Returns the percentage of pronoun words in the new revision’s comment. Returns 0.0 if text is of zero length.



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

def calculate(edit)
  super

  comment = edit.new_revision.comment.clean
  frequency(comment, WordLists::PRONOUNS)
end