Class: ChatCorrect::Verb
- Inherits:
-
Object
- Object
- ChatCorrect::Verb
- Defined in:
- lib/chat_correct/verb.rb
Instance Attribute Summary collapse
-
#pos ⇒ Object
readonly
Returns the value of attribute pos.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#word ⇒ Object
readonly
Returns the value of attribute word.
Instance Method Summary collapse
-
#initialize(word:, pos:, text:) ⇒ Verb
constructor
A new instance of Verb.
- #verb_error? ⇒ Boolean
Constructor Details
#initialize(word:, pos:, text:) ⇒ Verb
Returns a new instance of Verb.
4 5 6 7 8 9 10 11 12 |
# File 'lib/chat_correct/verb.rb', line 4 def initialize(word:, pos:, text:) if word.eql?('am') || word.eql?('been') || word.eql?('are') || word.eql?('is') || word.eql?('was') || word.eql?('were') @word = 'be' else @word = word end @pos = pos @text = text end |
Instance Attribute Details
#pos ⇒ Object (readonly)
Returns the value of attribute pos.
3 4 5 |
# File 'lib/chat_correct/verb.rb', line 3 def pos @pos end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
3 4 5 |
# File 'lib/chat_correct/verb.rb', line 3 def text @text end |
#word ⇒ Object (readonly)
Returns the value of attribute word.
3 4 5 |
# File 'lib/chat_correct/verb.rb', line 3 def word @word end |
Instance Method Details
#verb_error? ⇒ Boolean
14 15 16 17 18 |
# File 'lib/chat_correct/verb.rb', line 14 def verb_error? !word.eql?('a') && !word.eql?('an') && !word.gsub(/[[:punct:]]/, '').eql?('') && !word.include?('ƪ') && pos.downcase[0].eql?('v') && !word.eql?('to') && check_conjugated_word(word) end |