Class: StyleScanner::SentenceScans::InappropriateContraction

Inherits:
Base
  • Object
show all
Defined in:
lib/style_scanner/sentence_scans/inappropriate_contraction.rb

Constant Summary collapse

WORD_PAIRS =
{"don't" => "do not", "can't" => 'cannot',
"won't" => "will not", "shan't" => "shall not", 
"hasn't" => "has not", "i'm" => "I am", "he'll" => "he will",
"she'll" => "she will", "didn't" => "did not",
"shouldn't" => "should not", "could've" => "could have",
"they'll" => "they will", "we'll" => "we will"}

Instance Attribute Summary

Attributes inherited from Base

#sentence

Instance Method Summary collapse

Methods inherited from Base

#initialize, load_file, scan

Constructor Details

This class inherits a constructor from StyleScanner::SentenceScans::Base

Instance Method Details

#scanObject



12
13
14
15
16
# File 'lib/style_scanner/sentence_scans/inappropriate_contraction.rb', line 12

def scan
  WORD_PAIRS.keys.each do |offender|
    create_problem(replacement_word(offender)) if sentence.contains?(offender)
  end
end