Class: Wikipedia::VandalismDetection::Features::CommentVulgarismFrequency
- Inherits:
-
FrequencyBase
- Object
- Base
- FrequencyBase
- Wikipedia::VandalismDetection::Features::CommentVulgarismFrequency
- Defined in:
- lib/wikipedia/vandalism_detection/features/comment_vulgarism_frequency.rb
Overview
This feature computes frequency of vulgarism words in the comment of the edit’s new revision.
Instance Method Summary collapse
-
#calculate(edit) ⇒ Object
Returns the percentage of vulgarism words in the new revision’s comment.
Methods inherited from FrequencyBase
Methods inherited from Base
Instance Method Details
#calculate(edit) ⇒ Object
Returns the percentage of vulgarism 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_vulgarism_frequency.rb', line 13 def calculate(edit) super comment = edit.new_revision.comment.clean frequency(comment, WordLists::VULGARISM) end |