Class: ChatCorrect::CommonVerbMistake

Inherits:
Object
  • Object
show all
Defined in:
lib/chat_correct/common_verb_mistake.rb

Constant Summary collapse

COMMON_VERB_MISTAKES =
{ "flied" => "flew",
  "weared" => "wore",
  "finded" => "found",
  "fighted" => "fought",
  "clinged" => "clung",
  "bleeded" => "bled",
  "bringed" => "brought",
  "catched" => "caught",
  "cutted" => "cut",
  "feeled" => "felt",
  "drived" => "drove",
  "falled" => "fell",
  "forgetted" => "forgot",
  "freezed" => "froze",
  "gived" => "gave",
  "heared" => "heard",
  "hurted" => "hurt",
  "keeped" => "kept",
  "knowed" => "knew",
  "leaved" => "left",
  "losed" => "lost",
  "meaned" => "meant",
  "quited" => "quit",
  "quitted" => "quit",
  "ridded" => "rode",
  "runned" => "ran",
  "rised" => "rose",
  "seed" => "saw",
  "singed" => "sang",
  "sitted" => "sat",
  "sited" => "sat",
  "speaked" => "spoke",
  "standed" => "stood",
  "sweared" => "swore",
  "swimmed" => "swam",
  "thinked" => "thought",
  "telled" => "told",
  "taked" => "took",
  "stringed" => "strung",
  "teached" => "taught",
  "waked" => "woke",
  "weeped" => "wept",
  "winned" => "won",
  "writed" => "wrote",
  "weaved" => "wove",
  "gots" => "have"
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token_a:, token_b:) ⇒ CommonVerbMistake

Returns a new instance of CommonVerbMistake.



52
53
54
55
# File 'lib/chat_correct/common_verb_mistake.rb', line 52

def initialize(token_a:, token_b:)
  @token_a = token_a
  @token_b = token_b
end

Instance Attribute Details

#token_aObject (readonly)

Returns the value of attribute token_a.



51
52
53
# File 'lib/chat_correct/common_verb_mistake.rb', line 51

def token_a
  @token_a
end

#token_bObject (readonly)

Returns the value of attribute token_b.



51
52
53
# File 'lib/chat_correct/common_verb_mistake.rb', line 51

def token_b
  @token_b
end

Instance Method Details

#exists?Boolean

Returns:

  • (Boolean)


57
58
59
60
# File 'lib/chat_correct/common_verb_mistake.rb', line 57

def exists?
  COMMON_VERB_MISTAKES[token_a].eql?(token_b) ||
  COMMON_VERB_MISTAKES[token_b].eql?(token_a)
end