twitter_cldr 1.6.0 → 1.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/Gemfile +1 -0
  2. data/History.txt +5 -0
  3. data/js/lib/twitter_cldr_js.rb +2 -0
  4. data/lib/twitter_cldr/collation/collator.rb +8 -3
  5. data/lib/twitter_cldr/collation/sort_key_builder.rb +118 -34
  6. data/lib/twitter_cldr/collation/trie_builder.rb +5 -1
  7. data/lib/twitter_cldr/resources/import/tailoring.rb +14 -5
  8. data/lib/twitter_cldr/version.rb +1 -1
  9. data/resources/collation/tailoring/af.yml +1 -0
  10. data/resources/collation/tailoring/ar.yml +1 -0
  11. data/resources/collation/tailoring/ca.yml +1 -0
  12. data/resources/collation/tailoring/cs.yml +1 -0
  13. data/resources/collation/tailoring/da.yml +2 -0
  14. data/resources/collation/tailoring/de.yml +1 -0
  15. data/resources/collation/tailoring/el.yml +1 -0
  16. data/resources/collation/tailoring/en.yml +1 -0
  17. data/resources/collation/tailoring/es.yml +1 -0
  18. data/resources/collation/tailoring/eu.yml +1 -0
  19. data/resources/collation/tailoring/fa.yml +1 -0
  20. data/resources/collation/tailoring/fi.yml +1 -0
  21. data/resources/collation/tailoring/fil.yml +1 -0
  22. data/resources/collation/tailoring/fr.yml +1 -0
  23. data/resources/collation/tailoring/he.yml +1 -0
  24. data/resources/collation/tailoring/hi.yml +1 -0
  25. data/resources/collation/tailoring/hu.yml +1 -0
  26. data/resources/collation/tailoring/id.yml +1 -0
  27. data/resources/collation/tailoring/it.yml +1 -0
  28. data/resources/collation/tailoring/ja.yml +1 -0
  29. data/resources/collation/tailoring/ko.yml +1 -0
  30. data/resources/collation/tailoring/ms.yml +1 -0
  31. data/resources/collation/tailoring/nb.yml +1 -0
  32. data/resources/collation/tailoring/nl.yml +1 -0
  33. data/resources/collation/tailoring/pl.yml +1 -0
  34. data/resources/collation/tailoring/pt.yml +1 -0
  35. data/resources/collation/tailoring/ru.yml +1 -0
  36. data/resources/collation/tailoring/sv.yml +1 -0
  37. data/resources/collation/tailoring/th.yml +1 -0
  38. data/resources/collation/tailoring/tr.yml +1 -0
  39. data/resources/collation/tailoring/uk.yml +1 -0
  40. data/resources/collation/tailoring/ur.yml +1 -0
  41. data/resources/collation/tailoring/zh-Hant.yml +1 -0
  42. data/resources/collation/tailoring/zh.yml +1 -0
  43. data/spec/collation/collator_spec.rb +118 -16
  44. data/spec/collation/sort_key_builder_spec.rb +79 -25
  45. data/spec/collation/tailoring_spec.rb +0 -76
  46. data/spec/collation/tailoring_tests/da.txt +181 -181
  47. data/spec/collation/trie_builder_spec.rb +26 -12
  48. metadata +3 -3
@@ -1,293 +1,293 @@
1
1
  # Pending: 'caseFirst="upper"' is not supported (http://unicode.org/cldr/trac/browser/tags/release-21/common/collation/da.xml#L176).
2
2
 
3
- // X
3
+ X
4
4
  x
5
5
  x x
6
- // X.
6
+ X.
7
7
  x.
8
8
  x.x
9
- // X0
9
+ X0
10
10
  x0
11
11
  x0x
12
- // X12
12
+ X12
13
13
  x12
14
14
  x12x
15
- // X2
15
+ X2
16
16
  x2
17
17
  x2x
18
- // XA
19
- // Xa
20
- // xA
18
+ XA
19
+ Xa
20
+ xA
21
21
  xa
22
- //
23
- //
24
- //
22
+
23
+
24
+
25
25
 
26
- // xAx
26
+ xAx
27
27
  xax
28
- // xÁx
28
+ xÁx
29
29
  xáx
30
- // XB
31
- // Xb
32
- // xB
30
+ XB
31
+ Xb
32
+ xB
33
33
  xb
34
- // xBx
34
+ xBx
35
35
  xbx
36
- // XC
37
- // Xc
38
- // xC
36
+ XC
37
+ Xc
38
+ xC
39
39
  xc
40
- // xCx
40
+ xCx
41
41
  xcx
42
- // XD
43
- // Xd
44
- // xD
42
+ XD
43
+ Xd
44
+ xD
45
45
  xd
46
- //
47
- //
48
- //
46
+
47
+
48
+
49
49
 
50
- //
51
- //
52
- //
50
+
51
+
52
+
53
53
 
54
- // xDx
54
+ xDx
55
55
  xdx
56
- // xĐx
56
+ xĐx
57
57
  xđx
58
- // xÐx
58
+ xÐx
59
59
  xðx
60
- // XE
61
- // Xe
62
- // xE
60
+ XE
61
+ Xe
62
+ xE
63
63
  xe
64
- //
65
- //
66
- //
64
+
65
+
66
+
67
67
 
68
- //
69
- //
70
- //
68
+
69
+
70
+
71
71
 
72
- //
73
- //
74
- //
72
+
73
+
74
+
75
75
 
76
- //
77
- //
78
- //
76
+
77
+
78
+
79
79
 
80
- // xEx
80
+ xEx
81
81
  xex
82
- // xÉx
82
+ xÉx
83
83
  xéx
84
- // xÈx
84
+ xÈx
85
85
  xèx
86
- // xÊx
86
+ xÊx
87
87
  xêx
88
- // xËx
88
+ xËx
89
89
  xëx
90
- // XF
91
- // Xf
92
- // xF
90
+ XF
91
+ Xf
92
+ xF
93
93
  xf
94
- // xFx
94
+ xFx
95
95
  xfx
96
- // XG
97
- // Xg
98
- // xG
96
+ XG
97
+ Xg
98
+ xG
99
99
  xg
100
- // xGx
100
+ xGx
101
101
  xgx
102
- // XH
103
- // Xh
104
- // xH
102
+ XH
103
+ Xh
104
+ xH
105
105
  xh
106
- // xHx
106
+ xHx
107
107
  xhx
108
- // XI
109
- // Xi
110
- // xI
108
+ XI
109
+ Xi
110
+ xI
111
111
  xi
112
- // xIx
112
+ xIx
113
113
  xix
114
- // XJ
115
- // Xj
116
- // xJ
114
+ XJ
115
+ Xj
116
+ xJ
117
117
  xj
118
- // xJx
118
+ xJx
119
119
  xjx
120
- // XK
121
- // Xk
122
- // xK
120
+ XK
121
+ Xk
122
+ xK
123
123
  xk
124
- // xKx
124
+ xKx
125
125
  xkx
126
- // XL
127
- // Xl
128
- // xL
126
+ XL
127
+ Xl
128
+ xL
129
129
  xl
130
- // xLx
130
+ xLx
131
131
  xlx
132
- // XM
133
- // Xm
134
- // xM
132
+ XM
133
+ Xm
134
+ xM
135
135
  xm
136
- // xMx
136
+ xMx
137
137
  xmx
138
- // XN
139
- // Xn
140
- // xN
138
+ XN
139
+ Xn
140
+ xN
141
141
  xn
142
- // xNx
142
+ xNx
143
143
  xnx
144
- // XO
145
- // Xo
146
- // xO
144
+ XO
145
+ Xo
146
+ xO
147
147
  xo
148
- // xOx
148
+ xOx
149
149
  xox
150
- // XP
151
- // Xp
152
- // xP
150
+ XP
151
+ Xp
152
+ xP
153
153
  xp
154
- // xPx
154
+ xPx
155
155
  xpx
156
- // XQ
157
- // Xq
158
- // xQ
156
+ XQ
157
+ Xq
158
+ xQ
159
159
  xq
160
- // xQx
160
+ xQx
161
161
  xqx
162
- // XR
163
- // Xr
164
- // xR
162
+ XR
163
+ Xr
164
+ xR
165
165
  xr
166
- // xRx
166
+ xRx
167
167
  xrx
168
- // XS
169
- // Xs
170
- // xS
168
+ XS
169
+ Xs
170
+ xS
171
171
  xs
172
- // xSx
172
+ xSx
173
173
  xsx
174
- // XT
175
- // Xt
176
- // xT
174
+ XT
175
+ Xt
176
+ xT
177
177
  xt
178
- //
179
- //
180
- //
178
+
179
+
180
+
181
181
 
182
- // xÞx
182
+ xÞx
183
183
  xþx
184
- // xTx
184
+ xTx
185
185
  xtx
186
- // XU
187
- // Xu
188
- // xU
186
+ XU
187
+ Xu
188
+ xU
189
189
  xu
190
- // xUx
190
+ xUx
191
191
  xux
192
- // XV
193
- // Xv
194
- // xV
192
+ XV
193
+ Xv
194
+ xV
195
195
  xv
196
- // xVx
196
+ xVx
197
197
  xvx
198
- // XW
199
- // Xw
200
- // xW
198
+ XW
199
+ Xw
200
+ xW
201
201
  xw
202
- // xWx
202
+ xWx
203
203
  xwx
204
- // XX
205
- // Xx
206
- // xX
204
+ XX
205
+ Xx
206
+ xX
207
207
  xx
208
- // xXx
208
+ xXx
209
209
  xxx
210
- // XY
211
- // Xy
212
- // xY
210
+ XY
211
+ Xy
212
+ xY
213
213
  xy
214
- //
215
- //
216
- //
214
+
215
+
216
+
217
217
 
218
- //
219
- //
220
- //
218
+
219
+
220
+
221
221
 
222
- // xYx
222
+ xYx
223
223
  xyx
224
- // xÜx
224
+ xÜx
225
225
  xüx
226
- // xŰx
226
+ xŰx
227
227
  xűx
228
- // XZ
229
- // Xz
230
- // xZ
228
+ XZ
229
+ Xz
230
+ xZ
231
231
  xz
232
- // xZx
232
+ xZx
233
233
  xzx
234
- //
235
- //
236
- //
234
+
235
+
236
+
237
237
 
238
- //
239
- //
240
- //
238
+
239
+
240
+
241
241
 
242
- //
243
- //
244
- //
242
+
243
+
244
+
245
245
 
246
- // xÆx
246
+ xÆx
247
247
  xæx
248
- // xÄx
248
+ xÄx
249
249
  xäx
250
- // xĘx
250
+ xĘx
251
251
  xęx
252
- //
253
- //
254
- //
252
+
253
+
254
+
255
255
 
256
- //
257
- //
258
- //
256
+
257
+
258
+
259
259
 
260
- //
261
- //
262
- //
260
+
261
+
262
+
263
263
 
264
- //
265
- //
266
- //
264
+
265
+
266
+
267
267
 
268
- // xØx
268
+ xØx
269
269
  xøx
270
- // xÖx
270
+ xÖx
271
271
  xöx
272
- // xŐx
272
+ xŐx
273
273
  xőx
274
- // xŒx
274
+ xŒx
275
275
  xœx
276
276
 
277
277
  // XAA
278
278
  XaA
279
- // XAa
279
+ XAa
280
280
 
281
- // Xaa
281
+ Xaa
282
282
 
283
283
  // xAA
284
284
  xaA
285
- // xAa
285
+ xAa
286
286
 
287
287
  xaa
288
288
  xÅx
289
289
  // xAAx
290
290
  xaAx
291
- // xAax
291
+ xAax
292
292
  xåx
293
293
  xaax
@@ -9,7 +9,7 @@ include TwitterCldr::Collation
9
9
 
10
10
  describe TrieBuilder do
11
11
 
12
- describe '#parse_trie' do
12
+ describe '.parse_trie' do
13
13
  it 'returns a trie' do
14
14
  TrieBuilder.parse_trie(fractional_uca_short_stub).should be_instance_of(Trie)
15
15
  end
@@ -104,7 +104,7 @@ END
104
104
  end
105
105
  end
106
106
 
107
- describe '#load_trie' do
107
+ describe '.load_trie' do
108
108
  it 'load FCE table from the resource into a trie' do
109
109
  mock(TrieBuilder).parse_trie('fce-table') { 'trie' }
110
110
  mock(TrieBuilder).load_resource('resource') { 'fce-table' }
@@ -113,12 +113,27 @@ END
113
113
  end
114
114
  end
115
115
 
116
- describe '#load_tailored_trie' do
116
+ let(:tailoring_resource_stub) do
117
+ <<END
118
+ ---
119
+ collator_options:
120
+ case_first: upper
121
+ tailored_table: ! '0491; [5C1B, 5, 5]
122
+
123
+ 0490; [5C1B, 5, 86]'
124
+ suppressed_contractions: ГК
125
+ ...
126
+ END
127
+ end
128
+
129
+ let(:tailoring_data) { TwitterCldr::Utils.deep_symbolize_keys(YAML.load(tailoring_resource_stub)) }
130
+
131
+ describe '.load_tailored_trie' do
117
132
  let(:locale) { :xxx }
118
133
  let(:fallback) { TrieBuilder.parse_trie(fractional_uca_short_stub) }
119
134
  let(:tailored_trie) { TrieBuilder.load_tailored_trie(locale, fallback) }
120
135
 
121
- before(:each) { mock(TwitterCldr).get_resource(:collation, :tailoring, locale) { YAML.load(tailoring_resource_stub) } }
136
+ before(:each) { mock(TrieBuilder).tailoring_data(locale) { tailoring_data } }
122
137
 
123
138
  it 'returns a TrieWithFallback' do
124
139
  tailored_trie.should be_instance_of(TrieWithFallback)
@@ -179,15 +194,14 @@ END
179
194
  END
180
195
  end
181
196
 
182
- let(:tailoring_resource_stub) do
183
- <<END
184
- ---
185
- :tailored_table: ! '0491; [5C1B, 5, 5]
197
+ end
186
198
 
187
- 0490; [5C1B, 5, 86]'
188
- :suppressed_contractions: ГК
189
- ...
190
- END
199
+ describe '.tailoring_data' do
200
+ let(:locale) { :fu }
201
+
202
+ it 'loads tailoring data' do
203
+ mock(TwitterCldr).get_resource(:collation, :tailoring, locale) { tailoring_data }
204
+ TrieBuilder.tailoring_data(locale).should == tailoring_data
191
205
  end
192
206
  end
193
207
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitter_cldr
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 6
9
- - 0
10
- version: 1.6.0
9
+ - 1
10
+ version: 1.6.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Cameron Dutro