Class: Wikipedia::VandalismDetection::Features::InsertedInternalLinks

Inherits:
Base
  • Object
show all
Defined in:
lib/wikipedia/vandalism_detection/features/inserted_internal_links.rb

Overview

This feature computes the number of inserted internal links [[link]].

Instance Method Summary collapse

Methods inherited from Base

#count

Instance Method Details

#calculate(edit) ⇒ Object



10
11
12
13
14
# File 'lib/wikipedia/vandalism_detection/features/inserted_internal_links.rb', line 10

def calculate(edit)
  super

  edit.inserted_text.scan(/\[{2}([^\[].*?)\]{2}/).count
end