Class: Wikipedia::VandalismDetection::Features::InsertedExternalLinks
- Defined in:
- lib/wikipedia/vandalism_detection/features/inserted_external_links.rb
Overview
This feature computes the number of inserted external links [example.com].
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#calculate(edit) ⇒ Object
10 11 12 13 14 |
# File 'lib/wikipedia/vandalism_detection/features/inserted_external_links.rb', line 10 def calculate(edit) super edit.inserted_text.scan(/\[?(https?|ftp)\s?:\s?\/\/[^\s\/$.?#].[^\s]*]?/i).count end |