virastar 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/virastar.rb CHANGED
@@ -68,7 +68,7 @@ module Virastar
68
68
  text.tr!(bad_chars,good_chars) if @fix_misc_non_persian_chars
69
69
 
70
70
  # should not replace exnglish chars in english phrases
71
- text.gsub!(/([a-z\-_]+[۰-۹]+|[۰-۹]+[a-z\-_]+)/i) do |s|
71
+ text.gsub!(/([a-z\-_]{2,}[۰-۹]+|[۰-۹]+[a-z\-_]{2,})/i) do |s|
72
72
  s.tr(persian_numbers,english_numbers)
73
73
  end
74
74
 
@@ -1,3 +1,3 @@
1
1
  module Virastar
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -207,13 +207,19 @@ describe Virastar do
207
207
  result = "salam «khoobi» \nchetori"
208
208
  test.persian_cleanup.should == result
209
209
  end
210
-
210
+
211
211
  it "should not put space after quotes, {}, () or [] if there's ,.; just after that" do
212
212
  test = "«This», {this}, (this), [this] or {this}. sometimes (this)."
213
213
  result = "«This»، {this}، (this)، [this] or {this}. sometimes (this)."
214
214
  test.persian_cleanup.should == result
215
215
  end
216
216
 
217
+ it "should be able to convert numbers with dashes" do
218
+ test = "1- salam"
219
+ result = "۱- salam"
220
+ test.persian_cleanup.should == result
221
+ end
222
+
217
223
  context "aggressive editing" do
218
224
  it "should replace more than one ! or ? mark with just one" do
219
225
  test = "salam!!!"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: virastar
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 6
10
+ version: 0.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Allen A. Bargi