diff --git a/lib/profanity_filter.rb b/lib/profanity_filter.rb index 6e49a27..1913d88 100644 --- a/lib/profanity_filter.rb +++ b/lib/profanity_filter.rb @@ -82,8 +82,8 @@ def append_dictionary( file ) def remove_from_dictionary( file ) excluded_words = YAML.load_file( file ) if excluded_words - dictionary.keep_if do |dictionary_word| - !( excluded_words.include?(dictionary_word) ) + dictionary.reject! do |dictionary_word| + excluded_words.include? dictionary_word end end end