A
Казалось бы, что может быть проще?
keywords = all_words.select { |word| !stop_words.include?(word) }
И тут... а что руби не понимает Unicode?! И текст и список слов по-украински.
Size: a a a
A
keywords = all_words.select { |word| !stop_words.include?(word) }
IA
A
VK
keywords = all_words.select { |word| !stop_words.include?(word) }
ВА
keywords = all_words.select { |word| !stop_words.include?(word) }
mb_chars
A
A
М
r
A
A
A
text.scan(/\p{Word}+/)и подобное
VK
A
VK
A
VK
A
HM