Class: StyleScanner::SentenceScans::Cliche

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

Constant Summary collapse

STEMMED_CLICHES =
load_file("stemmed_cliches.txt")
CLICHES =
load_file("cliches.txt")

Instance Attribute Summary

Attributes inherited from Base

#sentence

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize, load_file, scan

Constructor Details

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

Class Method Details

.stemmed_clichesObject

used for generating new cliches. see generate_stemmed_cliches.rb



17
18
19
20
21
# File 'lib/style_scanner/sentence_scans/cliche.rb', line 17

def stemmed_cliches
  CLICHES.map do |cliche| 
    cliche.stem_verbs
  end
end

Instance Method Details

#scanObject



8
9
10
11
12
# File 'lib/style_scanner/sentence_scans/cliche.rb', line 8

def scan
  STEMMED_CLICHES.each.with_index do |cliche, index|
    create_problem(CLICHES[index]) if sentence.contains?(cliche, :stem_verbs => true)
  end
end