banktools-se 2.6.1 → 2.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 712182deb34f3bb523bcff183c6f1da1e52edef1
4
- data.tar.gz: 7389dec63980fe96be8038c107f77c4ecd649af2
3
+ metadata.gz: b894da43f509502745e6968c8f9d3480d2d72b59
4
+ data.tar.gz: 47544abc5aff3ab18721b38b81747d8981e2da62
5
5
  SHA512:
6
- metadata.gz: 7a7ba550cbe25215efac31d9d256e73bd638a849c31d6f07c8d6860b6d66b8b12d8caf023f0febce692b0bb68a259f22445a7ee5e66d886b85cdc9432880c209
7
- data.tar.gz: 015fba8428f7c1d242c83265e992e33a274378404a9259886f6dfd58445c949c3ec11df30eb2d0f4168fa0f83ed22958952b6ec1e8e723ec276b80c84f25294d
6
+ metadata.gz: 25446e83d4ef271b3a315f42e888913041ec04978cc8167924487e5f621cfe93f9754fbf7a6554eb29aa48c5c12918932b16ecc3728bd1a1608e49d2b967bc70
7
+ data.tar.gz: 3a24188bd9119006d3896dd9463148fce4ec43fbf60c4d570396e320dd5fec4944068fa9ca40f0c14d59d53ea662db0250b0282cd46250b08930984ee9205449
@@ -73,7 +73,7 @@ module BankTools
73
73
 
74
74
  candidates = []
75
75
 
76
- # Then find all substrings of min_length, and of all other lengths, up to max_length.
76
+ # Then find all substrings ("n-grams") of min_length, and of all other lengths, up to max_length.
77
77
  # So e.g. find all four-digit substrings ("1234", "2345", …), all five-digit substrings and so on.
78
78
 
79
79
  0.upto(digit_string.length - min_length) do |start_pos|
@@ -85,6 +85,8 @@ module BankTools
85
85
  end
86
86
  end
87
87
 
88
+ candidates.uniq!
89
+
88
90
  # Finally, limit these substrings to ones that are actually valid OCRs.
89
91
 
90
92
  candidates.select { |candidate|
@@ -94,21 +96,7 @@ module BankTools
94
96
  rescue InvalidOCR
95
97
  false
96
98
  end
97
- }.uniq
98
- end
99
-
100
- private
101
-
102
- private_class_method \
103
- def self.with_numbers_found_by_removing_prefix_and_postfix(numbers)
104
- numbers + numbers.flat_map { |number|
105
- 0.upto(number.size).flat_map { |i|
106
- [
107
- number[0...i],
108
- number[i...number.size],
109
- ]
110
- }
111
- }
99
+ }
112
100
  end
113
101
  end
114
102
  end
@@ -1,5 +1,5 @@
1
1
  module BankTools
2
2
  module SE
3
- VERSION = "2.6.1"
3
+ VERSION = "2.6.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: banktools-se
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.1
4
+ version: 2.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henrik Nyh