We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a3002b4 commit 15aa2cfCopy full SHA for 15aa2cf
lib/eliza/sentence.rb
@@ -7,7 +7,7 @@ def initialize(text)
7
end
8
9
def quit?
10
- data.quit_words.find{|quit_word| text.include? quit_word }
+ data.quit_words.find{|quit_word| text[/\b#{quit_word}\b/] }
11
12
13
def transform
spec/eliza/sentence_spec.rb
@@ -65,5 +65,10 @@
65
let(:text) { 'Bye! its been good talking to you.' }
66
it { should match /Goodbye/ }
67
68
+
69
+ context 'when the quit word is part of another word' do
70
+ let(:text) { 'I liked rockabye baby' }
71
+ it { should_not match /Goodbye/ }
72
+ end
73
74
0 commit comments