phonelib 0.4.6 → 0.4.7

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.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/data/extended_data.dat +0 -0
  3. data/data/libphonenumber/README.md +1 -1
  4. data/data/libphonenumber/cpp/src/phonenumbers/lite_metadata.cc +9342 -9356
  5. data/data/libphonenumber/cpp/src/phonenumbers/metadata.cc +9917 -9931
  6. data/data/libphonenumber/cpp/src/phonenumbers/phonenumberutil.cc +3 -3
  7. data/data/libphonenumber/cpp/src/phonenumbers/short_metadata.cc +2366 -2365
  8. data/data/libphonenumber/java/carrier/pom.xml +4 -4
  9. data/data/libphonenumber/java/carrier/src/com/google/i18n/phonenumbers/carrier/data/1246_en +0 -0
  10. data/data/libphonenumber/java/carrier/src/com/google/i18n/phonenumbers/carrier/data/248_en +0 -0
  11. data/data/libphonenumber/java/carrier/src/com/google/i18n/phonenumbers/carrier/data/373_en +0 -0
  12. data/data/libphonenumber/java/carrier/src/com/google/i18n/phonenumbers/carrier/data/60_en +0 -0
  13. data/data/libphonenumber/java/carrier/src/com/google/i18n/phonenumbers/carrier/data/63_en +0 -0
  14. data/data/libphonenumber/java/carrier/src/com/google/i18n/phonenumbers/carrier/data/92_en +0 -0
  15. data/data/libphonenumber/java/carrier/src/com/google/i18n/phonenumbers/carrier/data/94_en +0 -0
  16. data/data/libphonenumber/java/carrier/src/com/google/i18n/phonenumbers/carrier/data/95_en +0 -0
  17. data/data/libphonenumber/java/carrier/src/com/google/i18n/phonenumbers/carrier/data/960_en +0 -0
  18. data/data/libphonenumber/java/carrier/src/com/google/i18n/phonenumbers/carrier/data/972_en +0 -0
  19. data/data/libphonenumber/java/demo/pom.xml +5 -5
  20. data/data/libphonenumber/java/geocoder/pom.xml +4 -4
  21. data/data/libphonenumber/java/internal/prefixmapper/pom.xml +3 -3
  22. data/data/libphonenumber/java/libphonenumber/pom.xml +2 -2
  23. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java +2 -3
  24. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BB +0 -0
  25. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_BR +0 -0
  26. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_CR +0 -0
  27. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_ID +0 -0
  28. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_IL +0 -0
  29. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_JO +0 -0
  30. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_KW +0 -0
  31. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_LK +0 -0
  32. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_LU +0 -0
  33. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MD +0 -0
  34. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MM +0 -0
  35. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MV +0 -0
  36. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_MY +0 -0
  37. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PH +0 -0
  38. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_PK +0 -0
  39. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SC +0 -0
  40. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/PhoneNumberMetadataProto_SE +0 -0
  41. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/ShortNumberMetadataProto_BE +0 -0
  42. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/ShortNumberMetadataProto_LK +0 -0
  43. data/data/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/data/ShortNumberMetadataProto_US +0 -0
  44. data/data/libphonenumber/java/pom.xml +1 -1
  45. data/data/libphonenumber/java/release_notes.txt +8 -0
  46. data/data/libphonenumber/javascript/i18n/phonenumbers/demo-compiled.js +67 -67
  47. data/data/libphonenumber/javascript/i18n/phonenumbers/metadata.js +25 -25
  48. data/data/libphonenumber/javascript/i18n/phonenumbers/metadatalite.js +25 -25
  49. data/data/libphonenumber/resources/PhoneNumberMetadata.xml +67 -80
  50. data/data/libphonenumber/resources/ShortNumberMetadata.xml +6 -4
  51. data/data/libphonenumber/resources/carrier/en/1.txt +1 -0
  52. data/data/libphonenumber/resources/carrier/en/248.txt +2 -0
  53. data/data/libphonenumber/resources/carrier/en/373.txt +0 -1
  54. data/data/libphonenumber/resources/carrier/en/60.txt +189 -43
  55. data/data/libphonenumber/resources/carrier/en/63.txt +2 -0
  56. data/data/libphonenumber/resources/carrier/en/92.txt +1 -0
  57. data/data/libphonenumber/resources/carrier/en/94.txt +3 -0
  58. data/data/libphonenumber/resources/carrier/en/95.txt +1 -0
  59. data/data/libphonenumber/resources/carrier/en/960.txt +1 -1
  60. data/data/libphonenumber/resources/carrier/en/972.txt +1 -0
  61. data/data/phone_data.dat +0 -0
  62. data/lib/phonelib/core.rb +12 -2
  63. data/lib/phonelib/data_importer.rb +46 -0
  64. data/lib/phonelib/phone_analyzer.rb +45 -33
  65. data/lib/phonelib/version.rb +1 -1
  66. metadata +2 -2
@@ -872,7 +872,8 @@
872
872
  7(?:
873
873
  12|
874
874
  77
875
- )
875
+ )|
876
+ 813
876
877
  )|
877
878
  8\d{3}
878
879
  </nationalNumberPattern>
@@ -5167,11 +5168,11 @@
5167
5168
  <possibleNumberPattern>\d{3}</possibleNumberPattern>
5168
5169
  </generalDesc>
5169
5170
  <shortCode>
5170
- <nationalNumberPattern>11[0189]</nationalNumberPattern>
5171
+ <nationalNumberPattern>11[024-9]</nationalNumberPattern>
5171
5172
  <exampleNumber>119</exampleNumber>
5172
5173
  </shortCode>
5173
5174
  <emergency>
5174
- <nationalNumberPattern>11[0189]</nationalNumberPattern>
5175
+ <nationalNumberPattern>11[02689]</nationalNumberPattern>
5175
5176
  <exampleNumber>119</exampleNumber>
5176
5177
  </emergency>
5177
5178
  </territory>
@@ -8158,7 +8159,7 @@
8158
8159
  )|
8159
8160
  [2-9](?:
8160
8161
  11|
8161
- \d{4,5}
8162
+ \d{3,5}
8162
8163
  )
8163
8164
  </nationalNumberPattern>
8164
8165
  <exampleNumber>911</exampleNumber>
@@ -8287,6 +8288,7 @@
8287
8288
  <!-- https://support.google.com/plus/answer/1304917
8288
8289
  611 is listed as working from "most" wireless carriers. -->
8289
8290
  <nationalNumberPattern>
8291
+ [2-9]\d{3}|
8290
8292
  33669|
8291
8293
  611
8292
8294
  </nationalNumberPattern>
@@ -22,6 +22,7 @@
22
22
  1246252|LIME
23
23
  1246253|LIME
24
24
  1246254|LIME
25
+ 1246256|Digicel
25
26
  1246258|Digicel
26
27
  124626|Digicel
27
28
  124645|Sunbeach Communications
@@ -12,5 +12,7 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
+ 24825|CWS
16
+ 24826|CWS
15
17
  24827|Airtel
16
18
  24828|Airtel
@@ -22,7 +22,6 @@
22
22
  373610|Orange
23
23
  373611|Orange
24
24
  373621|Orange
25
- 373650|Eventis Mobile
26
25
  373671|Moldtelecom
27
26
  373672|Moldtelecom
28
27
  373673|Moldtelecom
@@ -12,12 +12,16 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
+ # Information about carries obtained from:
16
+ # http://www.skmm.gov.my/Sectors/Celco/Numbering-Management/Numbering-Management/Numbers-Assignment/Mobile-Numbers.aspx
17
+
15
18
  60102|DiGi
16
19
  601030|Celcom
17
20
  601031|Celcom
18
21
  601032|Celcom
19
22
  601033|Celcom
20
23
  601034|Celcom
24
+ 601035|Packet One
21
25
  601036|DiGi
22
26
  601037|DiGi
23
27
  601038|DiGi
@@ -26,31 +30,40 @@
26
30
  601041|Celcom
27
31
  601042|Maxis
28
32
  601043|Maxis
33
+ 601044|Packet One
34
+ 601045|Packet One
29
35
  601046|DiGi
30
- 601050|Celcom
31
- 601051|Celcom
32
- 601052|Celcom
33
- 601053|Celcom
34
- 601054|Celcom
36
+ 601050|Tune Talk
37
+ 601051|Tune Talk
38
+ 601052|Tune Talk
39
+ 601053|Tune Talk
40
+ 601054|Tune Talk
41
+ 601055|Packet One
35
42
  601056|DiGi
36
43
  601057|Celcom
37
44
  601058|Celcom
38
45
  601059|Celcom
46
+ 601060|Baraka
47
+ 601061|Baraka
48
+ 601062|Baraka
49
+ 601063|Baraka
50
+ 601064|Baraka
51
+ 601065|Packcet One
39
52
  601066|DiGi
40
53
  601070|Maxis
41
54
  601071|Maxis
42
55
  601076|DiGi
43
- 601077|Celcom
44
- 601078|Celcom
45
- 601079|Celcom
46
- 601080|Celcom
47
- 601081|Celcom
56
+ 601077|Tune Talk
57
+ 601078|Tune Talk
58
+ 601079|Tune Talk
59
+ 601080|Tune Talk
60
+ 601081|Tune Talk
48
61
  601082|DiGi
49
- 601083|Celcom
50
- 601084|Celcom
51
- 601085|Celcom
52
- 601086|Celcom
53
- 601087|Celcom
62
+ 601083|XOX
63
+ 601084|XOX
64
+ 601085|XOX
65
+ 601086|XOX
66
+ 601087|XOX
54
67
  601088|DiGi
55
68
  601089|Maxis
56
69
  601090|DiGi
@@ -65,51 +78,184 @@
65
78
  601113|Celcom
66
79
  601115|Celcom
67
80
  601116|DiGi
81
+ 6011170|YTL
82
+ 6011171|YTL
83
+ 6011172|YTL
84
+ 6011173|YTL
85
+ 6011174|YTL
86
+ 6011175|Maxis
87
+ 6011176|Maxis
88
+ 6011177|Maxis
89
+ 6011178|Maxis
90
+ 6011179|Maxis
91
+ 6011180|Telekom
92
+ 6011181|Telekom
93
+ 6011182|Telekom
94
+ 6011183|Telekom
95
+ 6011184|Telekom
96
+ 6011185|Tune Talk
97
+ 6011186|Tune Talk
98
+ 6011187|Tune Talk
99
+ 6011188|Tune Talk
100
+ 6011189|Tune Talk
68
101
  601119|Celcom
102
+ 6011200|Talk Focus
103
+ 6011201|Talk Focus
104
+ 6011202|Talk Focus
105
+ 6011203|Talk Focus
106
+ 6011204|Talk Focus
107
+ 6011205|XOX
108
+ 6011206|XOX
109
+ 6011207|XOX
110
+ 6011208|XOX
111
+ 6011209|XOX
112
+ 601121|U Mobile
113
+ 601122|Clixster
114
+ 601123|Maxis
115
+ 601124|Maxis
116
+ 601125|Maxis
69
117
  601126|DiGi
70
- 60113|Altel
71
- 60115|Altel
118
+ 6011270|U Mobile
119
+ 6011271|U Mobile
120
+ 6011272|U Mobile
121
+ 6011273|U Mobile
122
+ 6011274|U Mobile
123
+ 6011275|Maxis
124
+ 6011276|Maxis
125
+ 6011277|Maxis
126
+ 6011278|Maxis
127
+ 6011279|Maxis
128
+ 601128|U Mobile
129
+ 601129|Celecom
130
+ 601130|YTL
131
+ 601131|DiGi
132
+ 601132|Altel
133
+ 601133|DiGi
134
+ 601134|Enabling Asia
135
+ 601135|Tune Talk
136
+ 601136|DiGi
137
+ 601137|U Mobile
138
+ 601138|Ceres
139
+ 601139|U Mobile
140
+ 601140|Celcom
141
+ 601141|Celcom
142
+ 601142|Telekomunikasi Indonesia
143
+ 601150|Talk Focus
144
+ 601152|Altel
72
145
  6012|Maxis
73
146
  6013|Celcom
74
147
  60142|Maxis
75
148
  60143|DiGi
149
+ 60144|Tune Talk
76
150
  60145|Celcom
77
151
  60146|DiGi
78
152
  60147|Maxis
79
153
  60148|Celcom
80
154
  60149|DiGi
155
+ 6015460|Telekom
156
+ 6015461|Telekom
157
+ 6015462|Telekom
158
+ 6015463|Telekom
159
+ 6015464|Telekom
160
+ 60154801|Telekom
161
+ 60154802|ARL
162
+ 60154805|Offisgate
163
+ 6015481|Jaring
164
+ 60154821|TT dotCom
165
+ 60154830|EB Technologies
166
+ 60154840|REDtone
167
+ 60154841|Bizsurf
168
+ 60154845|Fristor
169
+ 60154848|Packet One
170
+ 60154849|Packet One
171
+ 60154850|MyKris
172
+ 60154851|Maxis
173
+ 60154854|GITN
174
+ 60154860|TM Net
175
+ 60154862|TM Net
176
+ 60154870|Optical Communication
177
+ 60154871|REDtone
178
+ 60154872|REDtone
179
+ 60154873|REDtone
180
+ 60154874|REDtone
181
+ 60154875|PP International
182
+ 60154876|REDtone
183
+ 60154877|REDtone
184
+ 60154878|Tg Agas
185
+ 60154879|REDtone
186
+ 60154888|Asian Broadcasting Network
187
+ 6015632|Majlis Keselamatan Negara
188
+ 6015678|Eletcoms
189
+ 6015881|Packet One
190
+ 6015882|Asiaspace
191
+ 60158850|IP Mobility
192
+ 60158860|Izzinet
81
193
  6015920|Celcom
82
194
  6015921|Celcom
83
195
  6015922|Celcom
84
196
  6015923|Celcom
85
197
  6015924|Celcom
198
+ 601596|DiGi
86
199
  6016|DiGi
87
200
  6017|Maxis
88
- 60182|TM Homeline
89
- 601831|TM Homeline
90
- 601832|TM Homeline
91
- 601833|TM Homeline
92
- 601835|TM Homeline
93
- 601836|TM Homeline
94
- 601837|TM Homeline
95
- 601838|TM Homeline
96
- 601839|TM Homeline
97
- 601840|TM Homeline
98
- 601846|TM Homeline
99
- 601847|TM Homeline
100
- 601857|TM Homeline
101
- 601866|TM Homeline
102
- 601876|TM Homeline
201
+ 6018120|U Mobile
202
+ 6018130|U Mobile
203
+ 60182|U Mobile
204
+ 601830|YTL
205
+ 601831|U Mobile
206
+ 601832|U Mobile
207
+ 601833|YTL
208
+ 601835|U Mobile
209
+ 601836|U Mobile
210
+ 601837|U Mobile
211
+ 601838|U Mobile
212
+ 601839|U Mobile
213
+ 601840|U Mobile
214
+ 601846|U Mobile
215
+ 601847|U Mobile
216
+ 601857|U Mobile
217
+ 601858|YTL
218
+ 601859|YTL
219
+ 601860|YTL
220
+ 601861|YTL
221
+ 601862|YTL
222
+ 601863|YTL
223
+ 601864|YTL
224
+ 601865|YTL
225
+ 601866|U Mobile
226
+ 601867|YTL
227
+ 601868|YTL
228
+ 601869|YTL
229
+ 601870|YTL
230
+ 601871|YTL
231
+ 601876|U Mobile
103
232
  601877|TM Homeline
104
- 601878|TM Homeline
105
- 601879|TM Homeline
106
- 601887|TM Homeline
107
- 601890|TM Homeline
108
- 601891|TM Homeline
109
- 601894|TM Homeline
110
- 601895|TM Homeline
111
- 601896|TM Homeline
112
- 601897|TM Homeline
113
- 601898|TM Homeline
114
- 601899|TM Homeline
233
+ 601878|U Mobile
234
+ 6018790|U Mobile
235
+ 6018791|U Mobile
236
+ 6018792|U Mobile
237
+ 6018793|U Mobile
238
+ 6018794|U Mobile
239
+ 6018795|YTL
240
+ 6018796|YTL
241
+ 6018797|YTL
242
+ 6018798|YTL
243
+ 6018799|YTL
244
+ 601880|YTL
245
+ 601881|YTL
246
+ 6018820|YTL
247
+ 6018821|YTL
248
+ 6018822|YTL
249
+ 6018823|YTL
250
+ 6018824|YTL
251
+ 601887|U Mobile
252
+ 601890|U Mobile
253
+ 601891|U Mobile
254
+ 601892|YTL
255
+ 601893|YTL
256
+ 601894|U Mobile
257
+ 601895|U Mobile
258
+ 601896|U Mobile
259
+ 601897|U Mobile
260
+ 601898|U Mobile
115
261
  6019|Celcom
@@ -47,7 +47,9 @@
47
47
  63947|Smart
48
48
  63948|Smart
49
49
  63949|Smart
50
+ 63950|Smart
50
51
  63975|Globe
51
52
  63976|Globe
52
53
  63995|Globe
54
+ 63998|Smart
53
55
  63999|Smart
@@ -48,3 +48,4 @@
48
48
  92345|Telenor
49
49
  92346|Telenor
50
50
  92347|Telenor
51
+ 92348|Telenor
@@ -13,7 +13,10 @@
13
13
  # limitations under the License.
14
14
 
15
15
  94117|Dialog
16
+ 9470|Mobitel
16
17
  9471|Mobitel
17
18
  9472|Etisalat
18
19
  9475|Airtel
20
+ 9476|Dialog
19
21
  9477|Dialog
22
+ 9478|Hutch
@@ -12,5 +12,6 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
+ 95978|Telenor
15
16
  95979|Telenor
16
17
  95997|Ooredoo
@@ -13,4 +13,4 @@
13
13
  # limitations under the License.
14
14
 
15
15
  9607|Dhiraagu
16
- 9609|Wataniya
16
+ 9609|Ooredoo
@@ -23,6 +23,7 @@
23
23
  9725567|Rami Levy
24
24
  9725570|Cellact
25
25
  9725571|Cellact
26
+ 9725587|Alon
26
27
  9725588|Alon
27
28
  9725589|Alon
28
29
  9725597|Azi Communications
Binary file
@@ -6,7 +6,15 @@ module Phonelib
6
6
 
7
7
  # getter for phone data for other modules of gem, can be used outside
8
8
  def phone_data
9
- @@phone_data ||= load_data
9
+ @@phone_data ||= load_data.freeze
10
+ end
11
+
12
+ # used to cache frequently-used regular expressions
13
+ @@phone_regexp_cache = {}
14
+
15
+ # getter for phone regexp cache (internal use only)
16
+ def phone_regexp_cache
17
+ @@phone_regexp_cache
10
18
  end
11
19
 
12
20
  # variable for storing geo/carrier/timezone data
@@ -14,7 +22,7 @@ module Phonelib
14
22
 
15
23
  # getter for extended phone data
16
24
  def phone_ext_data
17
- @@phone_ext_data ||= load_ext_data
25
+ @@phone_ext_data ||= load_ext_data.freeze
18
26
  end
19
27
 
20
28
  # default country for parsing variable setting
@@ -76,6 +84,8 @@ module Phonelib
76
84
  POSSIBLE_PATTERN = :possible_number_pattern
77
85
  # National prefix key
78
86
  NATIONAL_PREFIX = :national_prefix
87
+ # National prefix for parsing key
88
+ NATIONAL_PREFIX_FOR_PARSING = :national_prefix_for_parsing
79
89
  # National prefix rule key
80
90
  NATIONAL_PREFIX_RULE = :national_prefix_formatting_rule
81
91
  # Country code key
@@ -15,6 +15,8 @@ module Phonelib
15
15
  class Importer
16
16
  # main data file in repo
17
17
  MAIN_FILE = 'resources/PhoneNumberMetadata.xml'
18
+ # short number metadata
19
+ SHORT_DATA_FILE = 'resources/ShortNumberMetadata.xml'
18
20
  # alternate formats data file in repo
19
21
  FORMATS_FILE = 'resources/PhoneNumberAlternateFormats.xml'
20
22
  # geocoding data dir in repo
@@ -41,6 +43,7 @@ module Phonelib
41
43
 
42
44
  clone_repo
43
45
  import_main_data
46
+ import_short_data
44
47
  import_alternate_formats
45
48
  import_geocoding_data
46
49
  import_timezone_data
@@ -99,10 +102,42 @@ module Phonelib
99
102
  end
100
103
  end
101
104
 
105
+ country[:types] = add_possible_if_not_exists(country[:types])
106
+
102
107
  @data[country[:id]] = country
103
108
  end
104
109
  end
105
110
 
111
+ # method parses main data file
112
+ def import_short_data
113
+ puts 'IMPORTING SHORT NUMBER DATA'
114
+ main_from_xml("#{@destination}#{SHORT_DATA_FILE}").elements.each do |el|
115
+ # each country
116
+ country = get_hash_from_xml(el, :attributes)
117
+ country[:types] = {}
118
+
119
+ without_comments(el.children).each do | phone_type |
120
+ country[:types][name2sym(phone_type.name)] =
121
+ get_hash_from_xml(phone_type, :element)
122
+ end
123
+
124
+ country[:types] = add_possible_if_not_exists(country[:types])
125
+
126
+ id = country[:id]
127
+ country[:types].each do |type, data|
128
+ @data[id][:types][type] = data && next unless @data[id][:types][type]
129
+
130
+ data.each do |k, v|
131
+ if @data[id][:types][type][k]
132
+ @data[id][:types][type][k] += "|#{v}"
133
+ else
134
+ @data[id][:types][type][k] = v
135
+ end
136
+ end
137
+ end
138
+ end
139
+ end
140
+
106
141
  # method parses alternate formats file
107
142
  def import_alternate_formats
108
143
  puts 'IMPORTING ALTERNATE FORMATS'
@@ -144,6 +179,17 @@ module Phonelib
144
179
  :c)
145
180
  end
146
181
 
182
+ # adds possible pattern in case it doesn't exists
183
+ def add_possible_if_not_exists(types)
184
+ types.each do |type, data|
185
+ if data[Core::VALID_PATTERN] && !data[Core::POSSIBLE_PATTERN]
186
+ types[type][Core::POSSIBLE_PATTERN] =
187
+ data[Core::VALID_PATTERN]
188
+ end
189
+ end
190
+ types
191
+ end
192
+
147
193
  # method filters xml elements excluding comments elements
148
194
  def without_comments(data)
149
195
  data.select do |el|