Add:
sentence.gsub!/\W/, ''
just after sentence.downcase!
Also note, that your method has a side effect:
string = 'NeverOddOrEven'
p palindrome?(string) #=> true
p string #=> neveroddoreven
To fix this, change first two lines to:
sentence = sentence.downcase.gsub /\W/, ''