Class: StyleScanner::SentenceScans::Capitalization

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

Constant Summary collapse

ACRONYMS =
load_file("acronyms.txt")
NATIONALITIES =
load_file("nationalities.txt")
MONTHS =
%w(
     january february march april may june july august september october november december 
)
DAYS =
%w(
  monday tuesday wednesday thursday friday saturday sunday
)
SEASONS =
%w(
 Winter
 Summer
 Spring
 Autumn
)

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



20
21
22
23
24
25
26
27
28
29
# File 'lib/style_scanner/sentence_scans/capitalization.rb', line 20

def scan
  flag_lowercase(MONTHS) do |word|
    word == "may" && word.verb?
  end
  flag_lowercase(ACRONYMS)
  flag_lowercase(DAYS)
  flag_lowercase(NATIONALITIES)
  flag_uppercase(SEASONS)
  create_problem(first_letter) if first_letter_is_lowercase?
end