Permalink
Browse files

Support unicode words

  • Loading branch information...
1 parent ebd7b22 commit 424051c6b14fba435c2d15ae7f1dffac743fa425 @HungYuHei HungYuHei committed Feb 4, 2013
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/soulmate/helpers.rb
View
@@ -1,3 +1,5 @@
+# coding: utf-8
+
module Soulmate
module Helpers
@@ -11,8 +13,9 @@ def prefixes_for_phrase(phrase)
end
def normalize(str)
- str.downcase.gsub(/[^a-z0-9 ]/i, '').strip
+ # Letter, number and unicode words (Chinese, Japanese, etc.)
+ str.downcase.gsub(/[^a-z0-9\s\p{word}]/i, '').strip
end
end
-end
+end

0 comments on commit 424051c

Please sign in to comment.