lib/virastar.rb in virastar-0.0.5 vs lib/virastar.rb in virastar-0.0.6
- old
+ new
@@ -66,10 +66,10 @@
text.tr!(english_numbers,persian_numbers) if @fix_english_numbers
text.tr!(arabic_numbers,persian_numbers) if @fix_arabic_numbers
text.tr!(bad_chars,good_chars) if @fix_misc_non_persian_chars
# should not replace exnglish chars in english phrases
- text.gsub!(/([a-z\-_]+[۰-۹]+|[۰-۹]+[a-z\-_]+)/i) do |s|
+ text.gsub!(/([a-z\-_]{2,}[۰-۹]+|[۰-۹]+[a-z\-_]{2,})/i) do |s|
s.tr(persian_numbers,english_numbers)
end
# put zwnj between word and prefix (mi* nemi*)
# there's a possible bug here: می and نمی could be separate nouns and not prefix
\ No newline at end of file